| 1 |
NULL = |
| 2 |
CLEANFILES = |
| 3 |
dist_noinst_DATA = |
| 4 |
man_MANS = |
| 5 |
noinst_DATA = |
| 6 |
noinst_LIBRARIES = |
| 7 |
noinst_PROGRAMS = |
| 8 |
PYTHON3 ?= python3 |
| 9 |
|
| 10 |
# See https://www.gnu.org/software/make/manual/html_node/Force-Targets.html |
| 11 |
FORCE: |
| 12 |
|
| 13 |
# ----------------------------------------------------------------------------- |
| 14 |
# node_modules/package-lock.json dependency |
| 15 |
|
| 16 |
V_NODE_MODULES = $(V_NODE_MODULES_$(V)) |
| 17 |
V_NODE_MODULES_ = $(V_NODE_MODULES_$(AM_DEFAULT_VERBOSITY)) |
| 18 |
V_NODE_MODULES_0 = @V=0 |
| 19 |
|
| 20 |
# We want tools/node-modules to run every time package-lock.json is requested |
| 21 |
$(srcdir)/package-lock.json: FORCE |
| 22 |
$(V_NODE_MODULES) $(srcdir)/tools/node-modules make_package_lock_json |
| 23 |
|
| 24 |
# ----------------------------------------------------------------------------- |
| 25 |
# make dist |
| 26 |
|
| 27 |
EXTRA_DIST = README.md LICENSES/BSD-3-Clause.txt LICENSES/GPL-3.0.txt LICENSES/LGPL-2.1.txt LICENSES/MIT.txt |
| 28 |
CLEANFILES += cockpit-*.tar.xz |
| 29 |
|
| 30 |
# We override distdir as we want to dist some git-tracked files and dist/ without explicitly listing. |
| 31 |
# The spec also gets patched to declare bundled NPM dependencies. |
| 32 |
EXTRA_DIST += $(EXTRA_FILES) |
| 33 |
distdir: $(DISTFILES) |
| 34 |
@if [ -e '$(srcdir)/.git' ]; then \ |
| 35 |
git -C '$(srcdir)' ls-files -x test/reference .fmf .cockpit-ci plans pkg test tools > .extra_dist.tmp && \ |
| 36 |
mv .extra_dist.tmp '$(srcdir)/.extra_dist'; fi |
| 37 |
$(MAKE) $(AM_MAKEFLAGS) distdir-am EXTRA_FILES="$$(tr '\n' ' ' < $(srcdir)/.extra_dist) .extra_dist" |
| 38 |
sed -i "s/[@]VERSION@/$(VERSION)/" "$(distdir)/src/client/org.cockpit_project.CockpitClient.metainfo.xml" |
| 39 |
$(srcdir)/tools/fix-spec $(distdir)/tools/cockpit.spec $(VERSION) |
| 40 |
sed -i "/^pkgver=/ s/0/$(VERSION)/" "$(distdir)/tools/arch/PKGBUILD" |
| 41 |
sed -i "1 s/0/$(VERSION)/" "$(distdir)/tools/debian/changelog" |
| 42 |
cp -r "$(srcdir)/dist" "$(srcdir)/runtime-npm-modules.txt" "$(distdir)" |
| 43 |
$(srcdir)/tools/adjust-distdir-timestamps "$(distdir)" |
| 44 |
@echo ' DIST $(DIST_ARCHIVES)' |
| 45 |
|
| 46 |
# Needed to ensure the tarball is correct for $(VERSION) override |
| 47 |
dist-hook: $(distdir)/src/cockpit/_version.py |
| 48 |
$(distdir)/src/cockpit/_version.py: FORCE |
| 49 |
$(PYTHON3) '$(srcdir)'/src/build_backend.py --copy '$(srcdir)' '$(distdir)' |
| 50 |
@rm -f $(distdir)/src/cockpit/_version.py |
| 51 |
$(AM_V_GEN) echo "__version__ = '$(VERSION)'" > $@ |
| 52 |
|
| 53 |
$(distdir)/version.m4: FORCE |
| 54 |
@rm -f $(distdir)/version.m4 |
| 55 |
$(AM_V_GEN) echo 'm4_define(VERSION_NUMBER, [$(VERSION)])' > $@ |
| 56 |
|
| 57 |
# be careful not to include autotools cache into dist tarballs |
| 58 |
dist-hook: $(distdir)/configure |
| 59 |
$(distdir)/configure: $(distdir)/version.m4 |
| 60 |
@rm -f $(distdir)/configure |
| 61 |
$(AM_V_GEN) autoreconf $(distdir) |
| 62 |
@rm -r $(distdir)/autom4te.cache |
| 63 |
|
| 64 |
# Various downstream packaging assets |
| 65 |
|
| 66 |
NODE_CACHE = $(CURDIR)/cockpit-node-$(VERSION).tar.xz |
| 67 |
|
| 68 |
$(NODE_CACHE): $(srcdir)/package-lock.json |
| 69 |
$(AM_V_GEN) $(srcdir)/tools/node-modules runtime-tar $(NODE_CACHE) |
| 70 |
|
| 71 |
dist-hook: $(distdir)/tools/debian/copyright |
| 72 |
# when building from a git checkout, we need to generate the copyright file |
| 73 |
# when building from tarball (also separate build tree, dist-git), we can't |
| 74 |
# rely on node_modules, so just copy the existing file |
| 75 |
$(distdir)/tools/debian/copyright: $(srcdir)/tools/debian/copyright.template $(DIST_STAMP) $(if $(wildcard $(srcdir)/node_modules/.package-lock.json),$(NODE_CACHE)) |
| 76 |
$(AM_V_GEN) if [ -e "$(srcdir)/node_modules/.package-lock.json" ]; then \ |
| 77 |
$(srcdir)/tools/build-debian-copyright $< $(NODE_CACHE) > $@; \ |
| 78 |
else \ |
| 79 |
cp "$(srcdir)/tools/debian/copyright" $@; \ |
| 80 |
fi |
| 81 |
|
| 82 |
DISTCHECK_CONFIGURE_FLAGS = --enable-prefix-only $(EXTRA_DISTCHECK_CONFIGURE_FLAGS) |
| 83 |
|
| 84 |
# Validate our AppStream metadata |
| 85 |
distcheck-hook:: |
| 86 |
find $(distdir) -name '*.metainfo.xml' -o -name '*.appdata.xml' | xargs appstream-util validate --nonet |
| 87 |
|
| 88 |
# validate that we don't bundle the embedded patternfly font files, we use them from /static/fonts/ |
| 89 |
distcheck-hook:: |
| 90 |
! grep --color=auto -rn "\.\./fonts/OpenSans\|fonts/.*eot\|truetype" $(distdir)/dist |
| 91 |
|
| 92 |
# ----------------------------------------------------------------------------- |
| 93 |
|
| 94 |
TESTS = \ |
| 95 |
test/common/static-code \ |
| 96 |
$(NULL) |
| 97 |
|
| 98 |
clean-local:: |
| 99 |
find $(builddir) -name '*.gc??' -delete |
| 100 |
find $(srcdir) -name '*.pyc' -delete |
| 101 |
|
| 102 |
# required for running integration tests |
| 103 |
node_modules/%: $(srcdir)/package-lock.json |
| 104 |
@true |
| 105 |
|
| 106 |
check: export VERBOSE=1 |
| 107 |
|
| 108 |
TEST_EXTENSIONS = .sh |
| 109 |
|
| 110 |
VALGRIND = valgrind --trace-children=yes --quiet --error-exitcode=33 --gen-suppressions=all \ |
| 111 |
$(foreach file,$(wildcard $(srcdir)/tools/*.supp),--suppressions=$(file)) \ |
| 112 |
--num-callers=16 --leak-check=yes --show-leak-kinds=definite \ |
| 113 |
--errors-for-leak-kinds=definite --trace-children-skip='*mock*,/bin*,/usr/bin/*,/usr/local/bin' |
| 114 |
|
| 115 |
check-memory: |
| 116 |
$(MAKE) LOG_FLAGS="$(VALGRIND)" \ |
| 117 |
COCKPIT_SKIP_SLOW_TESTS=1 \ |
| 118 |
$(AM_MAKEFLAGS) check TESTS="$(filter-out test/% bots/%,$(TESTS))" |
| 119 |
recheck-memory: |
| 120 |
$(MAKE) LOG_FLAGS="$(VALGRIND_ARGS)" \ |
| 121 |
$(AM_MAKEFLAGS) recheck |
| 122 |
|
| 123 |
# checkout Cockpit's bots for standard test VM images and API to launch them |
| 124 |
# must be from main, as only that has current and existing images; but testvm.py API is stable |
| 125 |
# support CI testing against a bots change |
| 126 |
bots: |
| 127 |
test/common/make-bots |
| 128 |
|
| 129 |
.PHONY: rsync |
| 130 |
RSYNC_HOST ?= c |
| 131 |
RSYNC_DEST ?= $(RSYNC_HOST):/ |
| 132 |
rsync: |
| 133 |
$(MAKE) |
| 134 |
$(MAKE) install DESTDIR=tmp/rsync >/dev/null |
| 135 |
rsync --recursive --links --checksum --verbose --inplace tmp/rsync/ $(RSYNC_DEST) |
| 136 |
|
| 137 |
# We use these to add conditionally-enabled extra rules |
| 138 |
# automake doesn't like mixing `::` and `if` |
| 139 |
|
| 140 |
CHECK_LOCAL_TARGETS = |
| 141 |
.PHONY: $(CHECK_LOCAL_TARGETS) |
| 142 |
check-local:: $(CHECK_LOCAL_TARGETS) |
| 143 |
|
| 144 |
CLEAN_LOCAL_TARGETS = |
| 145 |
.PHONY: $(CLEAN_LOCAL_TARGETS) |
| 146 |
clean-local:: $(CLEAN_LOCAL_TARGETS) |
| 147 |
|
| 148 |
INSTALL_DATA_LOCAL_TARGETS = |
| 149 |
.PHONY: $(INSTALL_DATA_LOCAL_TARGETS) |
| 150 |
install-data-local:: $(INSTALL_DATA_LOCAL_TARGETS) |
| 151 |
|
| 152 |
INSTALL_EXEC_HOOK_TARGETS = |
| 153 |
.PHONY: $(INSTALL_EXEC_HOOK_TARGETS) |
| 154 |
install-exec-hook:: $(INSTALL_EXEC_HOOK_TARGETS) |
| 155 |
|
| 156 |
UNINSTALL_LOCAL_TARGETS = |
| 157 |
.PHONY: $(UNINSTALL_LOCAL_TARGETS) |
| 158 |
uninstall-local:: $(UNINSTALL_LOCAL_TARGETS) |
| 159 |
|
| 160 |
|
| 161 |
# This Makefile includes several variable definitions that must come first |
| 162 |
include src/testlib/Makefile.am |
| 163 |
|
| 164 |
include containers/Makefile.am |
| 165 |
include containers/flatpak/Makefile.am |
| 166 |
include doc/Makefile-doc.am |
| 167 |
include doc/Makefile-guide.am |
| 168 |
include doc/Makefile-man.am |
| 169 |
include pkg/Makefile.am |
| 170 |
include po/Makefile.am |
| 171 |
include selinux/Makefile.am |
| 172 |
include src/Makefile.am |
| 173 |
include src/branding/arch/Makefile.am |
| 174 |
include src/branding/centos/Makefile.am |
| 175 |
include src/branding/debian/Makefile.am |
| 176 |
include src/branding/default/Makefile.am |
| 177 |
include src/branding/fedora/Makefile.am |
| 178 |
include src/branding/opensuse/Makefile.am |
| 179 |
include src/branding/rhel/Makefile.am |
| 180 |
include src/branding/ubuntu/Makefile.am |
| 181 |
include src/client/Makefile.am |
| 182 |
include src/common/Makefile-common.am |
| 183 |
include src/pam-ssh-add/Makefile.am |
| 184 |
include src/session/Makefile-session.am |
| 185 |
include src/systemd/Makefile.am |
| 186 |
include src/tls/Makefile-tls.am |
| 187 |
include src/ws/Makefile-ws.am |
| 188 |
include tools/Makefile-tools.am |