## ## @(#) /u/des/public_html/alumni/Makefile 1.10 98/10/31 10:45:13 ## Makefile for BFHSAA web pages (see www.gnofn.org/~bfalumni/) ## D.Singer, 6/97 ## ## this makefile makes two versions of the html files: ## one in the main directory for local use, and another set in a ## "distribution" sub-directory for use at another site. ## they must be built separately, since URLs are different. ## ## the distribution make should only be run via the "make-dist" ## target, see below. ## ## names of what will become the .html pages # NAMES = index \ presletter \ about \ mission \ directors \ officers \ committees \ membership \ calendar \ activities \ newsletter \ reunions \ directories \ addresses \ email-addrs \ email-addrs-csort \ web-addrs \ addr-form \ thanks \ keepintouch \ webmaster \ uc # acknowledgements \ ## makes name.html list # HTMLS = $(NAMES:=.html) ## makes name.hsrc list # HSRCS = $(NAMES:=.hsrc) ## name of directory where distribution set is built # DIST_DIR = alumni-dist ## auxiliary files used to generate the .html files from the .hsrc files # AUX_FILES = Makefile gen_alumni.sh gen_html.sh alumni_src.sh cvt_addr.sh ## database files # DB_FILES = email-addrs.db web-addrs.db ## files that will need to be copied # DIST_FILES = ${AUX_FILES} ${DB_FILES} ${HSRCS} ## NOTE: the macro "${DIST}" is set when making the distribution version ##------------------------------------------------------------------- ## default: ## make all .html pages; which set depends on the "DIST" macro. # docs: ${HTMLS} ## add a default rule for generating the html pages; ## there are a few special dependencies, see below; ## syntax below might be somewhat Solaris specific; # .SUFFIXES: .SUFFIXES: .html .hsrc ${SUFFIXES} .hsrc.html: ./gen_alumni.sh -q ${DIST} $* ## force a make of all pages; ## this one will NOT alter the update times # force: clean docs ## remove all html files # clean: rm -f ${HTMLS} ## force a make of all pages; ## this one WILL alter the update times, ouch! # tforce: touch docs ## set the mod times on all hsrc files to now touch: touch ${HSRCS} ##------- ## this lets you use the name of a page with no suffix as a target # ${NAMES}: $$@.html ##------- ## these targets are for use in manipulating the distribution set; ## they should be only called from the local set directory; ## clear the distribution, somewhat verbosely # erase-dist: @ echo "Before:" ; \ ls -aF ${DIST_DIR} ; \ ( cd ${DIST_DIR} && rm -f ${DIST_FILES} ${HTMLS} ) ; \ echo ; \ echo "After:" ; \ ls -aF ${DIST_DIR} ## check for differing links between the two dirs, and remove any out-of-date # cmp-dist: @ echo "" ; \ echo "Comparing..." ; \ cd ${DIST_DIR} && \ for F in ${DIST_FILES} ; do \ [ -f $$F ] || continue ; \ cmp -s $$F ../$$F || \ { echo "rm -f $$F" ; rm -f $$F ; } ; \ done ## create any missing links between the two dirs # link-dist: @ echo "" ; \ echo "Linking..." ; \ cd ${DIST_DIR} && \ for F in ${DIST_FILES} ; do \ if [ ! -f $$F ]; then \ ln ../$$F ; \ ls -l $$F ; \ fi; \ done ## clear the distribution and install all links # install-dist: @ echo "" ; \ echo "Erasing..." ; \ ( cd ${DIST_DIR} && rm -f ${DIST_FILES} ${HTMLS} ) ; \ echo "" ; \ echo "Linking..." ; \ cd ${DIST_DIR} && \ for F in ${DIST_FILES} ; do \ ln ../$$F ; \ ls -l $$F ; \ done ## update dist html pages; assumes that links are up to date; # make-dist: @ echo "" cd ${DIST_DIR} && ${MAKE} docs DIST="-dist" ## completely wipe, install, and make the dist html pages; # update-dist: cmp-dist link-dist make-dist ## completely wipe, install, and make the dist html pages; # all-dist: install-dist make-dist ##------- ## special dependencies (dependencies are cumulative) email-addrs.hsrc: email-addrs.db touch $@ email-addrs-csort.hsrc: email-addrs.db touch $@ web-addrs.hsrc: web-addrs.db touch $@ email-addrs.html: cvt_addr.sh email-addrs-csort.html: cvt_addr.sh web-addrs.html: cvt_addr.sh ## end of makefile