-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile.am
181 lines (156 loc) · 6.13 KB
/
Makefile.am
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# Copyright 2013 Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of Google Inc. nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PHONY_TARGETS =
doc_DATA = AUTHORS CONTRIBUTING.md CONTRIBUTORS COPYING NEWS
noinst_DATA = INSTALL.md README.md
EXTRA_DIST = $(doc_DATA) INSTALL.md README.md
BUILD_SED = \
sed -e 's,__ATF_SH__,$(ATF_SH),g' \
-e 's,__PKG_COMP_BASESYSCONFDIR__,$(sysconfdir),g' \
-e 's,__PKG_COMP_BINDIR__,$(exec_prefix)/sbin,g' \
-e 's,__PKG_COMP_DOCDIR__,$(docdir),g' \
-e 's,__PKG_COMP_ETCDIR__,$(pkg_comp_confdir),g' \
-e 's,__PKG_COMP_SHAREDIR__,$(pkgdatadir),g' \
-e 's,__PKG_COMP_SHTK_MODULESDIR__,$(pkgdatadir)/shtk,g' \
-e 's,__SANDBOXCTL__,$(SANDBOXCTL),g'
BUILD_SCRIPT = \
$(BUILD_SED) <"$(srcdir)/$${source}" | \
$(SHTK_TOOL) build -o "$${target}" -
BUILD_FILE = \
$(BUILD_SED) <"$(srcdir)/$${source}" >"$${target}.tmp"; \
mv "$${target}.tmp" "$${target}"
BUILD_OLD_TEST = \
$(BUILD_FILE); \
chmod +x "$${target}"
BUILD_TEST = \
$(BUILD_SED) <"$(srcdir)/$${source}" | \
$(SHTK_TOOL) build -m shtk_unittest_main -o "$${target}" -
sbin_SCRIPTS = pkg_comp
CLEANFILES = pkg_comp
EXTRA_DIST += pkg_comp.sh
pkg_comp: $(srcdir)/pkg_comp.sh
$(AM_V_GEN)source=pkg_comp.sh target=pkg_comp; $(BUILD_SCRIPT)
sbin_SCRIPTS += pkg_comp4cron
CLEANFILES += pkg_comp4cron
EXTRA_DIST += pkg_comp4cron.sh
pkg_comp4cron: $(srcdir)/pkg_comp4cron.sh
$(AM_V_GEN)source=pkg_comp4cron.sh target=pkg_comp4cron; $(BUILD_SCRIPT)
man_MANS = pkg_comp.8
CLEANFILES += pkg_comp.8
EXTRA_DIST += pkg_comp.8.in
pkg_comp.8: $(srcdir)/pkg_comp.8.in
$(AM_V_GEN)source=pkg_comp.8.in target=pkg_comp.8; $(BUILD_FILE)
dist_man_MANS = pkg_comp.conf.5
dist_man_MANS += pkg_comp4cron.8
dist_pkg_comp_conf_DATA = extra.mk.conf
nodist_pkg_comp_conf_DATA = default.conf
CLEANFILES += default.conf
EXTRA_DIST += default.conf.in
default.conf: $(srcdir)/default.conf.in
$(AM_V_GEN)source=default.conf.in target=default.conf; $(BUILD_FILE)
nodist_pkg_comp_conf_DATA += sandbox.conf
CLEANFILES += sandbox.conf
EXTRA_DIST += sandbox.conf.in
sandbox.conf: $(srcdir)/sandbox.conf.in
$(AM_V_GEN)source=sandbox.conf.in target=sandbox.conf; $(BUILD_FILE)
dist_pkgdata_DATA = sandbox.conf.pre sandbox.conf.post
shtk_modulesdir = $(pkgdatadir)/shtk
dist_shtk_modules_DATA = git.subr
dist_shtk_modules_DATA += pkgsrc.subr
if WITH_ATF
dist_pkgtests_DATA = Kyuafile
pkgtests_SCRIPTS = git_test
CLEANFILES += git_test
EXTRA_DIST += git_test.sh
git_test: $(srcdir)/git_test.sh
$(AM_V_GEN)source="git_test.sh" target=git_test; \
$(BUILD_TEST)
pkgtests_SCRIPTS += pkgsrc_test
CLEANFILES += pkgsrc_test
EXTRA_DIST += pkgsrc_test.sh
pkgsrc_test: $(srcdir)/pkgsrc_test.sh
$(AM_V_GEN)source="pkgsrc_test.sh" target=pkgsrc_test; \
$(BUILD_TEST)
pkgtests_SCRIPTS += pkg_comp_test
CLEANFILES += pkg_comp_test
EXTRA_DIST += pkg_comp_test.sh
pkg_comp_test: $(srcdir)/pkg_comp_test.sh
$(AM_V_GEN)source=pkg_comp_test.sh target=pkg_comp_test; \
$(BUILD_OLD_TEST)
pkgtests_SCRIPTS += pkg_comp_inttest
CLEANFILES += pkg_comp_inttest
EXTRA_DIST += pkg_comp_inttest.sh
pkg_comp_inttest: $(srcdir)/pkg_comp_inttest.sh
$(AM_V_GEN)source=pkg_comp_inttest.sh target=pkg_comp_inttest; \
$(BUILD_OLD_TEST)
pkgtests_SCRIPTS += pkg_comp4cron_test
CLEANFILES += pkg_comp4cron_test
EXTRA_DIST += pkg_comp4cron_test.sh
pkg_comp4cron_test: $(srcdir)/pkg_comp4cron_test.sh
$(AM_V_GEN)source=pkg_comp4cron_test.sh target=pkg_comp4cron_test; \
$(BUILD_TEST)
if HAVE_KYUA
CHECK_ENVIRONMENT = PATH=$(abs_top_builddir):$${PATH}
CHECK_ENVIRONMENT += PKG_COMP_ETCDIR=$(abs_top_srcdir)
CHECK_ENVIRONMENT += PKG_COMP_SHAREDIR=$(abs_top_srcdir)
CHECK_ENVIRONMENT += PKG_COMP_SHTK_MODULESDIR=$(abs_top_srcdir)
INSTALLCHECK_ENVIRONMENT = PATH=$(prefix)/sbin:$${PATH}
# Allow the caller to override the configuration file passed to our test runs
# below (or any other argument for that matter).
KYUA_FLAGS ?=
check-local: check-kyua
PHONY_TARGETS += check-kyua
check-kyua:
$(CHECK_ENVIRONMENT) $(TESTS_ENVIRONMENT) \
$(KYUA) $(KYUA_FLAGS) test \
--kyuafile="$$(cd '$(top_srcdir)' && echo "$$(pwd -P)/Kyuafile")" \
--build-root='$(top_builddir)' \
|| { cd '$(top_srcdir)'; $(KYUA) report --verbose; false; }
installcheck-local: installcheck-kyua
PHONY_TARGETS += installcheck-kyua
installcheck-kyua:
cd $(pkgtestsdir) && $(INSTALLCHECK_ENVIRONMENT) $(TESTS_ENVIRONMENT) \
$(KYUA) $(KYUA_FLAGS) test
else # HAVE_KYUA
PHONY_TARGETS += missing-kyua
missing-kyua:
@echo "WARNING: kyua not found; no tests run"
check-local: missing-kyua
installcheck-local: missing-kyua
endif # HAVE_KYUA
else # WITH_ATF
dist-hook: forbid-dist
PHONY_TARGETS += forbid-dist
forbid-dist:
@echo "Sorry; cannot make dist without atf."
@false
endif # WITH_ATF
PHONY_TARGETS += clean-all
clean-all:
GIT="$(GIT)" $(SH) $(srcdir)/admin/clean-all.sh
.PHONY: $(PHONY_TARGETS)