cflags = -g -Wall
cc = gcc
CC = gcc
libs = -lgpp -lm
L = /usr/local/lib/
LL = /lib/
I=/usr/local/lib/g++-include/
LIBS = $(LL)crt0.o $(LL)libc.a $(L)libg++.a
SIGNAL=$(I)signal.h $(I)sys/signal.h
SNOOPLIBS = -los2 -lvideo
options = -ZC++-comments
emxdir=d:/emx
linkflags=


default : maxfile.exe

clean:
	rm *.o *.exe

maxfile.exe : maxfile.o makefile error.o help.o utils.o sort.o read_areas.o
	$(cc) -o maxfile.exe maxfile.o error.o help.o utils.o sort.o \
				 read_areas.o -los2 -lvideo -Zmts \
				-Zstack 20000
#	emxbind -am maxfile.exe

maxfile.o : maxfile.c makefile error.h maxstruc.h utils.h maxfstruct.h maxfdefine.h sort.h mem.h read_areas.h
	$(cc) -c $(cflags) maxfile.c -ZC++-comments -Zmts

error.o : error.c maxfdefine.h
	$(cc) -c $(cflags) error.c -ZC++-comments -Zmts

help.o : help.c maxfdefine.h help.h
	$(cc) -c $(cflags) help.c -ZC++-comments -Zmts

filetype.o : filetype.c maxfdefine.h help.h
	$(cc) -c $(cflags) filetype.c -ZC++-comments -Zmts

utils.o : utils.c maxfdefine.h maxfstruct.h utils.h help.h mem.h
	$(cc) -c $(cflags) utils.c -ZC++-comments -Zmts

sort.o : sort.c maxfdefine.h maxfstruct.h sort.h
	$(cc) -c $(cflags) sort.c -ZC++-comments -Zmts

read_areas.o : read_areas.c maxstruc.h error.h maxfile.h utils.h read_areas.h maxfdefine.h maxfstruct.h
	$(cc) -c $(cflags) read_areas.c -ZC++-comments -Zmts

junk.exe : junk.c
	$(cc) -o junk.exe -g junk.c -los2

snoop.exe : snoop.c
	gcc -o snoop.exe snoop.c $(cflags) $(SNOOPLIBS) $(options)