Makefile: clean-all
[summerhack] / Makefile
1 src = src/sumhack.cpp src/events.cpp
2 bin = sumhack-thelab
3
4 include src/parts/Makefile-part
5 include src/sdlvf/Makefile-part
6
7
8 obj = $(src:.cpp=.o) $(csrc:.c=.o)
9
10 opt = -O1
11 opt = -g
12 CXXFLAGS = -ansi -pedantic -Wall $(opt) -Isrc/3dengfx/src -MMD `sdl-config --cflags`
13 CFLAGS = -std=c89 -pedantic -Wall $(opt) -MMD `sdl-config --cflags`
14 libs = src/3dengfx/lib3dengfx.a `sdl-config --libs` -lGL -lvorbisfile -ljpeg -lpng -lz
15
16 $(bin): $(obj) 3dengfx
17         $(CXX) -o $@ $(obj) $(libs)
18
19 .PHONY: 3dengfx
20 3dengfx:
21         $(MAKE) -C src/3dengfx
22
23 .PHONY: 3dengfx-clean
24 3dengfx-clean:
25         $(MAKE) -C src/3dengfx clean
26
27 -include $(obj:.o=.d)
28
29 .PHONY: clean
30 clean:
31         $(RM) $(obj) $(bin)
32
33 .PHONY: cleanall
34 cleanall: clean 3dengfx-clean cleandep
35
36 .PHONY: cleandep
37 cleandep:
38         $(RM) $(obj:.o=.d)