X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=GNUmakefile;h=49fb3a17884dd744b1af54a5a771d80c34c0c0c7;hp=f64feca87211e705e8b82f0aaf6dce060edbb623;hb=0ce0f59d2afd26e0956716fae169075368020a02;hpb=e4699729fda402682816fac18a3ffce416d99301 diff --git a/GNUmakefile b/GNUmakefile index f64feca..49fb3a1 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,13 +1,27 @@ -src = $(wildcard src/*.c) $(wildcard src/sdl/*.c) +src = $(wildcard src/*.c) $(wildcard src/scr/*.c) $(wildcard src/sdl/*.c) +asmsrc = $(wildcard src/*.asm) obj = $(src:.c=.o) $(asmsrc:.asm=.o) dep = $(obj:.o=.d) bin = demo -inc = -I/usr/local/include -Isrc -Isrc/sdl -Ilibs -Ilibs/imago/src -Ilibs/mikmod/include +asmsrc += cspr/dbgfont.asm cspr/confont.asm +bindata = data/loading.img + +inc = -I/usr/local/include -Isrc -Isrc/3dgfx -Isrc/scr -Isrc/sdl -Ilibs -Ilibs/imago/src -Ilibs/mikmod/include warn = -pedantic -Wall -Wno-unused-variable -Wno-unused-function -CFLAGS = $(warn) -g $(inc) `sdl-config --cflags` -LDFLAGS = -Llibs/imago -Llibs/mikmod -limago -lmikmod `sdl-config --libs` -lm +CFLAGS = $(arch) $(warn) -g $(inc) `sdl-config --cflags` +LDFLAGS = $(arch) -Llibs/imago -Llibs/mikmod -limago -lmikmod $(sdl_ldflags) -lm + +ifneq ($(shell uname -m), i386) + arch = -m32 + sdl_ldflags = -L/usr/lib/i386-linux-gnu -lSDL-1.2 +else + sdl_ldflags = `sdl-config --libs` +endif + +.PHONY: all +all: data $(bin) $(bin): $(obj) imago mikmod $(CC) -o $@ $(obj) $(LDFLAGS) @@ -15,9 +29,12 @@ $(bin): $(obj) imago mikmod %.o: %.asm nasm -f elf -o $@ $< +src/data.o: src/data.asm $(bindata) + -include $(dep) %.d: %.c + @echo dep $@ @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ .PHONY: imago @@ -40,3 +57,7 @@ clean: .PHONY: cleandep cleandep: rm -f $(dep) + +.PHONY: data +data: + @tools/procdata