# Makefile for MacAnova 4.00
# Copyright 1996 Christopher Bingham and Gary Oehlert
# See file COPYING for details
# This may be freely distributed as long as this notice is retained
# and file COPYING is included.

# Version 940823, revised to use platform.h
# Note: Nothing depends directly on platform.h  If that is changed, you
# must make sure things affected are re-compiled

# version 941006, revised to cope with Epx problems
# version 941205: Modified for use on HP
# version 950120: Modified to compile comclipb.c
# version 950310: Modified to compile select.c
# version 950325: Added target tarfiles and lists of source and auxiliary
#                 files
# version 950417  Added more explanatory comments and modified some macros
# version 950522  Modified to compile and link trideigen()
#         950615  Modified to include macanova.nws as auxiliary file
#         950620  Deleted macro POSTSCRIPT, added defines for glm options
#         950703  Modified to reflect name change of commonou.c to commonio.c
#         950810  Add macros MONITOR, LIBS, PARSER
#         950918  Removed macros MONITOR, LIBS, PARSER
#         950920  Added macros to set startup file for readline
#         950927  Deleted references to readLine.[co], since readLine.c has
#                 been incorporated into readFile.c
#                 Renamed readlinr.c (djgpp version) to readline.c
#         951103  Added header keywords.h
#         951222  Added file keywords.c (stuff formerly in utils.c)
#         960116  Added file studrang.c
#         960223  Added file version.h supplying macros for initiali.c
#                 and startMsg.c.  version.h is an alternate location to
#                 define any of the following used in startupMsg() and/or
#                 initialize()
#                 VERSION, MAKE_DATE, PROCESSOR_COMPILER, DATAPATHNAME,
#                 MACROPATHNAME, HELPPATHNAME, DATAFILENAME, MACROFILENAME,
#                 HELPNAME
#                 All may be defined in this Makefile
#                 It is essential that the preprocessor macro defined by
#                 make macro MACHINE be globally defined, either by
#                 definition in Makefile or by a project setting when
#                 compiling under an IDE such as Borland C or Code Warrior
#          960308 Added file labutils.c
#          960314 Changed to version 4.00

# Note: The date is now set in version.h
DAY = 03/20/96 #date of Make; should be kept up-to-date 
VERSIONNUMBER = 4.00
RELEASENUMBER = 0

# In order to use the readline line editor and history maintainer, macro
# READLINE must be defined.

# Header files readline.h and history.h need to be accessible if READLINE
# is defined in Makefile.  Since readline.h includes keymaps.h which
# in turn includes chardefs.h, these too must be available.  Version 2.0
# keymaps.h also requires tilde.h

# If READLINE_LIBRARY is defined, all readline header files are included by
# e.g., #include "readline.h"; if not defined, they are included, e.g., by
# #include <readline/readline.h>. In version 2.0 of readline, any includes
# triggered by including readline.h are also controlled by READLINE_LIBRARY
# Activate -DREADLINE11 if readline 1.1 is used

# Activate one of following to change default INPUTRC file
READLINERC =#-D'DEFAULTINPUTRC="filename"' #substitute desired name
#READLINERC =-D'INPUTRCFILE="CompletePath/filename"'

READLINEFLAGS = -DREADLINE -DREADLINE_LIBRARY $(READLINERC) #-DREADLINE11
READLINELIBLOC = -L . #directory where libreadline.a is located
READLINELIB = $(READLINELIBLOC) -lreadline
TERMCAPLIBLOC = -L /usr/local/lib # where libtermcap.a is located
TERMCAPLIB = $(TERMCAPLIBLOC) -ltermcap
CURSESLIBLOC =
CURSESLIB = $(CURSESLIBLOC)

# following defines libraries used for linking readline.  
READLINELIBS = $(READLINELIB) $(TERMCAPLIB) $(CURSESLIB)

#use these if readline is not used
#READLINEFLAGS =
#READLINELIBS =

# defines for the WXWIN version

