11
2- SHELL ?= $(shell command -v bash 2>/dev/null)
3- DOCKER ?= $(shell command -v docker 2>/dev/null)
4- PANDOC ?= $(shell command -v pandoc 2>/dev/null)
2+ EPOCH_TEST_COMMIT := 78e6667ae2d67aad100b28ee9580b41b7a24e667
3+ OUTPUT_DIRNAME ?= output/
4+ DOC_FILENAME ?= oci-runtime-spec
5+ SHELL ?= $(shell command -v bash 2>/dev/null)
6+ DOCKER ?= $(shell command -v docker 2>/dev/null)
7+ PANDOC ?= $(shell command -v pandoc 2>/dev/null)
58ifeq "$(strip $(PANDOC ) ) " ''
69 ifneq "$(strip $(DOCKER))" ''
710 PANDOC = $(DOCKER) run \
811 -it \
912 --rm \
1013 -v $(shell pwd)/:/input/:ro \
11- -v $(shell pwd)/output /:/output / \
14+ -v $(shell pwd)/$(OUTPUT_DIRNAME) /:/$(OUTPUT_DIRNAME) / \
1215 -u $(shell id -u) \
1316 vbatts/pandoc
1417 PANDOC_SRC := /input/
@@ -33,23 +36,22 @@ DOC_FILES := \
3336 config-linux.md \
3437 config-solaris.md \
3538 glossary.md
36- EPOCH_TEST_COMMIT := 78e6667ae2d67aad100b28ee9580b41b7a24e667
3739
3840default : docs
3941
4042.PHONY : docs
41- docs : output/docs .pdf output/docs .html
43+ docs : $( OUTPUT_DIRNAME ) / $( DOC_FILENAME ) .pdf $( OUTPUT_DIRNAME ) / $( DOC_FILENAME ) .html
4244
4345ifeq "$(strip $(PANDOC ) ) " ''
44- output/docs .pdf output/docs .html :
46+ $( OUTPUT_DIRNAME ) / $( DOC_FILENAME ) .pdf $( OUTPUT_DIRNAME ) / $( DOC_FILENAME ) .html :
4547 $(error cannot build $@ without either pandoc or docker)
4648else
47- output/docs .pdf : $(DOC_FILES )
48- mkdir -p output / && \
49+ $( OUTPUT_DIRNAME ) / $( DOC_FILENAME ) .pdf : $(DOC_FILES )
50+ mkdir -p $( OUTPUT_DIRNAME ) / && \
4951 $(PANDOC ) -f markdown_github -t latex -o $(PANDOC_DST ) $@ $(patsubst % ,$(PANDOC_SRC ) % ,$(DOC_FILES ) )
5052
51- output/docs .html : $(DOC_FILES )
52- mkdir -p output / && \
53+ $( OUTPUT_DIRNAME ) / $( DOC_FILENAME ) .html : $(DOC_FILES )
54+ mkdir -p $( OUTPUT_DIRNAME ) / && \
5355 $(PANDOC ) -f markdown_github -t html5 -o $(PANDOC_DST ) $@ $(patsubst % ,$(PANDOC_SRC ) % ,$(DOC_FILES ) )
5456endif
5557
@@ -111,5 +113,5 @@ endif
111113
112114.PHONY : clean
113115clean :
114- rm -rf output/ * ~
116+ rm -rf $( OUTPUT_DIRNAME ) * ~
115117
0 commit comments