X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=GNUmakefile;h=f64feca87211e705e8b82f0aaf6dce060edbb623;hp=312fd6af4bbe2b4193270c3d6774c6f028d69d40;hb=102f82ec5a8128cb076371aa3d9821e684b94380;hpb=77c1d84c258ca14e1bba06ab711426668ff24290 diff --git a/GNUmakefile b/GNUmakefile index 312fd6a..f64feca 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,15 +1,42 @@ src = $(wildcard src/*.c) $(wildcard src/sdl/*.c) -obj = $(src:.c=.o) +obj = $(src:.c=.o) $(asmsrc:.asm=.o) +dep = $(obj:.o=.d) bin = demo -inc = -Isrc -Isrc/sdl +inc = -I/usr/local/include -Isrc -Isrc/sdl -Ilibs -Ilibs/imago/src -Ilibs/mikmod/include +warn = -pedantic -Wall -Wno-unused-variable -Wno-unused-function -CFLAGS = -pedantic -Wall -g $(inc) `sdl-config --cflags` -LDFLAGS = `sdl-config --libs` -lm +CFLAGS = $(warn) -g $(inc) `sdl-config --cflags` +LDFLAGS = -Llibs/imago -Llibs/mikmod -limago -lmikmod `sdl-config --libs` -lm -$(bin): $(obj) +$(bin): $(obj) imago mikmod $(CC) -o $@ $(obj) $(LDFLAGS) +%.o: %.asm + nasm -f elf -o $@ $< + +-include $(dep) + +%.d: %.c + @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ + +.PHONY: imago +imago: + $(MAKE) -C libs/imago + +.PHONY: mikmod +mikmod: + $(MAKE) -C libs/mikmod + +.PHONY: cleanlibs +cleanlibs: + $(MAKE) -C libs/imago clean + $(MAKE) -C libs/mikmod clean + .PHONY: clean clean: rm -f $(obj) $(bin) + +.PHONY: cleandep +cleandep: + rm -f $(dep)