WXDIR = /SNAIL/users/gary/netsrcs/wxwin165

# All common WXWIN UNIX compiler flags and options are now in
# the central options file make.env.
include $(WXDIR)/src/make.env

WXWINOBJECTS=wx/wxmain.o wx/wxtext.o wx/wxgraph.o
WXWININCLUDES=wx/wxmain.h wx/wxmcaov.h

TARGETLIB=wxmotif
GUI=-Dwx_motif
GUISUFFIX=_motif
LDLIBS=$(MOTIFLDLIBS)
WXLIB=$(WXDIR)/lib/libwx_motif.a
XVIEW_LINK=

# these are the settings for xview
# TARGETLIB=wxxview
# GUI=-Dwx_xview
# GUISUFFIX=_ol
# LDLIBS=$(XVIEWLDLIBS)
# WXLIB=$(WXDIR)/lib/libwx_xview.a
# # not used XVIEW_LINK=

# the following are defined in the included make.env file
# that must be properly set in the wxwin distribution
# OPT=
# OPTIONS=
# DEBUG=
# WARN=
# XLIB=
# XINCLUDE=

MEMORYCOUNT = -DCOUNTMISSES #keep track of cache hits and misses
UNIX = $(READLINEFLAGS) -DDEFINETYPES $(MEMORYCOUNT) -DUNIX # -DSETJMP

PROFILE = #-p
YACC = yacc
AWK = awk
SED=/bin/sed
#SED=/usr/local/gnu/bin/sed # needed for EPX

#   MAINPARSSED is a sed script used to create mainpars.c from y.tab.c
#   MAINPARSAWK is an awk script used to create macMainpars.c and
#      macMainpars.r from mainpars.c
#   MREADERSED is a sed script used to create mreader.c from y.tab.c
#   Different versions may be needed on different machines, depending
#   on the yacc and/or sed used.  In particular, to use bison instead of yacc
#   would require a major re-thinking.
MAINPARSSED = mainpars.sed.hp
MAINPARSAWK = mainpars.awk.hp
MREADERSED = mreader.sed.hp
#MAINPARSSED = mainpars.sed.epx
#MAINPARSAWK = mainpars.awk.epx
#MREADERSED = mreader.sed.epx

# Change the following to a null definition to remove dependencey of all
# dependencies on mainpars.y
MAINPARSY = mainpars.y

#CCC = cc
CCC = gcc # djgpp or other gcc
#CFLAGS = -g # DecStation 3100 and epx
#CFLAGS = -O -Aa# HP/UX
CFLAGS = -O# djgpp or other gcc
LIBS  = $(READLINELIBS) -lm
#LIBS= -lgrx $(READLINELIBS) -lpc -lm#special libraries needed for djgpp

#MAKEFILE = Makefile.hp
#MAKEFILE = Makefile.epx
#MAKEFILE = Makefile.djg
MAKEFILE = Makefile.gcc.hp
# Select one of the MACHINE/MACHINEID pairs below or add a new one.

# The macro defined by MACHINE specifies the computer/operating system
# ("platform") MacAnova is to be run on.  Its definition will activate
# lines in platform.h and possibly elsewhere that are specific to the
# specific platform.   In particular, in platform.h a macro PLATFORM
# should be defined that is a string that describes the platform, for
# example "Hewlett-Packard HPUX on HP-PA".  This is put in save files
# to identify platform on which the save file was created.  If restore()
# finds the string in the save file differs from actual, restore will abort
# the restore if file is binary and will print a warning on an
# asciisave() file.

# $(MACHINEID) is combined with the date in $(DAY) to make up $(TODAY)
# which goes in the banner and in pre-defined variable VERSION

#MACHINE = -DDEC3100
#MACHINEID = DECStation
#MACHINE = -DHPPA
#MACHINEID = HP/UX
MACHINE = -DHPGCC
MACHINEID = HP/UX [gcc]
#MACHINE = #-DEPX
#MACHINEID = Epx
#MACHINE = -DDJGPP
#MACHINEID = DJGPP
# Special MACROS
#GO32T = d:/djgpp/bin/go32t.exe #for djgpp

