# LINEAR_VOLUME enables linear volume support found in VoxKit 2.5+ drivers.
# Kernel modification may be required -- refer to Readme.
# USE_LOCAL will cause gmod to use a copy of soundcard.h found in the
# current directory.  Use this if compiling with VoxKit 2.90+ drivers.
# Refer to Readme for more information.  (2.90-2 appears to work OK)
# USE_NCURSES will compile gmod with support for special keys (arrows, etc).
# The ncurses library must be installed to compile with this defined.

DEFINES = -DLINEAR_VOLUME -DUSE_LOCAL -DUSE_NCURSES
LIBS = -lncurses

CFLAGS = -O2 -m486 -fomit-frame-pointer -Wall $(DEFINES)
#CFLAGS = -Wall $(DEFINES)

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 read_rc.o signals.o \
	terminal.o

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

gmod: $(OFILES)
	$(CC) -s -o gmod $(OFILES) $(LIBS)
#added by Peter Federighi (it's always good to 'sync' when done with compiling)
	sync

# dependencies obtained using "cc -MM *.c"

compress.o : compress.c defines.h structs.h globals.h 
cvt_period.o : cvt_period.c defines.h structs.h globals.h 
dump.o : dump.c defines.h structs.h globals.h 
effects.o : effects.c defines.h structs.h globals.h protos.h 
gmod.o : gmod.c defines.h structs.h tables.h protos.h 
init.o : init.c defines.h structs.h globals.h 
load_669.o : load_669.c commands.h defines.h structs.h globals.h protos.h 
load_mod.o : load_mod.c commands.h defines.h structs.h globals.h protos.h 
load_mtm.o : load_mtm.c commands.h defines.h structs.h globals.h protos.h 
load_s3m.o : load_s3m.c commands.h defines.h structs.h globals.h protos.h 
load_ult.o : load_ult.c commands.h defines.h structs.h globals.h protos.h 
message.o : message.c 
misc.o : misc.c defines.h structs.h globals.h 
parse.o : parse.c defines.h structs.h globals.h 
patch_load.o : patch_load.c defines.h structs.h globals.h protos.h 
play_mod.o : play_mod.c defines.h structs.h globals.h protos.h 
play_note.o : play_note.c commands.h defines.h structs.h globals.h protos.h 
play_voice.o : play_voice.c defines.h structs.h globals.h protos.h 
read_rc.o : read_rc.c defines.h structs.h 
signals.o : signals.c defines.h structs.h globals.h protos.h 
terminal.o : terminal.c 

#clean added by Peter Federighi
clean:
	rm -f $(OFILES) gmod core
