<commit_before>all: pdf htm-zip

SLM= SpecwareLanguageManual
HTMDIR= $(SLM).htm-dir

pdf: $(SLM).pdf

htm: $(HTMDIR)

htm-zip: htm
	rm -f $(HTMDIR).zip
	zip -r $(HTMDIR).zip $(HTMDIR)

ARCH= i586
BIN= ../bin/$(ARCH)
GLM2DBK= $(BIN)/glm2dbk
GLM2DBKMS= $(GLM2DBK) -metaslang
GLM2DBKGR= $(GLM2DBK) -grammar
SRC= ../src
GLM2DBKSRC= $(SRC)/glm2dbk.c

$(GLM2DBK): $(GLM2DBKSRC)
	cc -O $(GLM2DBKSRC) -o $(GLM2DBK)

MKRESWORDS= bin/mkreswords
MKGRAMMAR= bin/mkgrammar

DB2PDF= ../bin/db2pdf -E9999

DB2HTML= ../bin/db2html -E9999

ADJUSTFONTHTML= bin/adjustFontHTML
ANCHORHTML= bin/anchorHTML
REANCHORGRAMMARHTML= bin/reAnchorGrammarHTML
NAVLINKHTML= bin/navLinkHTML

PDFDBK= bookinfo.dbk \
        disclaimer.dbk \
        intro.dbk \
        metaslang.dbk \
        reswords.dbk \
        grammar.dbk \
        libraries.dbk

$(SLM).pdf: Makefile $(SLM).dbk $(PDFDBK)
	@if test -r $(SLM).pdf; \
	 then /bin/mv -f $(SLM).pdf $(SLM).pdf.old; \
	 fi
	($(DB2PDF) $(SLM).dbk 2>&1) | grep -v 'is not a function name'

HTMDBK= bookinfo-htm.dbk \
        disclaimer-htm.dbk \
        intro-htm.dbk \
        metaslang-htm.dbk \
        reswords-htm.dbk \
        grammar-htm.dbk \
        libraries-htm.dbk

$(HTMDIR): Makefile $(SLM)-htm.dbk $(HTMDBK) \
    $(ADJUSTFONTHTML) $(ANCHORHTML) $(NAVLINKHTML) $(REANCHORGRAMMARHTML)
	($(DB2HTML) $(SLM)-htm.dbk 2>&1) | grep -v 'is not a function name'
	/usr/bin/find db2html-dir -name '*.html' \
		-exec $(ADJUSTFONTHTML) {} \;
	/usr/bin/find db2html-dir -name '*.html' \
		-exec $(ANCHORHTML) {} \;
	$(REANCHORGRAMMARHTML) db2html-dir/grammar.html
	/bin/mv db2html-dir/book1.html db2html-dir/$(SLM).html
	@/bin/rm -rf $(HTMDIR).old
	@if test -r $(HTMDIR); \
	 then /bin/mv -f $(HTMDIR) $(HTMDIR).old; \
	 fi
	/bin/mv db2html-dir $(HTMDIR)

$(SLM).dbk:

$(SLM)-htm.dbk: Makefile $(SLM).dbk
	@if test -r $(SLM)-htm.dbk; \
	 then /bin/mv -f $(SLM)-htm.dbk $(SLM)-htm.dbk.old; \
	 fi
	sed 's/.dbk/-htm.dbk/g' $(SLM).dbk > $(SLM)-htm.dbk

bookinfo.dbk: Makefile $(GLM2DBK) bookinfo.glm
	@if test -r bookinfo.dbk; \
	 then /bin/mv -f bookinfo.dbk bookinfo.dbk.old; \
	 fi
	$(GLM2DBKMS) -pdf bookinfo.glm > bookinfo.dbk

disclaimer.dbk: Makefile $(GLM2DBK) disclaimer.glm
	@if test -r disclaimer.dbk; \
	 then /bin/mv -f disclaimer.dbk disclaimer.dbk.old; \
	 fi
	$(GLM2DBKMS) -pdf disclaimer.glm > disclaimer.dbk

intro.dbk: Makefile $(GLM2DBK) intro.glm
	@if test -r intro.dbk; \
	 then /bin/mv -f intro.dbk intro.dbk.old; \
	 fi
	$(GLM2DBKMS) -pdf intro.glm > intro.dbk