# Constants for initiali.c
# Macro DATAPATHNAME specifies the directory in which the standard data
# and macro files are located.  It is used (by initialize()) together
# with macros DATAPATHNAME and macro MACROPATHNAME to create
# pre-defined CHARACTER variables DATAFILE and MACROFILE
# On DOS or Windows, this directory is set to the directory in
# which MACANOVA.EXE is located and the values of DATAPATHNAME is ignored.

# Macro HELPPATHNAME specifies the directory in which the standard help
# file is installed.  It is used (by initialize()), together with macro
# HELPNAME to create the full path name of the directory.
# On DOS or Windows, the help directory is set to the directory in
# which MACANOVA.EXE is located and the values of HELPPATHNAME is ignored.

#following two lines are for U Minnesota EP/IX computer
#DATAPATH = -D'DATAPATHNAME="/home/stat1/stat/publicdata/"'
#HELPPATH = -D'HELPPATHNAME="/home/stat1/stat/public/"'

#following two lines were for Statistics DECStations
#DATAPATH = -D'DATAPATHNAME="/usr/local/data/"'
#HELPPATH = -D'HELPPATHNAME="/PIGSEYE/users/kb/public/"'

#following two lines are for Statistics HP network
DATAPATH = -D'DATAPATHNAME="/PIGSEYE/users/kb/publicdata/"'
HELPPATH = -D'HELPPATHNAME="/PIGSEYE/users/kb/public/"'

#the following two lines are for DJGPP
#DATAPATH = -D'DATAPATHNAME=".\\"'
#HELPPATH = -D'HELPPATHNAME=".\\"'

# macanova.dat is a sample data file distributed with MacAnova.  It is
# normally installed in the directory specified by macro DATAPATHNAME
# Pre-defined CHARACTER variable DATAFILE is intialized from macros
# DATAPATHNAME and DATAFILENAME.  On DOS and Windows, DATAPATHNAME is
# ignored; the directory in which MACANOVA.EXE is located is used instead
# Your particular installation may prefer to substitute a more substantive
# collection of data
DATAFILE = -D'DATAFILENAME="macanova.dat"'

# macanova.mac contains a collection of macros distributed with
# MacAnova.  It is normally installed in the directory specified by macro
# DATAPATHNAME.  Pre-defined CHARACTER variable MACROFILE is intialized
# from DATAPATHNAME and MACROFILENAME.  On DOS and Windows, DATAPATHNAME is
# ignored; the directory in which MACANOVA.EXE is located is used instead.
MACROFILE = -D'MACROFILENAME="macanova.mac"'

# macanova.hlp is the help file.  See beginning for its format.  The help
# file is expected to be in the directory specified by macro HELPPATHNAME.
# On DOS and Windows, HELPPATHNAME is ignored;  the directory where
# MACANOVA.EXE is located is used instead.
#HELPFILE = -D'HELPNAME="macanova.hlp"' # usual form
HELPFILE = -D'HELPNAME="macanova3.36.hlp"' # name on Statistics HP's

# Constants for initiali.c and startMsg.c
# Pre-defined CHARACTER variable VERSION has value created from $(TODAY)
# and $(VERSION).  The values of $(TODAY) and $(VERSION) are also printed
# the startup banner.
TODAY = "of $(DAY) ($(MACHINEID))"
VERSION = "$(VERSIONNUMBER)"

# constants for default values of certain GLM options, used by setOptions()
GLMOPTIONS = -DDEFAULTPRINTFSTATS=0 -DDEFAULTPRINTPVALS=0

# Version 2.4x if available
MACANOVA243 = #-D'MACANOVA2AVAIL="macanova.2.43"'
#MACANOVA243 =# '-DMACANOVA2AVAIL="macanova.2.42"' # epx

