#	makefile for GRAPH 
CFLAGS= -v -ml -w-par
GRAPH = graph.obj scale.obj g31.obj g32.obj

graph.exe:  graph.obj scale.obj g31.obj g32.obj gtc.obj window.obj \
		gmouse.obj scr_ci.obj
	tcc $(CFLAGS) graph.obj scale.obj g31.obj g32.obj gtc.obj \
		window.obj gmouse.obj scr_ci.obj graphics.lib 

# grapht.exe:  graph.obj scale.obj g31.obj g32.obj gtc.obj stub.obj
# 	tcc $(CFLAGS) graph.obj scale.obj g31.obj g32.obj gtc.obj stub.obj graphics.lib

bench.exe: bench.obj gtc.obj
	tcc $(CFLAGS) bench.obj gtc.obj graphics.lib
bench.obj: bench.c
	tcc -c $(CFLAGS) bench 
gtc.obj: gtc.c g.h
	tcc -c $(CFLAGS) gtc 

#	These four versions are for hard copy devices and do not require
#	the code for interactive adjustment of parameters (menubars)
	
graphps.exe: graph.obj scale.obj g31.obj g32.obj stub.obj gps.obj config.obj
	tcc $(CFLAGS) -egraphps $(GRAPH) stub.obj gps.obj config.obj
	
graphhi.exe: graph.obj scale.obj g31.obj g32.obj stub.obj ghi.obj config.obj
	tcc $(CFLAGS) -egraphhi $(GRAPH) stub.obj ghi.obj config.obj
	
graphhp.exe: graph.obj scale.obj g31.obj g32.obj stub.obj ghp.obj config.obj
	tcc $(CFLAGS) -egraphhp $(GRAPH) stub.obj ghp.obj config.obj
	
graphli.exe: graph.obj scale.obj g31.obj g32.obj stub.obj gli.obj config.obj
	tcc $(CFLAGS) -egraphli $(GRAPH) stub.obj gli.obj config.obj
	
	
bar.o: bar.c
config.o: config.c config.h
cbreak.o: cbreak.c
getse.o: getse.c
adjust.o: adjust.c

graph.obj: graph.c graph.h g3.h g.h
g31.obj: g31.c
g32.obj: g32.c g.h g3.h
dots.obj: dots.c g3.h g.h scr_ci.h
bench.obj: bench.c
config.obj: config.c
gmouse.obj: gmouse.c window.h
scale.obj: scale.c
scr_ci.obj: scr_ci.c scr_ci.h
stub.obj: stub.c
window.obj: window.c window.h scr_ci.h

# gcga.obj: gcga.c
# gega.obj: gega.c
# gh.obj: gh.c
ghi.obj: ghi.c g.h config.h
ghp.obj: ghp.c g.h config.h
gli.obj: gli.c g.h config.h
# gpc.obj: gpc.c
gps.obj: gps.c gps.h g.h config.h
gz.obj: gz.c
font9.obj: font9.c

.c.obj:
	tcc -c $(CFLAGS) $* 

graph: graph.exe    graphhi.exe   graphhp.exe   \
	   graphli.exe  graphps.exe   #graphz.exe    

dots:  dots.exe     dotshi.exe    dotshp.exe    \
	   dotsli.exe   dotsps.exe    #dotsz.exe     

distrib: graph.zip graphsrc.zip # dots.zip
graphsrc.zip: makefile graph.h graph.c g3.h g31.c g32.c g.h gtc.c gps.h\
		gps.c gli.c ghp.c ghi.c stub.c scale.c gmouse.c scr_ci.h\
		scr_ci.c window.h window.c bench.c bench.doc config.h config.c\
		g3.doc shrink.bat graph.fil graphsrc.fil
	pkzip -u graphsrc @graphsrc.fil

graph.zip: graph.exe graphhi.exe graphhp.exe graphli.exe graphps.exe\
		graphz.exe graph.doc sinh s1 s2 s3 squares test.bat egavga.bgi\
		herc.bgi ibm8514.bgi pc3270.bgi att.bgi cga.bgi graph.fil
	-shrink graph
	-shrink graphhi
	-shrink graphhp
	-shrink graphli
	-shrink graphps
	-shrink graphz
	pkzip -u graph @graph.fil

# dots.zip: dots.exe dots.doc spiral
# 	erase dots.zip
# 	echo islzexe dots.exe             >tmp@file.bat
# 	echo if errorlevel 1 goto quit:   >>tmp@file.bat
# 	echo lzexe dots                   >>tmp@file.bat
# 	echo :quit                        >>tmp@file.bat
# 	-tmp@file
# 	erase tmp@file.bat
# 	pkzip -a dots dots.exe dots.doc spiral