metaslang.dbk: Makefile $(GLM2DBK) metaslang.glm
	@if test -r metaslang.dbk; \
	 then /bin/mv -f metaslang.dbk metaslang.dbk.old; \
	 fi
	$(GLM2DBKMS) -pdf metaslang.glm > metaslang.dbk

reswords.dbk: Makefile $(GLM2DBK) reswords.glm
	@if test -r reswords.dbk; \
	 then /bin/mv -f reswords.dbk reswords.dbk.old; \
	 fi
	$(GLM2DBKGR) -pdf reswords.glm > reswords.dbk

grammar.dbk: Makefile $(GLM2DBK) grammar.glm
	@if test -r grammar.dbk; \
	 then /bin/mv -f grammar.dbk grammar.dbk.old; \
	 fi
	$(GLM2DBKGR) -pdf grammar.glm > grammar.dbk

libraries.dbk: Makefile $(GLM2DBK) libraries.glm
	@if test -r libraries.dbk; \
	 then /bin/mv -f libraries.dbk libraries.dbk.old; \
	 fi
	$(GLM2DBKMS) -pdf libraries.glm > libraries.dbk


bookinfo-htm.dbk: Makefile $(GLM2DBK) bookinfo.glm
	@if test -r bookinfo-htm.dbk; \
	 then /bin/mv -f bookinfo-htm.dbk bookinfo-htm.dbk.old; \
	 fi
	$(GLM2DBKMS) -htm bookinfo.glm > bookinfo-htm.dbk

disclaimer-htm.dbk: Makefile $(GLM2DBK) disclaimer.glm
	@if test -r disclaimer-htm.dbk; \
	 then /bin/mv -f disclaimer-htm.dbk disclaimer-htm.dbk.old; \
	 fi
	$(GLM2DBKMS) -htm disclaimer.glm > disclaimer-htm.dbk

intro-htm.dbk: Makefile $(GLM2DBK) intro.glm
	@if test -r intro-htm.dbk; \
	 then /bin/mv -f intro-htm.dbk intro-htm.dbk.old; \
	 fi
	$(GLM2DBKMS) -htm intro.glm > intro-htm.dbk

metaslang-htm.dbk: Makefile $(GLM2DBK) metaslang.glm
	@if test -r metaslang-htm.dbk; \
	 then /bin/mv -f metaslang-htm.dbk metaslang-htm.dbk.old; \
	 fi
	$(GLM2DBKMS) -htm metaslang.glm > metaslang-htm.dbk

reswords-htm.dbk: Makefile $(GLM2DBK) reswords.glm
	@if test -r reswords-htm.dbk; \
	 then /bin/mv -f reswords-htm.dbk reswords-htm.dbk.old; \
	 fi
	$(GLM2DBKGR) -pdf reswords.glm > reswords-htm.dbk

grammar-htm.dbk: Makefile $(GLM2DBK) grammar.glm
	@if test -r grammar-htm.dbk; \
	 then /bin/mv -f grammar-htm.dbk grammar-htm.dbk.old; \
	 fi
	$(GLM2DBKGR) -htm grammar.glm > grammar-htm.dbk

libraries-htm.dbk: Makefile $(GLM2DBK) libraries.glm
	@if test -r libraries-htm.dbk; \
	 then /bin/mv -f libraries-htm.dbk libraries-htm.dbk.old; \
	 fi
	$(GLM2DBKMS) -htm libraries.glm > libraries-htm.dbk

reswords.glm: Makefile reswords-list.txt $(MKRESWORDS)
	@if test -r reswords.glm; \
	 then /bin/mv -f reswords.glm reswords.glm.old; \
	 fi
	$(MKRESWORDS) reswords-list.txt > reswords.glm

grammar.glm: Makefile metaslang.glm grammar.preamble $(MKGRAMMAR)
	@if test -r grammar.glm; \
	 then /bin/mv -f grammar.glm grammar.glm.old; \
	 fi
	$(MKGRAMMAR)

clean:
	rm -rf $(PDFDBK) $(SLM).tex $(SLM).aux $(SLM).log $(SLM).out \
	       $(SLM)-htm.dbk $(HTMDBK) $(HTMDIR) *.old

pristine: clean
<commit_msg>Add targets for bin/reswords and bin/glmgrammar.  Add more things to clean target.  Remove /bin/ before some command names.<commit_after>all: pdf htm-zip

SLM= SpecwareLanguageManual
HTMDIR= $(SLM).htm-dir

