Skip to content

Commit 238a612

Browse files
committed
Fix parallel build
Every documentation file expected to be able to rewrite pandoc.yml, causing conflicts when make tried building different doc files at the same time. Now each file's .yml file gets a unique name.
1 parent 3d0e8f3 commit 238a612

File tree

2 files changed

+18
-19
lines changed

2 files changed

+18
-19
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ loadp2/build-win32
1111
proploader-*-build
1212
spin2gui_dir
1313
src/rc/wish.res.o
14-
pandoc.yml

Makefile

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,10 @@ endif
106106
VPATH=.:spin2cpp/doc
107107

108108
ifdef PANDOC_EXISTS
109-
PDFFILES=spin2cpp/Flexspin.pdf spin2cpp/doc/general.pdf spin2cpp/doc/basic.pdf spin2cpp/doc/c.pdf spin2cpp/doc/spin.pdf
110-
HTMLFILES=spin2cpp/Flexspin.html spin2cpp/doc/general.html spin2cpp/doc/basic.html spin2cpp/doc/c.html spin2cpp/doc/spin.html
109+
DOCSTEMS=spin2cpp/Flexspin spin2cpp/doc/general spin2cpp/doc/basic spin2cpp/doc/c spin2cpp/doc/spin
110+
PDFFILES=$(patsubst %,%.pdf,$(DOCSTEMS))
111+
HTMLFILES=$(patsubst %,%.html,$(DOCSTEMS))
112+
YMLFILES=$(patsubst %,%.yml,$(DOCSTEMS))
111113
endif
112114

113115
#
@@ -154,7 +156,7 @@ clean:
154156
rm -rf *.exe *.zip
155157
rm -rf bin
156158
rm -rf board
157-
rm -rf $(BINFILES) $(PDFFILES) $(HTMLFILES)
159+
rm -rf $(BINFILES) $(PDFFILES) $(HTMLFILES) $(YMLFILES)
158160
rm -rf spin2cpp/build*
159161
rm -rf proploader-*-build
160162
rm -rf loadp2/build*
@@ -167,10 +169,9 @@ clean:
167169
rm -rf samples/*/*.lst samples/*/*.pasm samples/*/*.p2asm
168170
rm -rf samples/$(SUBSAMPLES)/*.binary
169171
rm -rf $(RESOBJ)
170-
rm -rf pandoc.yml
171172
rm -rf src/version.tcl
172173

173-
flexprop_base: src/version.tcl src/makepandoc.tcl $(BOARDFILES) $(PDFFILES) $(HTMLFILES)
174+
flexprop_base: $(BOARDFILES) docs
174175
mkdir -p flexprop/bin
175176
mkdir -p flexprop/doc
176177
mkdir -p flexprop/board
@@ -191,17 +192,21 @@ endif
191192

192193
.PHONY: flexprop_base
193194

194-
# rules for building PDF files
195+
# rules for building PDF and HTML documentation
195196

196-
%.pdf: %.md
197-
$(TCLSH) src/makepandoc.tcl $< > pandoc.yml
198-
-$(PANDOC) --metadata-file=pandoc.yml -s --toc -f gfm -t latex -o $@ $<
197+
docs: $(PDFFILES) $(HTMLFILES)
198+
199+
%.pdf: %.md %.yml
200+
-$(PANDOC) --metadata-file=$*.yml -s --toc -f gfm -t latex -o $@ $<
201+
202+
%.html: %.md %.yml
203+
-$(PANDOC) --metadata-file=$*.yml -s --toc -f gfm -o $@ $<
199204

200-
# rules for building PDF files
205+
%.yml: %.md src/makepandoc.tcl src/version.tcl
206+
$(TCLSH) src/makepandoc.tcl $< > $@
201207

202-
%.html: %.md
203-
$(TCLSH) src/makepandoc.tcl $< > pandoc.yml
204-
-$(PANDOC) --metadata-file=pandoc.yml -s --toc -f gfm -o $@ $<
208+
src/version.tcl: version.inp spin2cpp/version.h
209+
cpp -xc++ -DTCL_SRC < version.inp > $@
205210

206211
# rules for native binaries
207212

@@ -312,11 +317,6 @@ loadp2/build-macosx/loadp2:
312317

313318
## Other rules
314319

315-
src/version.tcl: version.inp spin2cpp/version.h
316-
cpp -xc++ -DTCL_SRC < version.inp > $@
317-
318-
docs: $(PDFFILES) $(HTMLFILES)
319-
320320
docker:
321321
docker build -t flexpropbuilder .
322322

0 commit comments

Comments
 (0)