# A makefile for my home machine, to convert .ixml files to .html # (using my scheme functions), and then sync with itec100@rucs. # "make" will start a mzscheme and unison processes each time it # finds a file to make; # since I rarely update more then 1-2 files at a time, it isn't worth # trying to have a make file gather together all the .ixml names # and calling mzscheme (and then unison) just once. .PHONY: all here root lects labs hws exams .PHONY: lect lab hw exam .PHONY: rootFromRoot lectsFromRoot labsFromRoot hwsFromRoot examsFromRoots .PHONY: sync sync-interactive sync-i sync-batch sync-b # A function, to list .html for each .ixml file in the given directory, $(1). allFilesIn = $(patsubst %.ixml,%.html,$(wildcard $(1)/*.ixml)) # Note that we don't (currently) auto-instigate building on %-soln.html. SEMESTER_ROOT := /Users/ibarland/Documents/Classes/ITEC100/2009fall/ here: $(call allFilesIn,.) all: root lects labs hws exams lect: lects lab: labs hw: hws exam: exams root: $(call allFilesIn,${SEMESTER_ROOT}) lects: $(call allFilesIn,${SEMESTER_ROOT}/Lectures) $(call allFilesIn,${SEMESTER_ROOT}/Lectures/Lect*) labs: $(call allFilesIn,${SEMESTER_ROOT}/Labs) $(call allFilesIn,${SEMESTER_ROOT}/Labs/Lab*) hws: $(call allFilesIn,${SEMESTER_ROOT}/Homeworks) $(call allFilesIn,${SEMESTER_ROOT}/Homeworks/Hw*) exams: $(call allFilesIn,${SEMESTER_ROOT}/Exams) %.html: %.ixml @${MZSCHEME} ${MZ_FLAGS} ${MZ_REQUIRE} ${MZ_PROCESS} -- $< /Users/ibarland/Bin/make.sh --keep-going sync-batch # Often the index.html includes an auto-list-of-links of all other .html files; # index.html: *.html %-soln.html: %.ixml @${MZSCHEME} ${MZ_FLAGS} ${MZ_REQUIRE} ${MZ_SOLN_FLAG} ${MZ_PROCESS} -- $< /Users/ibarland/Bin/make.sh --keep-going sync-batch # If a target name ends in '.', I'll wager it came from the shell's # auto-complete seeing 'foo.html' and 'foo.ixml'. We'll make the .html # in that situation: # %.: %.html sync-batch: ${UNISON_CMD} -batch sync-interactive: ${UNISON_CMD} #sync-b: sync-batch sync-i: sync-interactive sync: sync-interactive clean: -rm *~ *#unisondiff- *.class *.ctxt MZSCHEME := /Applications/PLT/bin/mzscheme MZ_FLAGS := MZ_REQUIRE := --lib scheme --lib "Ian/Xml/ixml2html" MZ_SOLN_FLAG := --eval "(include-solutions true)" MZ_PROCESS := --eval "(for-each (l1 make __ true) (vector->list (current-command-line-arguments)))" UNISON_FLAGS := UNISON_PREFS_FILE := "unison-prefs-itec100-ibarland" # N.B. unison's prefs file is *not* a path -- unison looks inside the prefs dir (mac: ~/Library/Application\ Support/Unison) UNISON_CMD := unison-2.13.16-text ${UNISON_PREFS_FILE} ${UNISON_FLAGS}