Repository navigation
Expand file tree
/
Copy pathMakefile.am
More file actions
214 lines (182 loc) · 7.11 KB
/
Copy pathMakefile.am
File metadata and controls
214 lines (182 loc) · 7.11 KB
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
#
# Copyright 2021 Northern.tech AS
#
# This file is part of CFEngine 3 - written and maintained by Northern.tech AS.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
#
# To the extent this program is licensed as part of the Enterprise
# versions of CFEngine, the applicable Commercial Open Source License
# (COSL) may apply to this file if you as a licensee so wish it. See
# included file COSL.txt.
#
AUTOMAKE_OPTIONS = foreign
MAKEFLAGS = $(if $(filter-out 0,$(V)),,--no-print-directory --quiet)
LCOV_FLAGS = $(if $(filter-out 0,$(V)),,-q)
SUBDIRS = \
libntech \
libcfecompat \
libcfnet \
libenv \
cf-check \
libpromises \
cf-agent \
cf-execd \
cf-key \
cf-monitord \
cf-promises \
cf-runagent \
cf-serverd \
cf-testd \
cf-upgrade \
cf-net \
cf-secret \
cf-reactor \
misc \
python \
ext \
examples \
tests \
contrib/vagrant-ci/centos-9s-x64
# Normalize tar header fields so two builds of the same source tree produce a
# byte-identical tarball, following the GNU tar reproducibility guidance:
# https://www.gnu.org/software/tar/manual/html_section/Reproducibility.html
# --format=posix stable, version-independent header encoding (configure.ac
# selects tar-pax so $(am__tar) emits posix)
# --pax-option=... keep tar's PID out of extended-header names and omit
# atime/ctime, leaving the archive in the ustar subset
# --sort=name stable member order
# --numeric-owner do not record buildslave user/group names
# --owner=0 --group=0 deterministic ownership
# --mode=go+u,go-w deterministic permissions
# mtime clamping (the manual's --clamp-mtime --mtime) is handled by the
# touch -d @$$SOURCE_DATE_EPOCH call in dist-hook below.
TAR_OPTIONS = \
--format=posix \
--pax-option=exthdr.name=%d/PaxHeaders/%f \
--pax-option=delete=atime,delete=ctime \
--sort=name \
--numeric-owner --owner=0 --group=0 \
--mode=go+u,go-w
export TAR_OPTIONS
# The same guidance says to "run GNU tar in the C locale" alongside the options
# above; its example invokes "LC_ALL=C tar ...".
LC_ALL = C
export LC_ALL
# --no-name strips the mtime from the gzip header. --best is automake's default
GZIP_ENV = "--best --no-name"
# Clamp every mtime in the source tarball to SOURCE_DATE_EPOCH, so that it
# follows the commit the tarball was made from rather than the time it was built.
dist-hook:
if [ -n "$$SOURCE_DATE_EPOCH" ]; then \
find $(distdir) -exec touch -d @$$SOURCE_DATE_EPOCH {} + ; \
fi
EXTRA_DIST = CHANGELOG.md INSTALL README.md LICENSE CFVERSION
doc_DATA = README.md CHANGELOG.md
#
# Some basic clean ups
#
MOSTLYCLEANFILES = *~
#
# Get everything removed down to where rebuilding requires:
# "configure; make; make install"
#
DISTCLEANFILES =
#
# Get everything removed down to where rebuilding requires:
# "aclocal; autoconf; autoheader; automake --add-missing"
# "configure; make; make install"
#
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.sub \
configure install-sh missing mkinstalldirs depcomp ylwrap \
ltmain.sh mdate-sh
#
# Pass proper flags to aclocal to pick up Libtool macros
#
ACLOCAL_AMFLAGS = -I m4
list:
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'
install-data-local:
$(MKDIR_P) -m 700 $(DESTDIR)$(workdir)/inputs
$(MKDIR_P) -m 755 $(DESTDIR)$(workdir)/modules
$(MKDIR_P) -m 700 $(DESTDIR)$(workdir)/outputs
$(MKDIR_P) -m 700 $(DESTDIR)$(workdir)/ppkeys
$(MKDIR_P) -m 700 $(DESTDIR)$(workdir)/plugins
$(MKDIR_P) -m 750 $(DESTDIR)$(workdir)/state
tar-package:
pkgdir=`mktemp -d` && export pkgdir && \
origdir=`pwd` && export origdir && \
$(MAKE) DESTDIR=$$pkgdir install && \
( cd $$pkgdir && \
find . -name '*.cf*' | xargs -n1 chmod go-w && \
tardir=. && \
$(am__tar) | GZIP=$(GZIP_ENV) gzip -c \
> "$$origdir"/$(PACKAGE)-$(VERSION).pkg.tar.gz \
) ; \
[ x$$pkgdir != x ] && rm -rf $$pkgdir
#
# Code coverage
#
clean-coverage:
find -L $(srcdir) -name '*.gcda' -delete
run-coverage:
-$(MAKE) check -k
collect-coverage:
mkdir -p coverage
$(LCOV) $(LCOV_FLAGS) --capture --initial --directory . --output-file coverage/cfengine-lcov-base.info
$(LCOV) $(LCOV_FLAGS) --capture --directory . --output-file coverage/lcov.info --test-name CFENGINE --no-checksum --compat-libtool
$(LCOV) $(LCOV_FLAGS) -a coverage/cfengine-lcov-base.info -a coverage/lcov.info --output-file coverage/cfengine-lcov.info
$(LCOV) $(LCOV_FLAGS) --remove coverage/lcov.info '/usr/include/*' --output-file coverage/lcov.info
LANG=C $(LCOV_GENHTML) $(LCOV_FLAGS) --prefix . --output-directory coverage-html --title "CFEngine Code Coverage" --legend --show-details coverage/lcov.info
@echo
@echo " Code coverage information: file://"`pwd`"/coverage-html/index.html"
@echo " Code coverage summary for IDEs: file://"`pwd`"/coverage/lcov.info"
@echo
coverage: clean-coverage run-coverage collect-coverage
################################################################################
# Identical to what is in libpromises/Makefile.am.
# This is because there is a circular dependency libcfnet <-> libpromises
# so we need to generate it before everything else.
################################################################################
BUILT_SOURCES = \
$(srcdir)/libpromises/enterprise_extension.c \
$(srcdir)/libpromises/enterprise_extension.h
$(srcdir)/libpromises/enterprise_extension.c: libpromises/extensions_template.c.pre libpromises/enterprise_extension.sed
$(V_SED) $(SED) -f $(srcdir)/libpromises/enterprise_extension.sed $< > $@
$(srcdir)/libpromises/enterprise_extension.h: libpromises/extensions_template.h.pre libpromises/enterprise_extension.sed
$(V_SED) $(SED) -f $(srcdir)/libpromises/enterprise_extension.sed $< > $@
V_PERL = $(cf__v_PERL_$(V))
cf__v_PERL_ = $(cf__v_PERL_$(AM_DEFAULT_VERBOSITY))
cf__v_PERL_0 = @echo " PERL " "$@";
cf__v_PERL_1 =
V_SED = $(cf__v_SED_$(V))
cf__v_SED_ = $(cf__v_SED_$(AM_DEFAULT_VERBOSITY))
cf__v_SED_0 = @echo " SED " "$@";
cf__v_SED_1 =
vm-check:
$(MAKE) -C contrib/vagrant-ci/centos-9s-x64/ vm-check
vm-check-full:
$(MAKE) -C contrib/vagrant-ci/centos-9s-x64/ vm-check-full
destroy-vms:
$(MAKE) -C contrib/vagrant-ci/centos-9s-x64/ destroy-vms
static-check:
tests/static-check/run.sh
static-check-f%:
STATIC_CHECKS_FEDORA_VERSION=$* tests/static-check/run.sh
#
# Get everything removed down to where rebuilding requires:
# "make; make install"
#
CLEANFILES = cfengine-lcov-base.info cfengine-lcov.info \
$(BUILT_SOURCES)