updated readme file
[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 obj = $(src:.cpp=.o) $(csrc:.c=.o)
8
9 opt = -O1
10 opt = -g
11 CXXFLAGS = -ansi -pedantic -Wall $(opt) -Isrc/3dengfx/src `src/3dengfx/3dengfx-config --cflags`
12 CFLAGS = -std=c89 -pedantic -Wall $(opt) `src/3dengfx/3dengfx-config --cflags`
13 libs = src/3dengfx/lib3dengfx.a `src/3dengfx/3dengfx-config --libs-no-3dengfx` -lGL -lvorbisfile
14
15 $(bin): $(obj) src/3dengfx/lib3dengfx.a data/tex_list
16         $(CXX) -o $@ $(obj) $(libs)
17
18 src/3dengfx/lib3dengfx.a:
19         cd src/3dengfx;\
20         ./configure --with-gfxlib=sdl --disable-ft --enable-opt --disable-debug && make
21
22 data/tex_list: $(src)
23         tools/find_textures >$@
24
25 -include $(obj:.o=.d)
26
27 %.d: %.cpp
28         @set -e; rm -f $@; $(CXX) -MM $(CXXFLAGS) $< > $@.$$$$; \
29         sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; rm -f $@.$$$$
30
31 %.d: %.c
32         @set -e; rm -f $@; $(CC) -MM $(CFLAGS) $< > $@.$$$$; \
33         sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; rm -f $@.$$$$
34
35 .PHONY: clean
36 clean:
37         $(RM) $(obj) $(bin)
38
39 .PHONY: cleandep
40 cleandep:
41         find src \( -name '*.d' -o -name '*.d.*' \) -exec $(RM) '{}' ';'