-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (33 loc) · 1.13 KB
/
Makefile
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
39
40
41
42
43
44
45
46
47
vpath %.cpp zf_common
vpath %.cpp zf_inputs
vpath %.cpp zf_hud
vpath %.cpp zf_sfml
vpath %.cpp zf_sfml/animations
vpath %.cpp zf_utility
WARNING= -Wextra -Wno-switch -Wno-sign-compare -Wno-missing-braces -Wno-unused-parameter
OPTIMIZE= -fno-exceptions
CXX=clang++ ${WARNING}
OBJDIR=obj
common = $(shell (cd zf_common ; ls *.cpp ))
commonobjs = $(patsubst %, $(OBJDIR)/% , $(common:.cpp=.o))
sfml = $(shell cd zf_sfml ; ls *.cpp )
sfmlobjs = $(patsubst %, $(OBJDIR)/% , $(sfml:.cpp=.o))
sfmlsubdir = $(shell cd zf_sfml ; for F in `ls -d */` ; do cd $$F ; ls *.cpp ; cd .. ; done )
sfmlsubdirobjs = $(patsubst %, $(OBJDIR)/%, $(sfmlsubdir:.cpp=.o))
inputs = $(shell cd zf_inputs ; ls *.cpp )
inputsobjs = $(patsubst %, $(OBJDIR)/% , $(inputs:.cpp=.o))
hud = $(shell cd zf_hud ; ls *.cpp )
hudobjs = $(patsubst %, $(OBJDIR)/% , $(hud:.cpp=.o))
utility = $(shell cd zf_utility ; ls *.cpp )
utilityobjs = $(patsubst %, $(OBJDIR)/% , $(utility:.cpp=.o))
all: $(commonobjs) $(sfmlobjs) $(sfmlsubdirobjs)
$(OBJDIR)/%.o : %.cpp
$(CXX) -c -o $@ $^
clean:
rm obj/*.o
remake:
make clean
make all
debug:
@echo $(world)
.PHONY: clean remake debug