X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=eradicate;a=blobdiff_plain;f=GNUmakefile;h=73f7938914d301b71395fe5748a3b199132d8a0f;hp=65e3d470849cb9c4aa5b9047d64bc059b5aa2c09;hb=HEAD;hpb=7b3c578d22e5eebc4d048655da7bc711662e2179 diff --git a/GNUmakefile b/GNUmakefile index 65e3d47..73f7938 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,13 +1,16 @@ csrc = $(wildcard src/*.c) $(wildcard src/sdl/*.c) $(wildcard src/3dgfx/*.c) +asmsrc = $(wildcard src/*.asm) -obj = $(csrc:.c=.o) +obj = $(csrc:.c=.o) $(asmsrc:.asm=.o) dep = $(obj:.o=.d) bin = game +def = -DUSE_MMX inc = -Isrc -Isrc/sdl -Isrc/3dgfx -Ilibs/imago/src +warn = -pedantic -Wall -CFLAGS = $(arch) -pedantic -Wall -g -MMD $(inc) `sdl-config --cflags` -LDFLAGS = $(arch) -Llibs/imago -limago `sdl-config --libs` -lm +CFLAGS = $(arch) $(warn) -g -MMD $(def) $(inc) `sdl-config --cflags` +LDFLAGS = $(arch) -Llibs/imago -limago $(sdl_ldflags) -lm ifneq ($(shell uname -m), i386) arch = -m32 @@ -16,10 +19,15 @@ else sdl_ldflags = `sdl-config --libs` endif +.PHONY: all +all: $(bin) $(bin): $(obj) imago $(CC) -o $@ $(obj) $(LDFLAGS) +%.o: %.asm + nasm -f elf -o $@ $< + -include $(dep) .PHONY: imago @@ -33,3 +41,7 @@ clean: .PHONY: cleandep cleandep: rm -f $(dep) + +.PHONY: data +data: + @tools/procdata