added readme with data checkout instructions, and changed the paths in
[eradicate] / GNUmakefile
index 65e3d47..73f7938 100644 (file)
@@ -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