f441876af780c1e866d570262273e42054d5c9c6
[awesomized/ext-ion] / docs / Makefile
1 PHP ?= php
2 COMPOSER ?= composer
3 TAG := $(shell (git describe --tags --exact-match --match=v[1-9]* 2>/dev/null || echo v0.0) | cut -d. -f-2)
4
5 # ---
6
7 SPECIAL_SRC := src/ion/\\\:\\\ Security.md src/ion/\\\:\\\ Contributing.md src/ion.md
8
9 .PHONY: all
10 all: latest
11
12 latest: $(TAG)
13 -unlink $@ 2>/dev/null
14 ln -s "$(TAG)/" $@
15 touch $@
16
17 $(TAG): markdown | vendor/bin/ref2html
18 mkdir -p $@
19 $(PHP) $| $@ src
20 touch $@
21
22 .PHONY: markdown
23 markdown: src/ion.stub.php $(SPECIAL_SRC) | vendor/bin/stub2ref
24 $(PHP) $| ion $< src
25
26 src src/ion:
27 -mkdir -p $@
28 src/ion.stub.php: ../ion.stub.php | src
29 -test -e $@ || ln $^ $@
30 src/ion.md: ../README.md | src
31 -test -e $@ || ln $^ $@
32 src/ion/\\\:\\\ Security.md: ../SECURITY.md | src/ion
33 -test -e $@ || ln $^ $@
34 src/ion/\\\:\\\ Contributing.md: ../CONTRIBUTING.md | src/ion
35 -test -e $@ || ln $^ $@
36
37 vendor/%:
38 COMPOSER= $(COMPOSER) require m6w6/mdref:dev-master
39
40 .PHONY: clean
41 clean:
42 -rm -rf latest src vendor composer.*
43
44