19ab235126430f69f5630182f5a2f92b5e20621b
[awesomized/ext-ion] / docs / Makefile
1 PHP ?= php
2 COMPOSER ?= composer
3 TAG := $(shell (git describe --tags --match=v[0-9]* 2>/dev/null || git tag --sort=authordate | egrep ^v[0-9] | tail -n1) | 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 ln -s . ext-ion
20 $(PHP) $| ext-ion/$@ src
21 unlink ext-ion
22 touch $@
23
24 .PHONY: markdown
25 markdown: src/ion.stub.php $(SPECIAL_SRC) | vendor/bin/stub2ref
26 $(PHP) $| ion $< src
27
28 src src/ion:
29 -mkdir -p $@
30 src/ion.stub.php: ../ion.stub.php | src
31 -test -e $@ || ln $^ $@
32 src/ion.md: ../README.md | src
33 -test -e $@ || ln $^ $@
34 src/ion/\\\:\\\ Security.md: ../SECURITY.md | src/ion
35 -test -e $@ || ln $^ $@
36 src/ion/\\\:\\\ Contributing.md: ../CONTRIBUTING.md | src/ion
37 -test -e $@ || ln $^ $@
38
39 vendor/%:
40 COMPOSER= $(COMPOSER) require m6w6/mdref:dev-master
41
42 .PHONY: clean
43 clean:
44 -rm -rf latest src vendor composer.*
45
46