# this Makefile uses a flat directory structure for demonstration # purposes; the main directory (../..) contains a slightly more # modular organization. SPLINT_ROOT = $(shell pwd)/../.. XXPRESSION_PREREQS = %.tex %.scn %.idx %.tok ${SPLINT_XPTABLES} ${SPLINT_XLTABLES} ${SPLINT_ROOT}/cweb/bo.tok xymmap.sty xtoks.sty include ${SPLINT_ROOT}/makefile.inc include ${SPLINT_ROOT}/makefile.loc # rules specific to this example PARSER = xxpp LEXER = xxpl all: xxpression.pdf ptab.tex ltab.tex step1: ${PARSER}.y ${LEXER}.l step2: ptabout ltabout step3: ltab.tex ptab.tex step4: xymbols.sns ptabout: ${SPLINT_ROOT}/cweb/mkeparser.c ${PARSER}.c ${CC} -DPARSER_FILE=\"../examples/xxpression/$(lastword $^)\" -DYYPARSE_PARAMETERS= -o $@ $< ptab.tex: ptabout $< --optimize-actions $@ ltabout: ${SPLINT_ROOT}/cweb/mkscanner.c ${LEXER}.c ${CC} -DLEXER_FILE=\"../examples/xxpression/$(lastword $^)\" -o $@ $< ltab.tex: ltabout $< --optimize-actions $@ ${LEXER}.c: ${LEXER}.l ${FLEX} -o $@ $< test.tex xymbols.tex \ ${PARSER}.yy ${LEXER}.ll: xxpression.x @${CTANGLE} $< ${UNLINE} test.txx test.tex ${UNLINE} xymbols.txx xymbols.tex xymbols.sns: xymbols.tex xxpression.tok ${SPLINT_ROOT}/cweb/bo.tok ${SPLINT_XPTABLES} ${SPLINT_XLTABLES} ptab.tex ${PDFTEX} $< xxpression.tex: xxpression.x ${CWEAVE} $< xxpression.gdx: %.gdx: ${XXPRESSION_PREREQS} ${TEX} $*.tex xxpression.pdf: %.pdf: ${XXPRESSION_PREREQS} %.gdy ${PDFTEX} $* && touch $*.gdy && touch $*.pdf # if [ -f $*.gdx ] ; then ${BINDX} $*.gdx $*.gdy; fi xxpression.tok: xxpression.tex ${SPLINT_XPTABLES} ${SPLINT_XLTABLES} ${SPLINT_ROOT}/cweb/bo.tok ${PDFTEX} $< && touch xxpression.tok test: test.tex xymbols.sns xxpression.tok ptab.tex ltab.tex tex test.tex docs: xxpression.pdf clean: clean_core -rm -f ptabout ltabout *.txx mostlyclean: clean_temp -rm -f ptabout ltabout xxpression.c *.txx distclean: clean cd ${SPLINT_ROOT} && ${MAKE} clean .INTERMEDIATE: xxpression.gdx