X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=GNUmakefile;h=1ee0a1e166ec04c3424f440073292f29f6e14186;hp=199fc30512b52f75a15e78065cab5d5479ae89e3;hb=4b1cef5f03023a4977c1a0dd0e7464fd4cc1044c;hpb=bebb02a472ecf3ba95366bbd3934478433cd9498 diff --git a/GNUmakefile b/GNUmakefile index 199fc30..1ee0a1e 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -3,11 +3,20 @@ obj = $(src:.c=.o) $(asmsrc:.asm=.o) dep = $(obj:.o=.d) bin = demo +asmsrc += font.asm + inc = -I/usr/local/include -Isrc -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 +else + sdl_ldflags = `sdl-config --libs` +endif $(bin): $(obj) imago mikmod $(CC) -o $@ $(obj) $(LDFLAGS) @@ -18,6 +27,7 @@ $(bin): $(obj) imago mikmod -include $(dep) %.d: %.c + @echo dep $@ @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ .PHONY: imago @@ -40,3 +50,9 @@ clean: .PHONY: cleandep cleandep: rm -f $(dep) + +tools/csprite/csprite: + $(MAKE) -C tools/csprite + +font.asm: data/font.png tools/csprite/csprite + tools/csprite/csprite -n font -s 16x16 -r 288x32+32+17 -conv565 -nasm $< >$@