# Makefile generated by imake - do not edit!
# $XConsortium: imake.c,v 1.51 89/12/12 12:37:30 jim Exp $
#
# The cpp used on this machine replaces all newlines and multiple tabs and
# spaces in a macro expansion with a single space.  Imake tries to compensate
# for this, but is not always successful.
#

##################### Generic Header ######################################
# $Id: Imake.tmpl,v 1.19 1992/04/27 07:24:56 queinnec Exp $

# Define commands and other parameters specific to site:

##################### Generic Site Parameters #############################
# $Id: Site.def,v 1.9 1992/05/24 09:54:16 queinnec Exp $

HOME   		= /home/cornas/icsla/queinnec
HOST		= cornas
HOSTTYPE	= sun4

LATEX		= latex
BIBTEX		= bibtex
DELATEX		= detex -l
MAKEINDEX	= makeindex
SPELL		= ispell -l
EPELLE		= epelle -latex
PACK		= compress -f
UNPACK		= uncompress
RM		= rm -f
CC		= cc

SCCDIR          = /usr/local/schemetoc
SCC             = /usr/local/bin/scc
SCI             = /usr/local/bin/sci
SCCsubCFLAGS    = -DSPARC
CFLAGS          =
PRINT           = print
INSTALL         = install -c
FLOPPYDIR       = /fd
CVSROOT         = /usr/local/CVS.src/master

# The generic rules that hold everywhere:
.SUFFIXES: .epelle .spell .ind .idx .dvi .bbl .aux .tex .bk

.aux.dvi: ;	${LATEX} $*.tex
.tex.aux: ;	-${LATEX} $*.tex
.tex.idx: ;	-${LATEX} $*.tex
# .aux.bbl: ;	-${BIBTEX} $*
.idx.ind: ;	${MAKEINDEX} $*
.tex.spell: ;	${DELATEX} $*.tex | ${SPELL} | sort -u >$*.spell
.tex.epelle:
	DICOPLUS=${HOME}/.dicoplus.z ; export DICOPLUS ;	\
		${EPELLE} $*.tex >$*.epelle

LiSP2TeXFLAGS   = -vU -I/usr/local/lib/LiSP2TeX
.SUFFIXES: .tex .bk
.bk.tex : ;     LiSP2TeX ${LiSP2TeXFLAGS} -- $*.bk > $*.tex

###########################################################################
# $Id: Imake.rules,v 1.14 1992/04/18 19:41:56 queinnec Exp $

###################### Specific entries ###################################

# $Id: Imakefile,v 1.29 1992/04/19 08:19:11 queinnec Exp $
# The Imakefile of LiSP2TeX (can also serve as a direct Makefile)

# By default, regenerate everything and install the result.
work : install

# An useful rule to convert a bk file into a TeX file. You can insert it
# in your makefiles (or Imakefiles).
LiSP2TeXFLAGS	= -vU -I${DOCDIR}
.SUFFIXES: .tex .bk
.bk.tex : ;	LiSP2TeX ${LiSP2TeXFLAGS} -- $*.bk > $*.tex

############### Public Install procedure ######################################
### You must probably be root to make this installation
MANEXTENSION	= 1
MANDIR		= /usr/man/man${MANEXTENSION}
BINDIR		= /usr/local/bin
DOCDIR		= /usr/local/lib/LiSP2TeX
STYDIR		= /usr/local/lib/tex/inputs
INSTALL		= install -c
install : LiSP2TeX LiSP2TeX.1 LiSP2TeX.sty LiSP2TeX.bk LiSP2TeX.dvi README
	@echo
	@echo 'This may fail if you are not root !'
	@echo
	${INSTALL} -s LiSP2TeX  ${BINDIR}
	${INSTALL} LiSP2TeX.1   ${MANDIR}/LiSP2TeX.${MANEXTENSION}
	${INSTALL} LiSP2TeX.sty ${STYDIR}
	-mkdir ${DOCDIR}
	${INSTALL} LiSP2TeX.bk  ${DOCDIR}
	${INSTALL} LiSP2TeX.dvi ${DOCDIR}
	${INSTALL} README       ${DOCDIR}
	for f in *.mkgreek ; do ${INSTALL} $$f ${DOCDIR} ; done

################ End of public entries ########################################

### PORT Note: If you have Scheme->C just use this
FINDER		= find-string.scm
### Otherwise use the already expanded version of the previous file:
### This is provided since macros are not standard enough.
#FINDER 	= look.scm

### PORT Note: All dependencies are gathered in a single file: port-s2c.scm
PORT 	= port-s2c.scm
### The distributed version uses Scheme->C from Joel Bartlett.
### Adjust these paths if your Scheme->C is not there:
SCC  		= /usr/local/bin/scc -schf 14
SCI  		= /usr/local/bin/sci
S2CDIR 		= /usr/local/schemetoc

### The sources:
LiSPsources =  ${PORT} util.scm read-objects.scm read.scm \
	    scan-objects.scm scan-file.scm emit.scm pp.scm \
	    commands.scm ${FINDER} version.scm

### The documentation:
LiSPdocs    = LiSP2TeX.sty LiSP2TeX.bk \
	    LiSP2TeX.tex LiSP2TeX.bbl LiSP2TeX.dvi \
	    LiSP2TeX.1 reading.test README

### The files to include in the distribution:
LiSPallFiles =  Imakefile Makefile ${LiSPsources} look.scm ${LiSPdocs}

############### This generation is adapted to Scheme->C
LiSP2TeX.sc : ${LiSPsources}
	( echo '(module lisp2tex (main unix-main))'	; \
	  cat ${LiSPsources} )				> LiSP2TeX.sc

# Takes 62 seconds on a News3200 (20MHz r3000 MIPS)
look.scm LiSP2TeX : ${LiSPsources} LiSP2TeX.sc
	${SCC} -o LiSP2TeX LiSP2TeX.sc

############### Obtaining the documentation
LiSP2TeX.bk : version.scm
LiSP2TeX.tex : LiSP2TeX.bk
	LiSP2TeX ${LiSP2TeXFLAGS} default.mkgreek -- LiSP2TeX.bk > LiSP2TeX.tex
LiSP2TeX.dvi : LiSP2TeX.tex  LiSP2TeX.sty
	latex LiSP2TeX.tex
	bibtex LiSP2TeX
	latex LiSP2TeX.tex
	latex LiSP2TeX.tex
LiSP2TeX.spell : LiSP2TeX.tex
	delatex LiSP2TeX.tex | ispell -l | sort -u >LiSP2TeX.spell

############### Print the readable files
PRINT 		= print
PRDVI 		= prdvi
print : print.sources print.man print.dvi
print.sources :
	${PRINT} ${LiSPsources}
print.dvi : LiSP2TeX.dvi
	${PRDVI} LiSP2TeX.dvi
print.man :
	man LiSP2TeX | ${PRINT}

############### These entries are for my personal usage.
mywork :
	make TAGS
	-rm LiSP2TeX.tex LiSP2TeX*.tar.Z
	make LiSP2TeX LiSP2TeX.tex
	latex LiSP2TeX.tex
	bibtex LiSP2TeX
	latex LiSP2TeX.tex
	make private-install
	make distribution
	make install

############### Tags
TAGS-MAKER      = etags -t
TAGS : ${LiSPsources}
	${TAGS-MAKER} ${LiSPsources}

############### private install
private-install : ${HOME}/bin/${HOSTTYPE}/LiSP2TeX ${HOME}/TeX/LiSP2TeX.sty
${HOME}/bin/${HOSTTYPE}/LiSP2TeX : LiSP2TeX
	${INSTALL} -s LiSP2TeX ${HOME}/bin/${HOSTTYPE}/LiSP2TeX
${HOME}/TeX/LiSP2TeX.sty : LiSP2TeX.sty
	${INSTALL} LiSP2TeX.sty ${HOME}/TeX/LiSP2TeX.sty

############### Test with interpreter
syntax : LiSP2TeX.sc
	( echo '(load "LiSP2TeX.sc")(test-read "reading.test")' ) | ${SCI}
interp : LiSP2TeX.sc
	@echo 'Type under sci: (begin (load "LiSP2TeX.sc")(unix-main))'
	${SCI}

############### Check-in a new version
VERSIONNAME 	= `date +LiSP2TeX%y%h%d`
STATENAME   	= beta
version.scm : ${LiSPsources}
	ident -q `(cd RCS ; ls -A) | sed -e "s=,v\\$$=="` 		    |\
	 awk '/Id:/ {s += $$3} END {printf("(define version \"%g\")\n",s)}'  \
	  > version.scm
new-version :
	@echo Archive version ${VERSIONNAME} in state ${STATENAME} ; sleep 4
	co -l `cd RCS ; ls -A`
	ci -u -f -s${STATENAME} -N${VERSIONNAME} `cd RCS ; ls -A`

############### Making Distribution
LiSP2TeX.tar : ${LiSPallFiles}
	-mkdir LiSP2TeX-dir
	cp -p ${LiSPallFiles} LiSP2TeX-dir
	tar -cvf LiSP2TeX.tar LiSP2TeX-dir
	rm -rf LiSP2TeX-dir
LiSP2TeX.tar.Z : LiSP2TeX.tar
	compress -f LiSP2TeX.tar
distribution :
	chmod u+w Makefile ; make LiSP2TeX.tar.Z
	mv LiSP2TeX.tar.Z `date +LiSP2TeX%y%h%d.tar.Z`

############### Clean
clean :: cleanMakefile
	-rm Makefile TAGS
	-rm core *.BAK *~ .*.BAK .*~
	-rm *.log *.aux *.lof *.lot *.toc
	-rm *.blg
	-rm *.idx *.ilg *.ind
	-rm *.spell *.epelle
	-rm LiSP2TeX.sc LiSP2TeX.c LiSP2TeX.o
	-rm LiSP2TeX.tar
	-rm SC-TO-C*
	-rm -rf LiSP2TeX-dir
