010e24e36b25a375c2456cccf473d15ec87f5c85
[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 = -Llibs src/3dengfx/lib3dengfx.a `sdl-config --libs` -lGL -lvorbis -logg \
15            -ljpeg -lpng -lz -l3ds
16
17 $(bin): $(obj) 3dengfx libs
18         $(CXX) -o $@ $(obj) $(libs)
19
20 .PHONY: 3dengfx
21 3dengfx:
22         $(MAKE) -C src/3dengfx
23
24 .PHONY: 3dengfx-clean
25 3dengfx-clean:
26         $(MAKE) -C src/3dengfx clean
27
28 -include $(obj:.o=.d)
29
30 .PHONY: clean
31 clean:
32         $(RM) $(obj) $(bin)
33
34 .PHONY: clean-all
35 clean-all: clean 3dengfx-clean cleandep clean-libs
36
37 .PHONY: cleandep
38 cleandep:
39         $(RM) $(obj:.o=.d)
40
41 .PHONY: libs
42 libs:
43         $(MAKE) -C libs
44
45 .PHONY: clean-libs
46 clean-libs:
47         $(MAKE) -C libs clean