forked from webb/xml-schema-documentation-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate.mk
47 lines (31 loc) · 1.33 KB
/
generate.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# input variables: ###############################################################
# install_dir: where content gets published
# build_dir: temporary directory for creating content
# definitions_mk: dynamically generated makefile definitions listing namespaces
# and components
include ${definitions_mk}
all_files = \
${build_dir}/index.html \
${namespaces:%=${build_dir}/%/index.html} \
${components:%=${build_dir}/%/index.html}
install_files = ${all_files:${build_dir}/%=${install_dir}/%}
dirs = ${components:%=${build_dir}/%/dir-token.txt}
#############################################################################
.PHONY: dirs
dirs: ${dirs}
%/dir-token.txt:
@ mkdir -p ${dir $@}
@ touch $@
#############################################################################
.PHONY: diagrams
diagrams: ${components:%=${build_dir}/%/diagram.png.base64} ${components:%=${build_dir}/%/diagram.map}
${build_dir}/%/diagram.png.base64: ${build_dir}/%/diagram.png
base64 --wrap=0 $< > $@
${build_dir}/%/diagram.png ${build_dir}/%/diagram.map: ${build_dir}/%/diagram.dot
dot -Tpng -o${build_dir}/$*/diagram.png -Tcmapx -o${build_dir}/$*/diagram.map $<
#############################################################################
.PHONY: install
install: ${install_files}
${install_dir}/%: ${build_dir}/%
mkdir -p ${dir $@}
cp $< $@