X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=Makefile;h=159a11908f7fb723bf7052f7460253d7bb862ec8;hb=7ce1d3ab787a4cec24649eff37f5eaab58750332;hp=4292695aadaf77953f08ea4141b342ade6c82803;hpb=a80992973feb47adfc1214ad1a3f7fc34eb345c0;p=summerhack diff --git a/Makefile b/Makefile index 4292695..159a119 100644 --- a/Makefile +++ b/Makefile @@ -1,41 +1,48 @@ -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 +incdir = -Isrc/3dengfx/src -Ilibs -Ilibs/png -Ilibs/jpeglib -Ilibs/ogg -Ilibs/vorbis +CXXFLAGS = -ansi -pedantic -Wall $(opt) $(incdir) -MMD `sdl-config --cflags` +CFLAGS = -std=c89 -pedantic -Wall $(opt) $(incdir) -MMD `sdl-config --cflags` +libs = -Llibs src/3dengfx/lib3dengfx.a `sdl-config --libs` -lGL -lvorbis -logg \ + -ljpeg -lpng -lz -l3ds -data/tex_list: $(src) - tools/find_textures >$@ +$(bin): $(obj) 3dengfx libs + $(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: clean-all +clean-all: clean 3dengfx-clean cleandep clean-libs + .PHONY: cleandep cleandep: - find src \( -name '*.d' -o -name '*.d.*' \) -exec $(RM) '{}' ';' + $(RM) $(obj:.o=.d) + +.PHONY: libs +libs: + $(MAKE) -C libs + +.PHONY: clean-libs +clean-libs: + $(MAKE) -C libs clean