# Version 3.1x if available
MACANOVA31 = #-D'MACANOVA31AVAIL="~kb/public/macanova3.1"'
#MACANOVA31 = -D'MACANOVA31AVAIL="macanova3.1"' # epx

# Previous 3.3x versions, if any
OLDVERSIONS = #-D'BACKUPS="~kb/public/macanova3.3.past.1, ~kb/public/macanova3.3.past.2 ..."'
#OLDVERSIONS = -D'BACKUPS="~stat/public/macanova3.3.past.1, ~stat/public/macanova3.3.past.2 ..."' # epx

# Note that globals.h and *Proto.h are not in GLOBALHEADERS
# on which virtually everything depends.  Thus changing these does not
# trigger recompilation of anything.
# Currently, since PROTOHEADERS has a null definition, nothing depends on
# the matProto.h, unxProto.h, or ioProto.h
# All linear model related code depends on glm.h
# All plotting related code depends on plot.h

GLOBALHEADERS = Symbol.h mainpars.h globdefs.h globkb.h handlers.h typedefs.h

GLMHEADERS = glm.h

PROTOHEADERS = #matProto.h unxProto.h ioProto.h
PLOTHEADERS = $(GLOBALHEADERS) plot.h

# Constants for making tar files
TARFLAGS = chf#create, follow symbolic links
TARVERSION = $(VERSIONNUMBER).$(RELEASENUMBER)#version and release number
SRCTARFILE = macanova$(TARVERSION).tar
AUXTARFILE = auxfiles$(TARVERSION).tar
OBJTARFILE = objfiles$(TARVERSION).tar
DISTRIBUTION = ../distribution$(VERSIONNUMBER)

# Lists of files for tar
AUXFILES =	COPYING changes.txt copying.dj macanova.dat\
	macanova.hlp macanova.nws macanova.ini macanova.mac\
	tser.mac design.mac design.hlp

SRCFILES = Makefile.dec Makefile.epx Makefile.gcc Makefile.hp\
	TarFilesAux TarFilesSrc mainpars.sed.dec mainpars.sed.hp\
	mreader.sed.dec mreader.sed.hp mainpars.awk.dec mainpars.awk.hp\
	iniMacro.awk Ifsetup.c Lang.c Macroset.c Subassig.c Symbol.c Symbol.h\
	anovacoe.c array.c batch.c betabase.c bin.c blas.c blas.h boxplot.c\
	boxprep.c cellstat.c cellstts.c changest.c cholesky.c cluster.c\
	columnop.c comclipb.c comhandl.c commonio.c concat.c contrast.c cor.c\
	dbug.h delete.c describe.c dim.c eigen.c eigutils.c errorMsg.c fft.c\
	fftProto.h fftsubs.c funbalan.c gammabas.c getmodel.c glm.c glm.h\
	glmutils.c globals.h globdefs.h globkb.h gramschm.c graphics.c\
	handlers.c handlers.h hconcat.c help.c iniMacro.c initiali.c ioProto.h\
	ipf.c iswhat.c iterfns.c iterglm.c keywords.c keywords.h linpacCH.c\
	linpacGE.c linpacQR.c linpack.h list.c lpsforwd.c lpslandb.c lpsmisc.c\
	macro.c main.c mainpars.c mainpars.h mainpars.y makeFact.c makestr.c\
	matProto.h matdat.h mathutil.c matrix.c movavg.c mreader.c mreader.y\
	myplot.c normbase.c outer.c partacf.c paste.c platform.h plot.h\
	plotutil.c polyroot.c power.c ppnd.c predtabl.c print.c printano.c\
	printreg.c pvals.c pvalsub.c qr.c random.c rankquic.c rational.c\
	readFile.c readHead.c readdata.c regpred.c rep.c restore.c rotation.c\
	run.c save.c screen.c select.c setOptio.c shell.c solve.c sort.c\
	sortquic.c split.c spool.c startMsg.c stemleaf.c stemsubs.c studentb.c\
	svd.c swp.c tabs.c term.c toeplitz.c trans.c transpos.c trideige.c\
	tser.h tserProt.h tserops.c tsersubs.c ttests.c typedefs.h unbalano.c\
	unxProto.h unxhandl.c unxio.c utils.c utilstru.c varnames.c yates.c\
	yylex.c

