# gnuish Makefile

#debug options
# OPTIONS = -O2 -g -Wall -m486
#release options
OPTIONS = -O3 -m486 -Wall -fomit-frame-pointer -ffast-math -s
CC = gcc $(OPTIONS)

SRCS =  deu.c gfx.c draw.c help.c menus.c textures.c levels.c mouse.c \
	objects.c things.c info.c checks.c prefab.c editobj.c names.c wads.c readcfg.c \
	edit.c mainloop.c onscreen.c function.c 
	
OBJS = $(SRCS:.c=.o)

deth.exe: $(OBJS)
	gcc $(OPTIONS) -o deth.exe $(OBJS) -lm -lpc -lbcc2 -lgrx20 -lemu

debug: deth

clean:
	del *.o
	del deth
	del deth.exe

zip:
	pkzip source.zip *.c *.h makefile.*

tags: dummy
	ctags -r -v *.c *.h

dummy:

%.o: %.c
	$(CC) -c $< -o $@

deu.o: deu.c
gfx.o: gfx.c
draw.o: draw.c
help.o: help.c
menus.o: menus.c
textures.o: textures.c
levels.o: levels.c
mouse.o: mouse.c
objects.o: objects.c
things.o: things.c
info.o: info.c
checks.o: checks.c
prefab.o: prefab.c
editobj.o: editobj.c
names.o: names.c
wads.o: wads.c
readcfg.o: readcfg.c
edit.o: edit.c
mainloop.o: mainloop.c
onscreen.o: onscreen.c
function.o: function.c
