X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=Makefile;h=d5f022e3f83c2467e564c1aa7cd115cb496a6fb2;hb=6e23259dbabaeb1711a2a5ca25b9cb421f693759;hp=459126dc36760f8c3afe8de595b10c9cbdd36a03;hpb=fe068fa879814784c45e0cb2e65dac489e8f5594;p=summerhack diff --git a/Makefile b/Makefile index 459126d..d5f022e 100644 --- a/Makefile +++ b/Makefile @@ -4,38 +4,27 @@ bin = sumhack-thelab include src/parts/Makefile-part include src/sdlvf/Makefile-part + obj = $(src:.cpp=.o) $(csrc:.c=.o) opt = -O1 opt = -g -CXXFLAGS = -ansi -pedantic -Wall $(opt) -Isrc/3dengfx/src `src/3dengfx/3dengfx-config --cflags` -CFLAGS = -std=c89 -pedantic -Wall $(opt) `src/3dengfx/3dengfx-config --cflags` -libs = src/3dengfx/lib3dengfx.a `src/3dengfx/3dengfx-config --libs-no-3dengfx` -lGL -lvorbisfile +CXXFLAGS = -ansi -pedantic -Wall $(opt) -Isrc/3dengfx/src -MMD `sdl-config --cflags` +CFLAGS = -std=c89 -pedantic -Wall $(opt) -MMD `sdl-config --cflags` +libs = src/3dengfx/lib3dengfx.a `sdl-config --libs` -lGL -lvorbisfile -ljpeg -lpng -lz -$(bin): $(obj) src/3dengfx/lib3dengfx.a data/tex_list +$(bin): $(obj) src/3dengfx/lib3dengfx.a $(CXX) -o $@ $(obj) $(libs) src/3dengfx/lib3dengfx.a: - cd src/3dengfx;\ - ./configure --with-gfxlib=sdl --disable-ft --enable-opt --disable-debug && make - -data/tex_list: $(src) - tools/find_textures >$@ + $(MAKE) -C src/3dengfx -include $(obj:.o=.d) -%.d: %.cpp - @set -e; rm -f $@; $(CXX) -MM $(CXXFLAGS) $< > $@.$$$$; \ - sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; rm -f $@.$$$$ - -%.d: %.c - @set -e; rm -f $@; $(CC) -MM $(CFLAGS) $< > $@.$$$$; \ - sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; rm -f $@.$$$$ - .PHONY: clean clean: $(RM) $(obj) $(bin) .PHONY: cleandep cleandep: - find src \( -name '*.d' -o -name '*.d.*' \) -exec $(RM) '{}' ';' + $(RM) $(obj:.o=.d)