MACSRCFILES = mac/Makefile.mpw mac/MacAnova.r mac/SkelApple.c\
	mac/SkelEvents.c mac/SkelGetRectDevice.c mac/SkelGetWindDevice.c\
	mac/SkelGetWindRect.c mac/SkelWindTitleHt.c mac/TransSkel.c\
	mac/TransSkel.h mac/TransSkelProto.h mac/macBatchMode.c mac/macGraph.c\
	mac/macHandle.c mac/macIface.h mac/macInput.c mac/macIo.c\
	mac/macMain.c mac/macMainpars.c mac/macMainpars.r mac/macOpen.c\
	mac/macPrint.c mac/macProto.h mac/macUtils.c mac/profile.h

DJGPPSRCFILES = djgpp/Makefile.djg djgpp/control.c djgpp/doprnt.c\
	 djgpp/exphdlr.c djgpp/readline.c

BCPPSRCFILES = bcpp/maov3p5.mak

WXWINSRCFILES = wx/wxmain.cc wx/wxtext.cc wx/wxgraph.cc wx/wxmain.h wx/wxmcaov.h

# lists of object files; grouping has no current significance

UTILS = initiali.o iniMacro.o Symbol.o  Macroset.o yylex.o Lang.o\
	Ifsetup.o Subassig.o commonio.o comhandl.o comclipb.o utils.o keywords.o\
	utilstru.o glmutils.o mathutil.o

PARSERS = mainpars.o mreader.o

# If there ever was logic for the division of function binaries among
# macros here, it's been forgotten

FNSUNX = unxio.o unxhandl.o printano.o term.o
FNSPECIAL=#anything special for platform (nothing for HP, EPX)
#FNSPECIAL=doprnt.o readline.o#anything special for djgpp

FNS = concat.o macro.o makestr.o ipf.o  cellstat.o getmodel.o\
	makeFact.o readdata.o matrix.o gramschm.o unbalano.o
FNS2 = delete.o list.o array.o print.o contrast.o anovacoe.o spool.o trans.o
FNS3 = cellstts.o glm.o printreg.o describe.o  rankquic.o sortquic.o
FNS4 = graphics.o myplot.o plotutil.o help.o sort.o split.o boxprep.o
FNS5 = stemleaf.o stemsubs.o ttests.o batch.o restore.o save.o boxplot.o
FNS6 = pvals.o pvalsub.o regpred.o power.o yates.o outer.o predtabl.o rep.o\
	run.o
FNS7 = funbalan.o screen.o lpsforwd.o lpslandb.o lpsmisc.o cor.o
FNS8 = random.o iterglm.o iterfns.o tabs.o transpos.o\
	eigen.o eigutils.o
FNS9 = betabase.o gammabas.o studentb.o normbase.o
FNSKB = columnop.o hconcat.o dim.o errorMsg.o swp.o bin.o\
	readHead.o readFile.o startMsg.o \
	setOptio.o svd.o trideige.o cluster.o changest.o\
	movavg.o partacf.o toeplitz.o polyroot.o\
	fft.o fftsubs.o tserops.o tsersubs.o\
	paste.o shell.o iswhat.o qr.o solve.o cholesky.o rational.o varnames.o\
	linpacGE.o linpacQR.o linpacCH.o blas.o rotation.o\
	select.o

ALLSUB = $(UTILS) $(FNSUNX) $(FNSPECIAL) $(FNS) $(FNS2) $(FNS3)\
		$(FNS4)	$(FNS5) $(FNS6) $(FNS7) $(FNS8) $(FNS9) $(FNSKB)

ALLOBJ = main.o handlers.o	$(PARSERS) $(ALLSUB)

wxmotif:
	cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx motif

wxxview:
	cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx xview