pdf: $(SLM).pdf

htm: $(HTMDIR)

htm-zip: htm
	rm -f $(HTMDIR).zip
	zip -r $(HTMDIR).zip $(HTMDIR)

ARCH= i586
BIN= ../bin/$(ARCH)
GLM2DBK= $(BIN)/glm2dbk
GLM2DBKMS= $(GLM2DBK) -metaslang
GLM2DBKGR= $(GLM2DBK) -grammar
SRC= ../src
GLM2DBKSRC= $(SRC)/glm2dbk.c

$(GLM2DBK): $(GLM2DBKSRC)
	cc -O $(GLM2DBKSRC) -o $(GLM2DBK)

MKRESWORDS= bin/mkreswords
MKGRAMMAR= bin/mkgrammar

DB2PDF= ../bin/db2pdf -E9999

DB2HTML= ../bin/db2html -E9999

ADJUSTFONTHTML= bin/adjustFontHTML
ANCHORHTML= bin/anchorHTML
REANCHORGRAMMARHTML= bin/reAnchorGrammarHTML
NAVLINKHTML= bin/navLinkHTML

PDFDBK= bookinfo.dbk \
        disclaimer.dbk \
        intro.dbk \
        metaslang.dbk \
        reswords.dbk \
        grammar.dbk \
        libraries.dbk

$(SLM).pdf: Makefile $(SLM).dbk $(PDFDBK)
	@if test -r $(SLM).pdf; \
	 then mv -f $(SLM).pdf $(SLM).pdf.old; \
	 fi
	($(DB2PDF) $(SLM).dbk 2>&1) | grep -v 'is not a function name'

HTMDBK= bookinfo-htm.dbk \
        disclaimer-htm.dbk \
        intro-htm.dbk \
        metaslang-htm.dbk \
        reswords-htm.dbk \
        grammar-htm.dbk \
        libraries-htm.dbk

$(HTMDIR): Makefile $(SLM)-htm.dbk $(HTMDBK) \
    $(ADJUSTFONTHTML) $(ANCHORHTML) $(NAVLINKHTML) $(REANCHORGRAMMARHTML)
	($(DB2HTML) $(SLM)-htm.dbk 2>&1) | grep -v 'is not a function name'
	find db2html-dir -name '*.html' \
		-exec $(ADJUSTFONTHTML) {} \;
	find db2html-dir -name '*.html' \
		-exec $(ANCHORHTML) {} \;
	$(REANCHORGRAMMARHTML) db2html-dir/grammar.html
	mv db2html-dir/book1.html db2html-dir/$(SLM).html
	@/bin/rm -rf $(HTMDIR).old
	@if test -r $(HTMDIR); \
	 then mv -f $(HTMDIR) $(HTMDIR).old; \
	 fi
	mv db2html-dir $(HTMDIR)

$(SLM).dbk:

$(SLM)-htm.dbk: Makefile $(SLM).dbk
	@if test -r $(SLM)-htm.dbk; \
	 then mv -f $(SLM)-htm.dbk $(SLM)-htm.dbk.old; \
	 fi
	sed 's/.dbk/-htm.dbk/g' $(SLM).dbk > $(SLM)-htm.dbk

bookinfo.dbk: Makefile $(GLM2DBK) bookinfo.glm
	@if test -r bookinfo.dbk; \
	 then mv -f bookinfo.dbk bookinfo.dbk.old; \
	 fi
	$(GLM2DBKMS) -pdf bookinfo.glm > bookinfo.dbk

disclaimer.dbk: Makefile $(GLM2DBK) disclaimer.glm
	@if test -r disclaimer.dbk; \
	 then mv -f disclaimer.dbk disclaimer.dbk.old; \
	 fi
	$(GLM2DBKMS) -pdf disclaimer.glm > disclaimer.dbk

intro.dbk: Makefile $(GLM2DBK) intro.glm
	@if test -r intro.dbk; \
	 then mv -f intro.dbk intro.dbk.old; \
	 fi
	$(GLM2DBKMS) -pdf intro.glm > intro.dbk

metaslang.dbk: Makefile $(GLM2DBK) metaslang.glm
	@if test -r metaslang.dbk; \
	 then mv -f metaslang.dbk metaslang.dbk.old; \
	 fi
	$(GLM2DBKMS) -pdf metaslang.glm > metaslang.dbk

