summaryrefslogtreecommitdiff
path: root/support/splint/examples/ld/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'support/splint/examples/ld/Makefile')
-rw-r--r--support/splint/examples/ld/Makefile47
1 files changed, 29 insertions, 18 deletions
diff --git a/support/splint/examples/ld/Makefile b/support/splint/examples/ld/Makefile
index 24bf4a7a9f..8d876e55c9 100644
--- a/support/splint/examples/ld/Makefile
+++ b/support/splint/examples/ld/Makefile
@@ -1,4 +1,4 @@
-# Copyright 2012-2020, Alexander Shibakov
+# Copyright 2012-2024, Alexander Shibakov
# This file is part of SPLinT
#
# SPLinT is free software: you can redistribute it and/or modify
@@ -22,10 +22,11 @@ PARSER = ldp
LEXER = ldl
MANUAL = ldman
-LD_CORE_PREREQS = ${SPLINT_XTEXSTYLES} ${SPLINT_XPTABLES} ${SPLINT_XLTABLES} ${SPLINT_ROOT}cweb/bo.tok ${SPLINT_ROOT}cweb/fo.tok
-LD_DOC_PREREQS = %.tex %.sty ${PARSER}.tok ldunion.sty ldtexlex.sty ldint.sty ldfrontmatter.sty ${LD_CORE_PREREQS}
-LD_DOC_PREREQS += ptab.tex ltab.tex ld_small_tab.tex ld_small_dfa.tex ltokenset.sty lstokenset.sty
-LD_DOC_PREREQS_XREF = ${LD_DOC_PREREQS} %.scn %.idx
+LD_CORE_PREREQS = ${SPLINT_XTEXSTYLES} ${SPLINT_XTABLES}
+LD_DOC_PREREQS_STATIC = ldunion.sty ldtexlex.sty ldint.sty ltokenset.sty lstokenset.sty
+LD_DOC_PREREQS_GEN = ldptab.tex ldltab.tex ld_small_tab.tex ld_small_dfa.tex ${PARSER}.tok ldsetup.sty
+LD_DOC_PREREQS_XREF = ${LD_CORE_PREREQS} %.sty ${LD_DOC_PREREQS_STATIC} %.tex ${LD_DOC_PREREQS_GEN} %.scn %.idx
+LD_DOC_PREREQS_XREF += ldfrontmatter.sty
include ../../makefile.inc
include ${SPLINT_ROOT}makefile.loc
@@ -35,13 +36,13 @@ include ${SPLINT_ROOT}makefile.loc
ptabout: ${SPLINT_ROOT}cweb/mkeparser.c ${PARSER}.c
${CC} ${BISON_STATE} -DPARSER_FILE=\"../examples/ld/$(lastword $^)\" -DYYPARSE_PARAMETERS= -o $@ $<
-ptab.tex: ptabout
+ldptab.tex: ptabout
$< --optimize-actions --optimize-tables $@
ltabout: ${SPLINT_ROOT}cweb/mkscanner.c ldl_states.h ${LEXER}.c
${CC} -DLEXER_FILE=\"../examples/ld/$(lastword $^)\" -o $@ $<
-ltab.tex: ltabout
+ldltab.tex: ltabout
$< --optimize-actions --optimize-tables $@
${LEXER}.c: ${LEXER}.l
@@ -53,7 +54,8 @@ ${PARSER}.yy : ldgram.x
${LEXER}.ll: ldlex.x
@${CTANGLE} $<
-${MANUAL}.stx: ${MANUAL}.x ldgram.x ldlex.x ldlexo.x ldgramo.x ldnp.x
+${MANUAL}.stx \
+ldsetup.stx: ${MANUAL}.x ldgram.x ldlex.x ldlexo.x ldgramo.x ldnp.x ldexample_l.hx ldexample_t.hx alphas.hx
@${CTANGLE} $<
# term name parser for ld grammar
@@ -101,11 +103,13 @@ ldexample_%.hx: ldexample.hw
alphas.hx:
${MISCCW} --alpha-list --alpha-length=1 $@
-${MANUAL}.tex: ${MANUAL}.x ldgram.x ldlex.x ldlexo.x ldgramo.x ldnp.x ldexample_l.hx ldexample_b.hx alphas.hx
+${MANUAL}.tex: ${MANUAL}.x ldgram.x ldlex.x ldlexo.x ldgramo.x ldnp.x ldexample_l.hx ldexample_t.hx alphas.hx
+ @echo "Preparing the ${MANUAL}.tex file ..."
-${CWEAVE} $<
-${MANUAL}.sty: ${MANUAL}.stx
- ${UNLINE} $< $@
+${MANUAL}.sty \
+ldsetup.sty:%.sty: %.stx
+ ${UNLINE} $< $@
${MANUAL}.gdx: %.gdx: ${LD_DOC_PREREQS_XREF} ${PARSER}.tok
@echo "Making the bison and TeX indices ..."
@@ -116,11 +120,8 @@ ${MANUAL}.gdx: %.gdx: ${LD_DOC_PREREQS_XREF} ${PARSER}.tok
${MANUAL}.gdy: %.gdy: %.gdx
${BINDX} --fine $^ $@
-${MANUAL}.xxr: %.xxr: %.tex
- ${PDFTEX} $*.tex
-
-${MANUAL}.pdf: %.pdf: ${LD_DOC_PREREQS_XREF} %.gdy %.xxr
- ${PDFTEX} $< && touch $*.gdy && touch $*.pdf
+${MANUAL}.pdf: %.pdf: ${LD_DOC_PREREQS_XREF} %.gdy %.aux
+ ${PDFTEX} $*.tex && touch $*.gdy && touch $*.pdf
${PARSER}.tok: ldgram.tex ${MANUAL}.sty ${LD_CORE_PREREQS}
${TEX} ${MODEBOOTSTRAP} \\input $<
@@ -130,15 +131,25 @@ ldl_states.h: ldlex.tex ${MANUAL}.sty ${LD_CORE_PREREQS}
ldgram.tex ldlex.tex: \
%.tex: %.x
- -${CWEAVE} -x $<
+ @echo "Building ldgram.tex and ldlex.tex."
+ -${CWEAVE} -x $*.x
docs: ${MANUAL}.pdf
+install: docs
+ @cp ${LD_DOC_PREREQS_STATIC} ${SPLINT_INSTALL_DIR}/tex/
+ @cp ${LD_DOC_PREREQS_GEN} ${SPLINT_INSTALL_DIR}/cweb/
+
+uninstall:
+ @rm -f $(patsubst %, ${SPLINT_INSTALL_DIR}/tex/%, ${LD_DOC_PREREQS_STATIC})
+ @rm -f $(patsubst %, ${SPLINT_INSTALL_DIR}/cweb/%, ${LD_DOC_PREREQS_GEN})
+
mostlyclean: clean_temp
-rm -f ptabout ltabout ldsmalll_out ldsmallp_out ldnump_out ldnuml_out ${MANUAL}.c
clean: clean_core
- -rm -f ptabout ltabout ldsmalll_out ldsmallp_out ldnump_out ldnuml_out *.stx ldman.sty
+ -rm -f ptabout ltabout ldsmalll_out ldsmallp_out ldnump_out ldnuml_out *.stx \
+ ldman.sty ldsetup.sty
distclean: clean
cd ${SPLINT_ROOT} && ${MAKE} clean