# Generated automatically from Makefile.in by configure.
# Makefile.in for GNUPLOT documentation
#
# Note that the top-level file for documentation is gnuplot.doc.
# See README.
#
# To print manual:
#    make gnuplot.dvi             (for latex)
#    (print or view gnuplot.dvi)
# OR
#    make gnuplot.nroff           (for nroff)
#    (print or view gnuplot.nroff)
#   or
#    make "TROFF=itroff" troff    (for troff; use your troff here)
#

# default is what is needed for interactive gnuplot
default: gnuplot.hlp gnuplot.gih

# this tells GNU make not to export variables into the environment
# But other makes dont understand its significance, so it must
# not be the first target in the file. So it is here, before
# any variables are created, but after the default target
.NOEXPORT:

SHELL = /bin/sh

srcdir = .

prefix = /usr
exec_prefix = ${prefix}
bindir = $(exec_prefix)/bin
datadir = $(prefix)/lib
mandir = $(prefix)/man

INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644

CC     = gcc
DEFS   =  -DREADLINE=1 -DNOCWDRC=1 -DPROTOTYPES=1 -DANSI_C=1 -DX11=1 -DSTDC_HEADERS=1 -DOLD_SELECT=1 -DHAVE_VALUES_H=1 -DHAVE_UNISTD_H=1 -DHAVE_TERMIOS_H=1 -DHAVE_TCGETATTR=1 -DRETSIGTYPE=void -DHAVE_ERF=1 -DHAVE_LGAMMA=1 -DHAVE_GETCWD=1 -DHAVE_SETLINEBUF=1 -DHAVE_SLEEP=1 -DHAVE_STRNCASECMP=1 -DHAVE_STRERROR=1 -DPIPES=1 -DLINUX=1 -DHAVE_LIBPNG=1 -Dunix=1 -DAUTOCONF=1 
CFLAGS = -g -O
INCLUDES = -I$(srcdir)/.. -I$(srcdir)/../term -I.
LDFLAGS =  -s
LIBS = 

MAKEINFO = makeinfo

# substitute your troff command (and any flags) for this one
TROFF=troff

# substitute your DVI to PostScript conversion program here
DVIPS=dvips


### [tn]roff documentation
troff: gnuplot.ms titlepag.ms
	tbl $(srcdir)/gnuplot.ms | eqn | $(TROFF) -ms

nroff: gnuplot.nroff

gnuplot.nroff: gnuplot.ms titlepag.ms
	tbl $(srcdir)/gnuplot.ms | neqn | nroff -ms | col > gnuplot.nroff

ms: gnuplot.ms

gnuplot.ms: doc2ms gnuplot.doc
	./doc2ms $(srcdir)/gnuplot.doc gnuplot.ms

doc2ms: doc2ms.o
	$(CC) -o $@ doc2ms.o $(LDFLAGS) $(LIBS)

# should be generated by parent makefile, but this will only
# be used under unix (?) so its okay to do this here

allterm.h :
	@echo Expected to find allterm.h
	cat $(srcdir)/../term/*.trm > allterm.h

# all doc2somethings depend on termdoc and allterm, maybe this would
# be better as separate object file (but then we have to change all
# the other makefiles). Plus then we cannot make some doc2* filters
# use allterm.h and others use term.h

# solaris make seems to require explicit mention of the source .c file

doc2gih.o  : doc2gih.c  allterm.h termdoc.c gnuplot.doc
doc2hlp.o  : doc2hlp.c  allterm.h termdoc.c gnuplot.doc
doc2html.o : doc2html.c allterm.h termdoc.c gnuplot.doc
doc2info.o : doc2info.c allterm.h termdoc.c gnuplot.doc
doc2ipf.o  : doc2ipf.c  allterm.h termdoc.c gnuplot.doc
doc2ms.o   : doc2ms.c   allterm.h termdoc.c gnuplot.doc
doc2rtf.o  : doc2rtf.c  allterm.h termdoc.c gnuplot.doc
doc2tex.o  : doc2tex.c  allterm.h termdoc.c gnuplot.doc


# html
html : gnuplot.html

gnuplot.html : doc2html
	./doc2html $(srcdir)/gnuplot.doc gnuplot.html

doc2html : doc2html.o
	$(CC) -o $@ doc2html.o $(LDFLAGS) $(LIBS)

### LaTeX documentation
tex: gnuplot.tex

gnuplot.tex: doc2tex
	./doc2tex $(srcdir)/gnuplot.doc gnuplot.tex

doc2tex: doc2tex.o
	$(CC) -o $@ doc2tex.o $(LDFLAGS) $(LIBS)


# this is how to make DVI files
dvi: gnuplot.dvi gpcard.dvi

gnuplot.dvi: gnuplot.tex titlepag.tex toc_entr.sty
	latex gnuplot
	latex gnuplot

gpcard.dvi: gpcard.tex
	tex gpcard

# this is how to make PostScript files
# if pslatex has been installed, add "times" to titlepage.tex
ps: gnuplot.ps gpcard.ps

gnuplot.ps: gnuplot.dvi
	$(DVIPS) gnuplot

gpcard.ps: gpcard.dvi
	$(DVIPS) gpcard


# this is how to make gnuplot.hlp
hlp: gnuplot.hlp

gnuplot.hlp: doc2hlp
	./doc2hlp $(srcdir)/gnuplot.doc gnuplot.hlp

# this is how to make gnuplot.gih
gih: gnuplot.gih

gnuplot.gih: doc2gih
	./doc2gih $(srcdir)/gnuplot.doc gnuplot.gih

doc2gih: doc2gih.o
	$(CC) -o $@ doc2gih.o $(LDFLAGS) $(LIBS)

# this is how to make Info documentation
info: gnuplot.info

gnuplot.info: doc2info
	./doc2info $(srcdir)/gnuplot.doc gnuplot.info

doc2info: doc2info.o
	$(CC) -o $@ doc2info.o $(LDFLAGS) $(LIBS)


tutorial: latextut/tutorial.tex
	( cd latextut; $(MAKE) )

# this is how to check the gnuplot.doc file
check: checkdoc gnuplot.doc
	./checkdoc < $(srcdir)/gnuplot.doc

checkdoc: checkdoc.o
	$(CC) -o $@ checkdoc.o $(LDFLAGS) $(LIBS)

# For Unix and MSDOS only
install: gnuplot.gih
	$(INSTALL_DATA) gnuplot.gih $(datadir)/gnuplot.gih

uninstall:
	rm -f $(datadir)/gnuplot.gih

# for VMS only
install-vms: gnuplot.hlp
	$(INSTALL_DATA) gnuplot.hlp $(datadir)/gnuplot.hlp

# remove all derived files
# HBB: added allterm.h to the list:     
clean:
	rm -f doc2ms gnuplot.nroff gnuplot.ms \
              doc2tex gnuplot.tex gnuplot.dvi \
              gnuplot.aux gnuplot.log gnuplot.toc \
              gnuplot.ps gpcard.dvi gpcard.log gpcard.ps \
              doc2hlp gnuplot.hlp \
              doc2gih gnuplot.gih \
              checkdoc *.o core a.out allterm.h \
              gnuplot.info* gpltinfo.tex
	( cd latextut; $(MAKE) clean )

mostlyclean: clean

distclean: clean
	rm -f Makefile

realclean: distclean
	rm -f TAGS

.c.o:
	$(CC) -c $(CPPFLAGS) $(DEFS) $(INCLUDES) $(CFLAGS) $<

#the end