reswords.dbk: Makefile $(GLM2DBK) reswords.glm
	@if test -r reswords.dbk; \
	 then mv -f reswords.dbk reswords.dbk.old; \
	 fi
	$(GLM2DBKGR) -pdf reswords.glm > reswords.dbk

grammar.dbk: Makefile $(GLM2DBK) grammar.glm
	@if test -r grammar.dbk; \
	 then mv -f grammar.dbk grammar.dbk.old; \
	 fi
	$(GLM2DBKGR) -pdf grammar.glm > grammar.dbk

libraries.dbk: Makefile $(GLM2DBK) libraries.glm
	@if test -r libraries.dbk; \
	 then mv -f libraries.dbk libraries.dbk.old; \
	 fi
	$(GLM2DBKMS) -pdf libraries.glm > libraries.dbk


bookinfo-htm.dbk: Makefile $(GLM2DBK) bookinfo.glm
	@if test -r bookinfo-htm.dbk; \
	 then mv -f bookinfo-htm.dbk bookinfo-htm.dbk.old; \
	 fi
	$(GLM2DBKMS) -htm bookinfo.glm > bookinfo-htm.dbk

disclaimer-htm.dbk: Makefile $(GLM2DBK) disclaimer.glm
	@if test -r disclaimer-htm.dbk; \
	 then mv -f disclaimer-htm.dbk disclaimer-htm.dbk.old; \
	 fi
	$(GLM2DBKMS) -htm disclaimer.glm > disclaimer-htm.dbk

intro-htm.dbk: Makefile $(GLM2DBK) intro.glm
	@if test -r intro-htm.dbk; \
	 then mv -f intro-htm.dbk intro-htm.dbk.old; \
	 fi
	$(GLM2DBKMS) -htm intro.glm > intro-htm.dbk

metaslang-htm.dbk: Makefile $(GLM2DBK) metaslang.glm
	@if test -r metaslang-htm.dbk; \
	 then mv -f metaslang-htm.dbk metaslang-htm.dbk.old; \
	 fi
	$(GLM2DBKMS) -htm metaslang.glm > metaslang-htm.dbk

reswords-htm.dbk: Makefile $(GLM2DBK) reswords.glm
	@if test -r reswords-htm.dbk; \
	 then mv -f reswords-htm.dbk reswords-htm.dbk.old; \
	 fi
	$(GLM2DBKGR) -pdf reswords.glm > reswords-htm.dbk

grammar-htm.dbk: Makefile $(GLM2DBK) grammar.glm
	@if test -r grammar-htm.dbk; \
	 then mv -f grammar-htm.dbk grammar-htm.dbk.old; \
	 fi
	$(GLM2DBKGR) -htm grammar.glm > grammar-htm.dbk

libraries-htm.dbk: Makefile $(GLM2DBK) libraries.glm
	@if test -r libraries-htm.dbk; \
	 then mv -f libraries-htm.dbk libraries-htm.dbk.old; \
	 fi
	$(GLM2DBKMS) -htm libraries.glm > libraries-htm.dbk

reswords.glm: Makefile reswords-list.txt $(MKRESWORDS) bin-reswords
	@if test -r reswords.glm; \
	 then mv -f reswords.glm reswords.glm.old; \
	 fi
	$(MKRESWORDS) reswords-list.txt > reswords.glm

grammar.glm: Makefile metaslang.glm grammar.preamble $(MKGRAMMAR) bin-glmgrammar
	@if test -r grammar.glm; \
	 then mv -f grammar.glm grammar.glm.old; \
	 fi
	$(MKGRAMMAR)

bin-reswords: Makefile 
	gcc -lm src/reswords.c -o bin/reswords

bin-glmgrammar: Makefile 
	gcc -lm src/glmgrammar.c -o bin/glmgrammar

clean:
	rm -rf $(PDFDBK) $(SLM).tex $(SLM).aux $(SLM).log $(SLM).out \
	       $(SLM)-htm.dbk $(HTMDBK) $(HTMDIR) *.old grammar.glm reswords.glm bin/reswords bin/glmgrammar

pristine: clean

{'fraction_non_alphanumeric': 0.16297075129038424, 'fraction_numerical': 0.012999426495889888, 'mean_word_length': 3.114431773495871, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '103573', 'n_tokens_mistral': 5040, 'n_tokens_neox': 4716, 'n_words': 975}