macanova: $(TARGETLIB)
	$(MAKE) -f Makefile $(WXWINOBJECTS) GUI=$(GUI) GUISUFFIX=$(GUISUFFIX)\
                OPT='$(OPT)' LDLIBS='$(LDLIBS)' WXLIB=$(WXLIB) OPTIONS='$(OPTIONS)'\
                DEBUG='$(DEBUG)' WARN='$(WARN)' XLIB='$(XLIB)' XINCLUDE='$(XINCLUDE)'\
                XVIEW_LINK=$(XVIEW_LINK)
	$(CC) $(LDFLAGS) -o macanova $(WXWINOBJECTS) $(XVIEW_LINK) $(LDLIBS)

wx/wxmain.o:        wx/wxmain.cc  $(WXWININCLUDES)
	$(CC) -c $(CPPFLAGS) -o $@ wx/wxmain.cc

wx/wxtext.o:        wx/wxtext.cc $(WXWININCLUDES)
	$(CC) -c $(CPPFLAGS) -o $@ wx/wxtext.cc

wx/wxgraph.o:        wx/wxgraph.cc $(WXWININCLUDES)
	$(CC) -c $(CPPFLAGS) -o $@ wx/wxgraph.cc


#macanova:   $(MAINPARSY) $(ALLOBJ)
#	$(CCC) $(PROFILE) $(MACHINE) -o newmacan $(ALLOBJ) $(LIBS)
#	mv newmacan macanova

# Note that mainpars.h does not depend on mainpars.y.  It needs to be
# specially remade when any changes to mainpars.y change y.tab.h

# Note that the output from yacc is filtered by sed.  New versions of
# the sed script $(MAINPARSSED) may be needed for different versions of
# yacc

mainpars.h: Symbol.h globdefs.h globkb.h handlers.h typedefs.h $(PROTOHEADERS)
	$(YACC) -d mainpars.y
	mv y.tab.h mainpars.h
	$(SED) -f $(MAINPARSSED) y.tab.c > mainpars.c
	rm y.tab.c

mainpars.c: $(MAINPARSSED) $(GLOBALHEADERS) $(MAINPARSY) $(PROTOHEADERS)
	$(YACC) -d mainpars.y
	$(SED) -f $(MAINPARSSED) y.tab.c > mainpars.c
	rm y.tab.c
	cmp mainpars.h y.tab.h
	
# macMainpars.c and macMainpars.r are for Macintosh
macMainpars.c: mainpars.c
	$(AWK) -f $(MAINPARSAWK) mainpars.c

macMainpars.r: mainpars.c
	$(AWK) -f $(MAINPARSAWK) mainpars.c

# macIniMacro.r is for Macintosh
macIniMacro.r: iniMacro.c iniMacro.awk
	$(AWK) -f iniMacro.awk iniMacro.c

# Note that the output from yacc is filtered by sed.  New versions of
# the sed script $(MREADERSED) may be needed for different versions of
# yacc

mreader.c:	$(MREADERSED) mreader.y $(GLMHEADERS) $(PROTOHEADERS)
	$(YACC) mreader.y
	$(SED) -f $(MREADERSED) y.tab.c > mreader.c
	rm y.tab.c

initiali.o: initiali.c $(MAKEFILE) $(GLOBALHEADERS) $(PROTOHEADERS)
			$(CCC) $(MACHINE) $(CFLAGS) -c $(UNIX)\
		-D'TODAY=$(TODAY)' -D'VERSION=$(VERSION)' \
		$(DATAPATH) $(DATAFILE)	$(MACROFILE)\
		$(HELPPATH) $(HELPFILE) $(READLINEFLAGS) initiali.c

main.o: $(GLOBALHEADERS) $(GLMHEADERS) $(PROTOHEADERS) $(MAKEFILE)

$(ALLSUB): $(GLOBALHEADERS) $(PROTOHEADERS)

