-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
60 lines (39 loc) · 1.21 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
48
49
50
51
52
53
54
55
56
57
58
59
60
CC := g++
CFLAGS := -std=c++11 -Wall -lsfml-audio -lsfml-graphics -lsfml-window -lsfml-system -lBox2D -ltinyxml2 -lz -ltmxparser
BASE := HB/Core
SFML := HB/SFML
TMX := HB/Tmx
BOX2D := HB/Box2D
MODULES := $(BASE) $(SFML) $(TMX) $(BOX2D)
SOURCES := $(shell find ./ -maxdepth 1 -name '*.cpp')
INCLUDES := $(shell find ./ -maxdepth 1 -name '*.h')
STATIC_LIBS = ./HB/SFML/Hummingbird-SFML-2.1.a ./HB/Box2D/Hummingbird-Box2D.a ./HB/Tmx/Hummingbird-Tmx.a ./HB/Core/Hummingbird-Base.a
OBJ := $(addprefix ./,$(SOURCES:./%.cpp=%.o))
EXE := exe
.PHONY: $(BASE) $(SFML) $(TMX) $(BOX2D) clean run
all: $(MODULES) $(EXE)
$(EXE): $(OBJ)
$(CC) -o $@ $(OBJ) $(STATIC_LIBS) $(CFLAGS) -O3
%.o: %.cpp $(STATIC_LIBS)
$(CC) -c -o $@ $< $(CFLAGS) -O3
$(BASE):
@$(MAKE) -C $@;
$(SFML): $(BASE)
@$(MAKE) -C $@;
$(TMX): $(SFML)
@$(MAKE) -C $@;
$(BOX2D): $(BASE)
@$(MAKE) -C $@;
clean-$(BASE):
@$(MAKE) -C $(BASE) clean;
clean-$(SFML):
@$(MAKE) -C $(SFML) clean;
clean-$(TMX):
@$(MAKE) -C $(TMX) clean;
clean-$(BOX2D):
@$(MAKE) -C $(BOX2D) clean;
clean:
rm -rf exe *~ *.o *.a
clean-all: clean-$(BASE) clean-$(BOX2D) clean-$(SFML) clean-$(TMX) clean
run: all
./$(EXE)