CFLAGS = -O2 -m486 -fomit-frame-pointer -Wall 
#CFLAGS = -Wall

OFILES = compress.o cvt_period.o dump.o effects.o gmod.o init.o load_669.o \
	load_mod.o load_mtm.o load_s3m.o load_ult.o message.o misc.o parse.o \
	patch_load.o play_mod.o play_note.o play_voice.o signals.o terminal.o

STDHFILES = defines.h structs.h globals.h

.c.o:
	$(CC) $(CFLAGS) -c $<

gmod: $(OFILES)
	$(CC) -o gmod $(OFILES)
	strip gmod

compress.o: compress.c $(STDHFILES)

cvt_period.o: cvt_period.c $(STDHFILES)

dump.o: dump.c $(STDHFILES)

effects.o: effects.c $(STDHFILES) protos.h

gmod.o: gmod.c defines.h structs.h tables.h protos.h

init.o: init.c $(STDHFILES)

load_669.o: load_669.c $(STDHFILES) commands.h

load_mod.o: load_mod.c $(STDHFILES) protos.h commands.h

load_mtm.o: load_mtm.c $(STDHFILES) protos.h commands.h

load_s3m.o: load_s3m.c $(STDHFILES) protos.h commands.h

load_ult.o: load_ult.c $(STDHFILES) protos.h commands.h

message.o: message.c

misc.o: misc.c $(STDHFILES)

parse.o: parse.c $(STDHFILES)

patch_load.o: patch_load.c $(STDHFILES) protos.h

play_mod.o: play_mod.c $(STDHFILES) protos.h

play_note.o: play_note.c $(STDHFILES) protos.h commands.h

play_voice.o: play_voice.c $(STDHFILES) protos.h

signals.o: signals.c defines.h

terminal.o: terminal.c defines.h
