summaryrefslogtreecommitdiff
path: root/support/splint/cweb/Makefile
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/splint/cweb/Makefile
Initial commit
Diffstat (limited to 'support/splint/cweb/Makefile')
-rw-r--r--support/splint/cweb/Makefile115
1 files changed, 115 insertions, 0 deletions
diff --git a/support/splint/cweb/Makefile b/support/splint/cweb/Makefile
new file mode 100644
index 0000000000..ec9973fb66
--- /dev/null
+++ b/support/splint/cweb/Makefile
@@ -0,0 +1,115 @@
+SPLINT_ROOT = $(shell pwd)/..
+
+include ${SPLINT_ROOT}/makefile.inc
+
+all: ${SPLINT_PTABLES} ${SPLINT_LTABLES}
+
+b%out: mkeparser.c b%.c
+ ${CC} ${BISON_STATE} -DPARSER_FILE=\"$(lastword $^)\" -DYYPARSE_PARAMETERS= -o $@ $<
+
+b%.yy: bo.x
+ ${CTANGLE} $<
+
+%yytab.tex: b%out
+ ${SPLINT_DRIVER_DIR}/$< --optimize-actions $@
+
+ltab.tex: ltout
+ ${SPLINT_DRIVER_DIR}/$< --optimize-actions $@
+
+ltout: mkscanner.c lo_states.h lo.c
+ ${CC} -DLEXER_FILE=\"$(lastword $^)\" -o $@ $<
+
+ssffo.ll lo.ll: \
+%.ll: %.x
+ ${CTANGLE} $< && rm $(patsubst %.x, %.c, $^)
+
+lo.c: lo.l
+ ${FLEX} -o $@ $<
+
+mkscanner.c mkeparser.c: \
+%.c: %.w
+ ${CTANGLE} $<
+
+# name parser
+
+smallp_out: mkeparser.c small_parser.c
+ ${CC} ${BISON_STATE} -DPARSER_FILE=\"$(lastword $^)\" -DYYPARSE_PARAMETERS= -o $@ $<
+
+smalll_out: mkscanner.c small_lexer.c
+ ${CC} -DLEXER_FILE=\"$(lastword $^)\" -o $@ $<
+
+small_tab.tex: smallp_out
+ ${SPLINT_DRIVER_DIR}/$< --optimize-actions $@
+
+small_dfa.tex: smalll_out
+ ${SPLINT_DRIVER_DIR}/$< --optimize-actions $@
+
+small_parser.yy small_lexer.ll: np.x
+ @${CTANGLE} $<
+
+bo.tex: bo.x
+ ${CWEAVE} -x $<
+
+splint.tex \
+splint.idx \
+splint.scn: splint.w bo.x lo.x np.x common.w bs.w fk.w philosophy.w references.w
+ ${CWEAVE} $<
+
+ssffo.tex \
+ssffo.idx ssffo.scn: ssffo.x
+ ${CWEAVE} $<
+
+bo.tok: bo.tex ltab.tex byytab.tex
+ ${TEX} ${MODEBOOTSTRAP} \\input $<
+
+ssffo.pdf: %.pdf: ${SPLINT_DOC_PREREQS_XREF}
+ ${PDFTEX} $*.tex
+
+ssffo.dvi: %.dvi: ${SPLINT_DOC_PREREQS_XREF}
+ ${TEX} $*.tex
+
+splint.gdx: %.gdx: ${SPLINT_DOC_PREREQS_XREF}
+ @echo "Making the bison and TeX indices ..."
+ ${TEX} $*.tex
+
+splint.pdf: %.pdf: ${SPLINT_DOC_PREREQS_XREF} %.gdy
+ ${PDFTEX} \\input $*.tex && touch $*.gdy && touch $*.pdf
+
+splint.dvi: %.dvi: ${SPLINT_DOC_PREREQS_XREF} %.gdy
+ ${TEX} $*.tex && touch $*.gdy && touch $*.dvi
+
+${SPLINT_ROOT}/tex/btokenset.sty: # stupid make weirdness
+ @
+
+# state parsing
+
+lstabout: mkscanner.c ssffo.c
+ ${CC} -DLEXER_FILE=\"$(lastword $^)\" -o $@ $<
+
+lstab.tex: lstabout
+ ${SPLINT_DRIVER_DIR}/$< --optimize-actions $@
+
+lo.tex: lo.x
+ ${CWEAVE} $<
+
+lo_states.h: lo.tex lstab.tex byytab.tex
+ ${PDFTEX} $<
+
+# clean will erase all automatically generated files in the current directory
+
+clean: clean_core
+ -rm -f ctablesout b?out ltout smallp_out \
+ smalll_out lstabout
+
+include ${SPLINT_ROOT}/makefile.loc
+
+# since bg.yy is not an intermediate file in examples/symbols/Makefile, repeated 'make all'
+# remakes bg.yy thereby forcing make to update byytab.tex, etc., which results in remaking
+# of bo.tok, lo.tex, eventually leading to remaking of splint.pdf;
+# the special target below tells make to treat bg.yy as if it were not an intermediate file
+
+.PRECIOUS: bg.yy bg.y
+
+# the files below appear as targets but are really intermediaries for other files
+
+.INTERMEDIATE: smallp_out smalll_out lstabout ltout splint.gdx