-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile.in
155 lines (119 loc) · 4.69 KB
/
Makefile.in
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#############################################################################
# Don't touch these...
#############################################################################
this_makefile := ${lastword ${MAKEFILE_LIST}}
SHELL = @bash@ -o pipefail -o errexit -o nounset
.SECONDARY:
#############################################################################
# autoconf/configure standard things
srcdir = @srcdir@
builddir = @builddir@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
# PROGRAMS
# autoconf names
MKDIR_P = @MKDIR_P@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
SED = @SED@
#############################################################################
# local things from autoconf
# other names
base64 = @base64@
fgrep = @fgrep@
find = @find@
identify = @identify@
m4 = @m4@
process_doc = @process_doc@
xmllint = @xmllint@
xs_validate = @xs_validate@
#############################################################################
# below: derived things
tmp_dir = ${builddir}/tmp
tokens_dir = ${tmp_dir}/tokens
publish_dir = ${srcdir}/publish
macros_file = ${srcdir}/src/macros.m4
doc_name = niem-iepd-spec
iepd_catalog_schema_files_src_raw = ${shell ${find} ${srcdir}/src/iepd-catalog-schema -type f}
iepd_catalog_schema_files_src = ${iepd_catalog_schema_files_src_raw:%.m4=%}
iepd_catalog_schema_files = ${iepd_catalog_schema_files_src:${srcdir}/src/%=${publish_dir}/%}
all_files = \
${publish_dir}/${doc_name}.html \
${publish_dir}/${doc_name}.txt \
${iepd_catalog_schema_files}
#HELP:Build for @PACKAGE_NAME@ (@PACKAGE_TARNAME@)
#HELP:Default target is "all".
.DEFAULT_GOAL = all
#############################################################################
# valid
valid_tokens = \
${tokens_dir}/iepd-catalog-xs-valid/src/xsd/sample.5/iepd-catalog.xml
#############################################################################
# begin dependency inclusion
depend_mk = ${tmp_dir}/dependencies.mk
build_dependencies=false
ifeq (${build_dependencies},true) # it's OK to build dependencies
${depend_mk}: ${tmp_dir}/${doc_name}.xml
${MKDIR_P} ${dir $@}
${process_doc} ${process_doc_flags} --format=makedepend --in=$< --out=$@
endif
ifeq (${wildcard ${depend_mk}},${depend_mk}) # use existing dependencies
include ${depend_mk}
else
${warning No dependencies present. 'make depend' to build dependencies}
endif
# end dependency inclusion
#############################################################################
.PHONY: all # Build all products
all: ${all_files}
${publish_dir}/${doc_name}.html: ${tmp_dir}/${doc_name}.xml ${doc_html_required_files}
@ ${MKDIR_P} ${dir $@}
${process_doc} ${process_doc_flags} --in=$< --out=$@
${publish_dir}/${doc_name}.txt: ${tmp_dir}/${doc_name}.xml ${doc_text_required_files}
@ ${MKDIR_P} ${dir $@}
${process_doc} ${process_doc_flags} --format=text --in=$< --out=$@
${publish_dir}/%: ${srcdir}/src/%.m4 ${macros_file}
@ ${MKDIR_P} ${dir $@}
${m4} -P ${macros_file} $< > $@
${publish_dir}/%: ${srcdir}/src/%
@ ${MKDIR_P} ${dir $@}
${INSTALL_DATA} $< $@
${tmp_dir}/${doc_name}.xml: ${srcdir}/src/${doc_name}.xml.m4 ${macros_file}
@ ${MKDIR_P} ${dir $@}
${m4} -P ${macros_file} $< > $@
if ${fgrep} -n MACRO_ $@ /dev/null | ${SED} -e 's/^/ERROR: Unresolved macro: /'; then ${RM} $@; exit 1; fi
if ! ${xmllint} --noout $@; then ${RM} $@; exit 1; fi
${tmp_dir}/%: ${tmp_dir}/%.m4 ${macros_file}
@ ${MKDIR_P} ${dir $@}
${m4} -P ${macros_file} $< > $@
if ${fgrep} -n MACRO_ $@ /dev/null | ${SED} -e 's/^/ERROR: Unresolved macro: /'; then ${RM} $@; exit 1; fi
${tmp_dir}/%: ${srcdir}/src/%
@ ${MKDIR_P} ${dir $@}
${INSTALL_DATA} $< $@
#############################################################################
# stuff from images
# widths
${tmp_dir}/img/%.png.width.txt: ${tmp_dir}/img/%.png
${identify} -format '%w\n' $< > $@
#############################################################################
# depend
.PHONY: depend # Rebuild dependencies
depend:
${RM} ${depend_mk}
${MAKE} ${depend_mk} build_dependencies=true
#############################################################################
# valid
# Make sure that validation checks don't build or install anything
.PHONY: valid # validate test instances against schemas
valid: ${valid_tokens}
${tokens_dir}/iepd-catalog-xs-valid/%: ${srcdir}/%
${MKDIR_P} ${dir $@}
${xs_validate} --catalog=${publish_dir}/iepd-catalog-schema/xml-catalog.xml
#############################################################################
# convenience targets
.PHONY: clean # Remove build products
clean:
${RM} -r ${tmp_dir}
.PHONY: help # Print this help
help:
@ ${SED} -e '/^\.PHONY:/s/^\.PHONY: *\([^ #]*\) *\#\( *\)\([^ ].*\)/\2\1: \3/p;/^[^#]*#HELP:/s/[^#]*#HELP:\(.*\)/\1/p;d' ${this_makefile}