X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=Makefile;h=af6c7bf254046bcc8e8b8926a94b2394c22d03da;hb=787ad7856f5074db4fe805b15bfca61553895de1;hp=4292695aadaf77953f08ea4141b342ade6c82803;hpb=a80992973feb47adfc1214ad1a3f7fc34eb345c0;p=summerhack diff --git a/Makefile b/Makefile index 4292695..af6c7bf 100644 --- a/Makefile +++ b/Makefile @@ -1,41 +1,38 @@ -src := src/sumhack.cpp src/events.cpp -bin := sumhack-thelab +src = src/sumhack.cpp src/events.cpp +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 +obj = $(src:.cpp=.o) $(csrc:.c=.o) -$(bin): $(obj) src/3dengfx/lib3dengfx.a data/tex_list - $(CXX) -o $@ $(obj) $(libs) - -src/3dengfx/lib3dengfx.a: - cd src/3dengfx;\ - ./configure --with-gfxlib=sdl --disable-ft --enable-opt --disable-debug && make +opt = -O1 +opt = -g +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 -data/tex_list: $(src) - tools/find_textures >$@ +$(bin): $(obj) 3dengfx + $(CXX) -o $@ $(obj) $(libs) -include $(obj:.o=.d) +.PHONY: 3dengfx +3dengfx: + $(MAKE) -C src/3dengfx -%.d: %.cpp - @set -e; rm -f $@; $(CXX) -MM $(CXXFLAGS) $< > $@.$$$$; \ - sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; rm -f $@.$$$$ +.PHONY: 3dengfx-clean +3dengfx-clean: + $(MAKE) -C src/3dengfx clean -%.d: %.c - @set -e; rm -f $@; $(CC) -MM $(CFLAGS) $< > $@.$$$$; \ - sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; rm -f $@.$$$$ +-include $(obj:.o=.d) .PHONY: clean clean: $(RM) $(obj) $(bin) +.PHONY: cleanall +cleanall: clean 3dengfx-clean cleandep + .PHONY: cleandep cleandep: - find src \( -name '*.d' -o -name '*.d.*' \) -exec $(RM) '{}' ';' + $(RM) $(obj:.o=.d)