--- manual/Makefile	2001/11/19 18:26:46	1.7
+++ manual/Makefile	2002/04/24 20:48:16	1.15
@@ -1,19 +1,34 @@
+L2H = -image_type png -split 5 -show_section_numbers -link 2 \
+      -address "support@mitgcm.org" \
+      -local_icons -noantialias -notransparent -white
+
 default:
 	@echo "Targets"
-	@echo " make all  - just the tex "
+	@echo " make all  - everything in order"
 	@echo " make tex  - tex and bibliograohy"
 	@echo " make ps   - postscript form of manual"
 	@echo " make pdf  - pdf form of manual"
-	@echo " make html - hypertext form of manual"
+	@echo " make l2h  - latex2html of manual"
+	@echo " make html - hypertext form of manual with substitutions"
+
 all:
 	make tex
+	make ps
+	make pdf
+	make ps.gz
+	make html
 
 tex:
-	latex manual
+	TEXINPUTS=.:::texinputs latex manual
 	bibtex manual
-	latex manual
-	latex manual | tee warnings
+	TEXINPUTS=.:::texinputs latex manual
+	TEXINPUTS=.:::texinputs latex manual | tee warnings
+
 ps: manual.ps
+
+ps.gz: manual.ps
+	gzip -9 -c manual.ps > manual.ps.gz
+
 pdf: manual.pdf
 
 manual.ps: manual.dvi
@@ -22,6 +37,14 @@
 manual.pdf: manual.ps
 	ps2pdf -dMaxSubsetPct=100 -dCompatibilityLevel=1.2 -dSubsetFonts=true -dEmbedAllFonts=true manual.ps manual.pdf
 
+clean: 
+	rm -f manual.{aux,bbl,blg,dvi,log,out,toc} 
+Clean:
+	make clean
+	rm -f manual.{ps,pdf}
+	rm -rf manual
+	rm -f manual.{tz,tgz} mbkup.{tz,tgz} l2h.{tz,tgz}
+
 # Note - the noantialias option here does not affect the gif images
 #        that are generated. However, it does make ppmquant to run in
 #        a way that leaves out the -floyd option. This option
@@ -39,9 +62,19 @@
 #           /usr/bin/ppmquant.orig 256
 #           !
 
-
 html:
-	latex2html -image_type gif -split 5 -show_section_numbers -link 2 -address "support@mitgcm.org" -local_icons -noantialias -white manual
+	make l2h
+	make subfigs
 
-html2:
-	latex2html -image_type gif -split 5 -show_section_numbers -link 2 -address "support@mitgcm.org" -noantialias -local_icons -white -debug m2
+l2h:
+	latex2html $(L2H) manual
+	tar -czf l2h.tgz manual
+
+debugl2h:
+	latex2html -debug -nodiscard -ldump $(L2H) manual
+
+subfigs:
+	cd manual; ../tools/make_mail_subjects.sh
+	cd manual; ../tools/figsub.sh
+	cd manual; ../tools/fix_docref_target.sh
+	tar -czf manual.tgz manual