# Makefile for the TeXPS software package which includes a new DVI to PostScript
# driver and programs to generate TFM files for PostScript fonts.

# Author:
# Stephan v. Bechtolsheim
# 2119 Old Oak Drive
# West Lafayette, IN 47907
# (317) 463 0162
# svb@cssun.tamu.edu

# Copyright: see the documentation! The software's copyright
# is in the GNU (Free Software Foundation) spirit!

# To install the software do the following:
# (a) Print out file setup/local-defs.
# (b) Change setup/Makefile and setup/local-defs,
# (c) Do a "make World".
# (d) Do a "make install" (probably as superuser).
#     You should have about 7MB of space for the compilation of the whole
#     software.

# The following goals in this makefile are important:
# World: make everything (documentation is processed, the postscript files for
#      printing are generated, but not printed)
# install: after a make all install all the software (irrelevant for the
#	documentation)

World:
	@echo -n 'Make World: start time is: '
	@date
	@echo	'Executing a "make World". Will process everything, including'
	@echo	'the documentation.  The documentation is processed only, not printed.'
	@echo	'You should consider doing a make clean first, so everything is'
	@echo	'recomputed from scratch!'
	make prepare
	cd setup; make all
	@echo -n 'Make World: end time is: '
	@date

dodo:
	make prepare
	make relink
	cd doc; make codoc

install print lint prepare relink:
	cd setup; make $@

# "make depend" is followed by "make prepare" to remake all
# Makefiles.
depend:
	cd setup; make $@
	make prepare

# Documentation processing: "make all" updates any .ps files,
# in other words the document is processed once.
# Here are some additional goals:
# codoc: process complete document twice: all cross reference labels
#        should be ok, also table of contents etc. All .ps files
#	 are generated, and eveything is done from scratch.
#        This takes a bit longer that "make all" but is the recommended
#        way of processing the document.
# print-doc: make this next to print the complete documentation.
codoc:
	cd doc; make codoc
print-doc:
	cd doc; make print

clean::
	make prepare
	cd setup; make $@
	@echo make clean in `pwd`
	rm -f ,* \#* *.BAK *.bak *.CKP *~ *.o *.tmp ERR* a.out core
	rm -f .emacs_* lint ,* .,* *.dvi *.aux *.log *.toc *.lof *.lot
	rm -f dvitype.out texspell.out .*~ TAGS
	find . -name 'Makefile' -print -exec rm -f {} \;
