Skip to content

Commit f656de6

Browse files
committed
Makefile: filename docs.* -> oci-runtime-spec.*
When this repo was only 'specs', then the generic name was not so bad. But now there is also the oci-image-spec, so this lines up it's unique name as well. This also variablizes the output filename so it will be easier for release specific names. Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
1 parent 3b166cd commit f656de6

1 file changed

Lines changed: 14 additions & 12 deletions

File tree

Makefile

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
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)
58
ifeq "$(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

3840
default: 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

4345
ifeq "$(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)
4648
else
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))
5456
endif
5557

@@ -111,5 +113,5 @@ endif
111113

112114
.PHONY: clean
113115
clean:
114-
rm -rf output/ *~
116+
rm -rf $(OUTPUT_DIRNAME) *~
115117

0 commit comments

Comments
 (0)