Skip to content
Snippets Groups Projects
Commit e1732e04 authored by Karl Fogel's avatar Karl Fogel
Browse files

Adjust for "otsltx" -> "ots-doctools" rename

parent abd9face
No related branches found
No related tags found
No related merge requests found
# This is a document-specific Makefile. Matters that are specific to # This is a document-specific Makefile. Matters that are specific to
# this doc can be put here. More general LaTeX building targets can # this doc can be put here. More general LaTeX building targets can
# go in OTSLTXDIR/Makefile, which this one calls. # go in OTS_DOCTOOLS_DIR/Makefile, which this one calls.
# By default, we build all .ltx files in this dir # By default, we build all .ltx files in this dir
SOURCE=$(wildcard *.ltx) SOURCE=$(wildcard *.ltx)
TARGETS=$(SOURCE:.ltx=.pdf) TARGETS=$(SOURCE:.ltx=.pdf)
### Try to find otsltx directory. We look in the current dir, then ### Try to find ots-doctools directory. We look in the current dir, then
### for a $OTSLTXDIR environment variable, then $OTSDIR/forms/latex, ### for a $OTS_DOCTOOLS_DIR environment variable, then $OTSDIR/forms/latex,
### then ~/OTS/forms/latex, then /usr/local/src/otsltx ### then ~/OTS/forms/latex, then /usr/local/src/ots-doctools
# If there's a local otsltx dir, use it # If there's a local ots-doctools dir, use it
ifneq ("$(wildcard otsltx)","") ifneq ("$(wildcard ots-doctools)","")
OTSLTXDIR = otsltx OTS_DOCTOOLS_DIR = ots-doctools
else else
# Otherwise maybe one's defined in the environment # Otherwise maybe one's defined in the environment
ifndef OTSLTXDIR ifndef OTS_DOCTOOLS_DIR
ifneq ("$(wildcard $(OTSDIR)/forms/latex)","") ifneq ("$(wildcard $(OTSDIR)/forms/latex)","")
OTSLTXDIR = "$(OTSDIR)/forms/latex" OTS_DOCTOOLS_DIR = "$(OTSDIR)/forms/latex"
else else
ifneq ("$(wildcard ~/OTS/forms/latex)","") ifneq ("$(wildcard ~/OTS/forms/latex)","")
OTSLTXDIR = "~/OTS/forms/latex" OTS_DOCTOOLS_DIR = "~/OTS/forms/latex"
else else
ifneq ("$(wildcard /usr/local/src/otsltx)","") ifneq ("$(wildcard /usr/local/src/ots-doctools)","")
OTSLTXDIR = "/usr/local/src/otsltx" OTS_DOCTOOLS_DIR = "/usr/local/src/ots-doctools"
endif endif
endif endif
endif endif
...@@ -30,10 +30,10 @@ endif ...@@ -30,10 +30,10 @@ endif
endif endif
# If we didn't find the OTS Latex stuff, grab it from GitHub # If we didn't find the OTS Latex stuff, grab it from GitHub
ifndef OTSLTXDIR ifndef OTS_DOCTOOLS_DIR
#$(error Cannot find OTSLTX materials. Please install OTSLTX, set OTSLTXDIR, and/or put OTSLTX in this directory.) #$(error Cannot find ots-doctools materials. Please install ots-doctools, set OTS_DOCTOOLS_DIR, and/or put ots-doctools in this directory.)
$(shell git submodule add https://github.com/OpenTechStrategies/otsltx) $(shell git submodule add https://github.com/OpenTechStrategies/ots-doctools)
OTSLTXDIR=otsltx OTS_DOCTOOLS_DIR=ots-doctools
endif endif
all: DEPS ${TARGETS} all: DEPS ${TARGETS}
...@@ -42,25 +42,25 @@ all: DEPS ${TARGETS} ...@@ -42,25 +42,25 @@ all: DEPS ${TARGETS}
.PHONY: DEPS .PHONY: DEPS
DEPS: otsreport.cls ots.sty otslogo.pdf DEPS: otsreport.cls ots.sty otslogo.pdf
otsreport.cls: $(OTSLTXDIR)/otsreport.cls otsreport.cls: $(OTS_DOCTOOLS_DIR)/otsreport.cls
ln -s $(OTSLTXDIR)/otsreport.cls ln -s $(OTS_DOCTOOLS_DIR)/otsreport.cls
ots.sty: $(OTSLTXDIR)/ots.sty ots.sty: $(OTS_DOCTOOLS_DIR)/ots.sty
ln -s $(OTSLTXDIR)/ots.sty ln -s $(OTS_DOCTOOLS_DIR)/ots.sty
otslogo.pdf: $(OTSLTXDIR)/otslogo.pdf otslogo.pdf: $(OTS_DOCTOOLS_DIR)/otslogo.pdf
ln -s $(OTSLTXDIR)/otslogo.pdf ln -s $(OTS_DOCTOOLS_DIR)/otslogo.pdf
# Use the OTSLTX Makefile to turn .ltx into .pdf files # Use the ots-doctools Makefile to turn .ltx into .pdf files
%.pdf: %.ltx %.pdf: %.ltx
$(MAKE) -f ${OTSLTXDIR}/Makefile $@ $(MAKE) -f ${OTS_DOCTOOLS_DIR}/Makefile $@
clean: clean:
rm -f otsreport.cls ots.sty otslogo.pdf rm -f otsreport.cls ots.sty otslogo.pdf
@# Delete PDFs that we do not care enough about to check into the repo @# Delete PDFs that we do not care enough about to check into the repo
@$(foreach x,${TARGETS}, git status -s ${x} | grep -q "M ${x}" || rm -f ${x};) @$(foreach x,${TARGETS}, git status -s ${x} | grep -q "M ${x}" || rm -f ${x};)
$(MAKE) -f ${OTSLTXDIR}/Makefile clean $(MAKE) -f ${OTS_DOCTOOLS_DIR}/Makefile clean
@# Remove otsltx submodule @# Remove ots-doctools submodule
git submodule deinit -f otsltx git submodule deinit -f ots-doctools
rm -rf .git/modules/otsltx rm -rf .git/modules/ots-doctools
git rm -f otsltx git rm -f ots-doctools
...@@ -15,7 +15,7 @@ difficulty doing so. ...@@ -15,7 +15,7 @@ difficulty doing so.
If you are building a document from an OTS repository, the Makefile If you are building a document from an OTS repository, the Makefile
that came with that document should either find your installation of that came with that document should either find your installation of
otsltx or do a hyperlocal install in a subdir of that document's ots-doctools or do a hyperlocal install in a subdir of that document's
directory. The doc should build smoothly from there based on the directory. The doc should build smoothly from there based on the
doc-specific makefile in the document's repository. doc-specific makefile in the document's repository.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment