aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt3
-rw-r--r--doc/Makefile23
2 files changed, 14 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3f3a1dc..ff1b295 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -314,7 +314,8 @@ if(UNITTEST)
add_test(NAME test_codec2_doc
COMMAND sh -c "cd ${CMAKE_CURRENT_SOURCE_DIR}/doc;
- CODEC2_SRC=${CMAKE_CURRENT_SOURCE_DIR} CODEC2_BINARY=${CMAKE_CURRENT_BINARY_DIR} make")
+ make clean;
+ CODEC2_SRC=${CMAKE_CURRENT_SOURCE_DIR} CODEC2_BINARY=${CMAKE_CURRENT_BINARY_DIR} JOBNAME=test make")
add_test(NAME test_freedv_get_hash
COMMAND sh -c "${CMAKE_CURRENT_BINARY_DIR}/unittest/thash")
diff --git a/doc/Makefile b/doc/Makefile
index 606d05f..0658fe1 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -5,24 +5,25 @@
# cd ~/codec2/doc
# make
-# Set these externally with an env variable (e.g. for GitHub action) to override
-# defaults below. Need to run cmake with -DDUMP
+DOCNAME ?= codec2
+
+# Set these externally to override defaults. JOBNAME sets the output file basename,
+# and avoids over writing codec2.pdf (e.g. when we are running a doc build test, but don't actually
+# want to change codec2.pdf in the repo)
CODEC2_SRC ?= $(HOME)/codec2
CODEC2_BINARY ?= $(HOME)/codec2/build_linux
+JOBNAME ?= $(DOCNAME)
PATH := $(PATH):$(CODEC2_BINARY)/src
-DOCNAME := codec2
PLOT_FILES := hts2a_37_sn.tex hts2a_37_sw.tex hts2a_37_lpc_lsp.tex hts2a_37_lpc_pf.tex
-# For automated tests we always want to build the PDF, despite codec2.pdf existing in the repo
-.PHONY: pdf
-pdf: $(PLOT_FILES) $(DOCNAME).tex $(DOCNAME)_refs.bib
- pdflatex $(DOCNAME).tex
- bibtex $(DOCNAME).aux
- pdflatex $(DOCNAME).tex
- pdflatex $(DOCNAME).tex
+$(DOCNAME).pdf: $(PLOT_FILES) $(DOCNAME).tex $(DOCNAME)_refs.bib
+ pdflatex -jobname=$(JOBNAME) $(DOCNAME).tex
+ bibtex $(JOBNAME).aux
+ pdflatex -jobname=$(JOBNAME) $(DOCNAME).tex
+ pdflatex -jobname=$(JOBNAME) $(DOCNAME).tex
$(PLOT_FILES):
echo $(PATH)
@@ -31,4 +32,4 @@ $(PLOT_FILES):
.PHONY: clean
clean:
- rm -f *.blg *.bbl *.aux *.log *.out $(DOCNAME).pdf hts2a* \ No newline at end of file
+ rm -f *.blg *.bbl *.aux *.log *.out hts2a* \ No newline at end of file