###################################################################### # $Id: Makefile.inc,v 1.15 2008/12/12 21:21:46 perette Exp $ # Author: Perette Barella # Purpose: This makefile contains the make targets used # for web page development. # Copyright: Copyright 1997-2003 Perette Barella. # All rights reserved. ###################################################################### .SUFFIXES: .web .html M4=m4 -P TIDY=tidy -q -utf8 --doctype strict --preserve-entities yes VALIDATE=SP_CHARSET_FIXED=YES SP_ENCODING=UTF-8 onsgmls -wvalid -wnon-sgml-char-ref -wno-duplicate -s -wall -c /usr/local/lib/sgml/sgml.soc TEMP=/var/tmp # rebuild all files in the current directory all: ${FILES} # recursively build everything from here down build: ${FILES} @ for x in ${SUBDIRS} $$empty ; \ do \ echo "Making build in $$x." ; \ make -C $$x build || exit $$?; \ done # recursively clean up all the .html files clean: rm -f *.html *.html.mid @ for x in ${SUBDIRS} $$empty ; \ do \ echo "Making clean in $$x." ; \ make -C $$x clean || exit $$?; \ done # build all dependencies in the current directory depend: stddefs.m4 FORCE ${WEBBASE}/Include/makemake builddepend: stddefs.m4 FORCE ${WEBBASE}/Include/makemake -r # build dependencies recursively starting from ${WEBBASE} alldepend: stddefs.m4 FORCE cd ${WEBBASE}; ${WEBBASE}/Include/makemake -r # Make a .html from a .web, grepping out empty lines # if we get an m4 error, delete the .html file # run stuff through lint as we go. .web.html: @ echo "${M4} $< > $@" @ ${M4} -DFILE_SOURCE=$< -DFILE_DEST=$@ $< > ${TEMP}/$@.mid.$$$$ ;\ status=$$? ;\ if [ $$status -ne 0 ] ;\ then \ rm -f $@ ;\ else \ ${TIDY} -o $@ ${TEMP}/$@.mid.$$$$ 2> /var/tmp/$@.$$$$.tmp ; \ status=$$? ; \ if [ $$status -ne 0 ] ; \ then \ while read start line rest ; \ do \ echo ; \ echo "$$start $$line $$rest:" ; \ line=`expr $$line + 2` ; \ head -$$line ${TEMP}/$@.mid.$$$$ | tail -5 ; \ done < /var/tmp/$@.$$$$.tmp ; \ mv ${TEMP}/$@.mid.$$$$ ./$@.mid ; \ else \ rm -f ${TEMP}/$@.mid.$$$$ ./$@.mid ; \ ${VALIDATE} $@ ; \ status=$$? ; \ fi ; \ rm -f /var/tmp/$@.$$$$.tmp ; \ fi ;\ exit $$status # stddefs.m4 is built by makeinc. If makeinc gets updated, # re-run it to get the latest stddefs.m4. stddefs.m4: ${WEBBASE}/Include/makeinc ${WEBBASE}/Include/makeinc ${WEBBASE} FORCE: buildindex: ${WEBBASE}/Include/buildindex ${INDEXFILE} builddelta: ${WEBBASE}/Include/buildindex -d buildmap: ${WEBBASE}/Include/buildindex -m