-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (27 loc) · 874 Bytes
/
Makefile
File metadata and controls
38 lines (27 loc) · 874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
PREFIX=.
SRCDIR=$(PREFIX)/src
INCDIR=$(PREFIX)/include
BINDIR=$(PREFIX)/bin
OBJDIR=$(PREFIX)/obj
DEPDIR=$(PREFIX)/depend
SFML=C:/Library/SFML-2.1
CC=g++
CPPFLAGS=-I$(INCDIR) -I$(SFML)/include -DSFML_STATIC
CFLAGS=-c -Wall -Werror -pedantic -std=c++11 -O2 -s
LDFLAGS=-static-libgcc -static-libstdc++ -L$(SFML)/lib -lsfml-graphics-s -lsfml-window-s -lsfml-system-s
OUTFILE=$(BINDIR)/Hex.exe
SRC_FILES=$(wildcard $(SRCDIR)/*.cpp)
OBJS=$(SRC_FILES:$(SRCDIR)/%.cpp=$(OBJDIR)/%.o)
$(DEPDIR)/%.d: $(SRCDIR)/%.cpp
$(CC) $(CFLAGS) $(CPPFLAGS) -MM -MT $(OBJDIR)/$(notdir $(^:.cpp=.o)) $^> $@
include $(SRC_FILES:$(SRCDIR)/%.cpp=$(DEPDIR)/%.d)
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
$(CC) $< $(CFLAGS) $(CPPFLAGS) -o $@
$(OUTFILE): $(OBJS)
$(CC) -mwindows $^ -o $@ $(LDFLAGS)
all: $(OUTFILE)
.PHONY: clean mrproper
clean:
del obj\*.o depend\*.d
mrproper: clean
del bin\*.exe