startMsg.o: startMsg.c $(MAKEFILE) platform.h
	$(CCC) $(MACHINE) $(CFLAGS) -c startMsg.c $(UNIX) \
	-D'TODAY=$(TODAY)' -D'VERSION=$(VERSION)' \
	$(MACANOVA243) $(MACANOVA31) $(OLDVERSIONS)

Symbol.o: Symbol.c $(PLOTHEADERS) $(PROTOHEADERS)
	$(CCC) $(MACHINE) $(CFLAGS) -c $(UNIX) Symbol.c

utils.o: utils.c $(PLOTHEADERS) $(PROTOHEADERS)
	$(CCC) $(MACHINE) $(CFLAGS) -c $(UNIX) utils.c

keywords.o: keywords.c keywords.h $(GLOBALHEADERS) $(PROTOHEADERS)
	$(CCC) $(MACHINE) $(CFLAGS) -c $(UNIX) keywords.c

setOptions.o: setOptions.c $(GLOBALHEADERS) $(MAKEFILE)
	$(CCC) $(MACHINE) $(CFLAGS) -c $(UNIX) $(GLMOPTIONS) setOptions.c

linpacCH.o linpacCE.o linpacQR.o: linpack.h blas.h typedefs.h

blas.o: blas.h typedefs.h

eigen.o: blas.h $(GLOBALHEADERS) $(PROTOHEADERS) eigen.c

readdata.o: matdat.h keywords.h $(GLOBALHEADERS) $(PROTOHEADERS)

readHead.o readFile.o: matdat.h $(GLOBALHEADERS) $(PROTOHEADERS)

glm.o varnames.o: keywords.h $(GLMHEADERS) $(GLOBALHEADERS)

anovacoe.o contrast.o funbalan.o ipf.o gramschm.o predtabl.o\
	glmutils.o getmodel.o mreader.o iterfns.o iterglm.o regpred.o\
	screen.o unbalano.o cellstts.o cellstat.o printano.o printreg.o\
	restore.o save.o: $(GLMHEADERS) $(GLOBALHEADERS)

tserops.o: tser.h keywords.h $(GLOBALHEADERS) $(PROTOHEADERS)

fft.o fftsubs.o tsersubs.o: tser.h $(GLOBALHEADERS) $(PROTOHEADERS)

plotutil.o: keywords.h $(PLOTHEADERS) $(PROTOHEADERS)

myplot.o boxplot.o graphics.o term.o: $(PLOTHEADERS) $(PROTOHEADERS)
#	$(CCC) $(MACHINE) $(CFLAGS) -c $(UNIX) $<

# special to djgpp
doprnt.o: doprnt.c
	$(CCC) $(MACHINE) -O -DJGPP -DFULLPREC -DMAXFRACT=18 -c doprnt.c

.c.o: $(GLOBALHEADERS) $(PROTOHEADERS)
	$(CCC) $(MACHINE) -D'VERSION=$(VERSION)' $(CFLAGS) -c $(UNIX) $*.c

tarfiles: $(MAKEFILE)
	tar $(TARFLAGS) $(SRCTARFILE) $(SRCFILES) $(MACSRCFILES) $(DJGPPSRCFILES)\
					$(BCPPSRCFILES) $(WXWINSRCFILES)
	mv $(SRCTARFILE) $(DISTRIBUTION)
	cd $(DISTRIBUTION);	tar $(TARFLAGS) $(AUXTARFILE) $(AUXFILES)

tarsrcfiles: $(MAKEFILE)
	tar $(TARFLAGS) $(SRCTARFILE) $(SRCFILES) $(MACSRCFILES) $(DJGPPSRCFILES)\
					$(BCPPSRCFILES) $(WXWINSRCFILES)
	mv $(SRCTARFILE) $(DISTRIBUTION)

tarauxfiles: $(MAKEFILE)
	cd $(DISTRIBUTION)/aux_files; tar $(TARFLAGS) ../$(AUXTARFILE) $(AUXFILES)

tarobjfiles: $(MAKEFILE)
	tar $(TARFLAGS) $(OBJTARFILE) $(ALLOBJ)