clean.all : clean
	-rm LiSP2TeX LiSP2TeX.dvi LiSP2TeX*.tar.Z LiSP2TeX.tex
	-rm look.scm version.scm
	-rm ${HOME}/bin/${HOSTTYPE}/LiSP2TeX

###################### Generic entries ####################################
# The generic entries that must be everywhere;
# This one does nothing
nothing :

# Resets the RCS'ed files to their last state
co ::
	@if [ -d RCS ]							; \
	then echo "Resets RCS checked files to their actual form..."	; \
	     co `cd RCS ; ls -A`					; \
	     echo done.							; \
	else echo "$@: No RCS files here."				; \
	fi

# Warns about currently modified RCS files not yet checked in
# as well as files that exist and which are not checked in.
notci ::
	@if [ -d RCS ] 							; \
	then {	BOOL=true						; \
		FILES=""						; \
		for f in `ls -A`					; \
		do if [ -f $$f ]					; \
		   then if rlog $$f 1>/dev/null 2>&1			; \
		  	then :						; \
		  	else FILES="$$FILES $$f"			; \
		  	fi 						; \
		   fi							; \
		done 							; \
		if [ -n "$$FILES" ]					; \
		then	BOOL=false					; \
			echo -n ">>>>>>>>>>>>>>>>>>>>>>>>>>>> "		; \
			echo "$@: These files are not under RCS:"	; \
			echo $$FILES					; \
		fi							; \
		FILES=`cd RCS ; ls -A`					; \
		FILES=`rlog -L -R $$FILES`				; \
		if [ -n "$$FILES" ]					; \
		then	BOOL=false					; \
			echo -n ">>>>>>>>>>>>>>>>>>>>>>>>>>>> "		; \
		 echo "$@: These files are not RCS checked-in back:"	; \
	     		echo "$$FILES"					; \
		fi							; \
		if $$BOOL						; \
		then	echo "$@: All files are RCS checked-in."	; \
		fi }							; \
	else echo "$@: No RCS files at all here."			; \
	fi

# Check-in back all files that are checked-out
ckpt ::
	@if [ -d RCS ]							; \
	then {	FILES=`cd RCS ; ls -A`					; \
		FILES=`rlog -L -R $$FILES` 				; \
		if [ -n "$$FILES" ]					; \
		then echo Automatic check-in of: $$FILES		; \
		     ( echo Files mechanically checked-in on `date`	\
			 by $$USER on $$HOST | 	ci -u -q $$FILES )	; \
		else echo "All files are already RCS checked-in."	; \
		fi }							; \
	else echo "$@: No RCS files here."				; \
	fi

# Erase useless files
clean ::
	-${RM} core *.BAK *~ .*.BAK .*~

# Erase useless files in a Tex, LaTeX, BibTeX contexts
cleantex ::
	-${RM} *.log *.aux *.lof *.lot *.toc
	-${RM} *.blg *.bbl
	-${RM} *.idx *.ilg *.ind
	-${RM} *.spell *.epelle
cleandvi ::
	-${RM} *.dvi

# This entry maps a make entry on all subdirectories, the work to be
# done is held in the MAPWORK variable
MAPWORK=clean
mapdirectories ::
	@for d in `ls -F | sed -e '/\/\$$/s,.\$$,,p' -e d` 	; \
	do ( cd $$d 						; \
	     echo "			on $$d: m ${MAPWORK}" 	; \
	     m "${MAPWORK}" ) 					; \
	done

# This entry compresses all not yet compressed files of a directory. The
# makefile is not compressed in order to ease the reverse action.
compress ::
	@for f in `ls -AF`					; \
	 do case $$f in *[mM]akefile|*/|*.Z) :			;; \
	                       *) echo ${PACK} $$f ; ${PACK} $$f	;; \
	           esac						; \
	        done

# This entry reverses the work of compress. It is probably simpler to
# directly type uncompress *.Z !
uncompress ::
	${UNPACK} *.Z

# This entry regenerates Makefile if necessary
IMAKECONFIGFILES=${HOME}/config/Imake.rules \
		${HOME}/config/Imake.tmpl \
		${HOME}/config/Site.def
Makefile : Imakefile ${IMAKECONFIGFILES}
	-@chmod u+w Makefile
	@imake -I$$HOME/config -DFullHomeDir=$$HOME 			\
		-DShortHostName=$$SITE -DCodedHostType=$$HOSTTYPE	\
		-DSITE_$$SITE -DHOSTTYPE_$$HOSTTYPE
	@chmod a=r Makefile

# This entry removes the generated Makefile.
cleanMakefile :
	-@if [ -f Imakefile ] ; then ${RM} -f Makefile ; fi

