#
# GNUPLOT Makefile
#

HELPDEST=gnuplot.gih

CC = c:\gcc.137\exec\gcc.ttp

# -DVFORK if you have vfork()
# -DBCOPY if your memcpy() is called bcopy() (a Berkeleyism, right?)
# -DBZERO if you need to use bzero() (another BSD feature) instead of memset() 
# -DNOCOPY if you don't have a memcpy() by any name
# -DGAMMA if you've got gamma(3)
# -fswitch if you are compiling on a Sun3 (or even -f68881)
# -O if you trust your compiler's optimizer

OFLAGS = -O -fforce-mem -fcombine-regs -fforce-addr -finline-functions \
	 -fomit-frame-pointer

CFLAGS = $(OFLAGS) -DTOS -DBCOPY -DBZERO

# -D<terminal> in TERMFLAGS iff you wish to support <terminal>
# -DAED         AED 512 and AED 767
# -DBITGRAPH    BBN BitGraph
# -DDXY800A     Roland DXY800A plotter
# -DEEPIC	  	 EEPIC-extended LaTeX driver, for EEPIC users
# -DEPSON		Epson LX-800, Star NL-10, NX-1000 and lots of others
# -DFIG 	  	Fig graphics language (requires object.h from TransFig)
# -DGEM		GEM VDI Interface (Atari St and MSDOS)
# -DHP2648		HP2648, HP2647
# -DHP26        HP2623A and maybe others
# -DHP75        HP7580, and probably other HPs
# -DHPGL		HP7475, HP7220 plotters, and (hopefully) lots of others
# -DHPLJET		HP Laserjet, no HP Deskjet
# -DIMAGEN  	Imagen laser printers (300dpi) (requires -Iterm also)
# -DIRIS4D      IRIS4D series computer
# -DKERMIT      MS-Kermit Tektronix 4010 emulator
# -DLATEX       LATEX picture environment
# -DNEC         NEC CP6 pinwriter printer
# -DPOSTSCRIPT  Postscript
# -DPROPRINTER  IBM Proprinter
# -DQMS         QMS\QUIC laserprinter (Talaris 1200 and others)
# -DREGIS       ReGis graphics (vt125, vt220, vt240, Gigis...)
# -DSELANAR     Selanar
# -DTEK         Tektronix 4010, and probably others
# -DSUN         Sun Microsystems Workstation
# -DUNIXPC      unixpc (ATT 3b1 or ATT 7300)
# -DUNIXPLOT    unixplot
# -DV384        Vectrix 384 and tandy color printer

TERMFLAGS =  -Iterm -DGEM -DNEC -DPOSTSCRIPT -DLATEX -DHPGL -DQMS

# mjr: later on postcript, atari_screen, nec will have to be supported.
#      And a compressing deskjet driver.
#	-DAED -DBITGRAPH -DDXY800A -DEPSON -DHP2648 \
#	-DHP26 -DHP75 -DHPGL -DHPLJET -DIMAGEN -DKERMIT -DLATEX -DEEPIC \
#	-DPOSTSCRIPT -DPROPRINTER -DQMS -DREGIS -DSELANAR -DTEK \
#	-DUNIXPLOT -DV384 

OBJS = command.o eval.o graphics.o help.o internal.o misc.o parse.o\
	plot.o scanner.o setshow.o standard.o term.o util.o 

DIRS = term demo bugtest docs docs\latextut translate

CSOURCE1 = command.c setshow.c 

CSOURCE2 = help.c graphics.c internal.c 

CSOURCE3 = misc.c eval.c parse.c plot.c scanner.c standard.c 

CSOURCE4 = term.c util.c version.c

CSOURCE5 = term\aed.trm term\dxy.trm term\epson.trm term\font5x7.trm \
	term\hp26.trm term\hp2648.trm term\hpgl.trm \
	term\hpljet.trm term\iris4d.trm term\sun.trm

CSOURCE6 = term\post.trm term\pc.trm term\qms.trm term\regis.trm \
	term\tek.trm term\unixpc.trm term\unixplot.trm term\v384.trm

CSOURCE7 = term\imPcodes.h term\imagen.trm term\object.h term\fig.trm \
	term\latex.trm term\eepic.trm

## -lplot if you have -DUNIXPLOT
## -lsuntool -lsunwindow -lpixrect  if you have -DSUN
# -lgl_s if IRIS4D
#LIBS = -lm -lplot

# for tos gcc, no 68881
LIBS = -lgem -lpml -x -s

gnuplot: $(OBJS) version.o
	$(CC) $(CFLAGS) $(OBJS) version.o $(LIBS) -o gnuplot

all:	gnuplot doc

term.o: $(CSOURCE4) $(CSOURCE5) $(CSOURCE6) $(CSOURCE7)
	$(CC) $(CFLAGS) $(TERMFLAGS) -c term.c

version.o:
	$(CC) $(CFLAGS) -c version.c

$(OBJS): plot.h

command.o:
	$(CC) $(CFLAGS) -c command.c -DHELPFILE=\"$(HELPDEST)\"

command.o help.o misc.o: help.h

command.o graphics.o misc.o plot.o setshow.o: setshow.h

term.o: ./term/gem.h
