2013-11-01 09:42:29 -08:00
|
|
|
NULL =
|
2022-02-25 06:44:52 -09:00
|
|
|
CLEANFILES =
|
2022-03-09 01:12:42 -09:00
|
|
|
dist_noinst_DATA =
|
2022-03-06 22:50:12 -09:00
|
|
|
man_MANS =
|
|
|
|
|
noinst_DATA =
|
|
|
|
|
noinst_LIBRARIES =
|
2013-11-01 09:42:29 -08:00
|
|
|
noinst_PROGRAMS =
|
2025-02-03 22:44:07 -09:00
|
|
|
PYTHON3 ?= python3
|
2013-11-01 09:42:29 -08:00
|
|
|
|
2023-03-20 21:42:53 -08:00
|
|
|
# See https://www.gnu.org/software/make/manual/html_node/Force-Targets.html
|
|
|
|
|
FORCE:
|
|
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# node_modules/package-lock.json dependency
|
|
|
|
|
|
|
|
|
|
V_NODE_MODULES = $(V_NODE_MODULES_$(V))
|
|
|
|
|
V_NODE_MODULES_ = $(V_NODE_MODULES_$(AM_DEFAULT_VERBOSITY))
|
|
|
|
|
V_NODE_MODULES_0 = @V=0
|
|
|
|
|
|
|
|
|
|
# We want tools/node-modules to run every time package-lock.json is requested
|
|
|
|
|
$(srcdir)/package-lock.json: FORCE
|
|
|
|
|
$(V_NODE_MODULES) $(srcdir)/tools/node-modules make_package_lock_json
|
|
|
|
|
|
2022-03-09 02:34:18 -09:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# make dist
|
2016-07-05 07:04:57 -08:00
|
|
|
|
2026-02-01 03:40:49 -09:00
|
|
|
EXTRA_DIST = README.md LICENSES/BSD-3-Clause.txt LICENSES/GPL-3.0.txt LICENSES/LGPL-2.1.txt LICENSES/MIT.txt
|
2022-06-01 00:03:30 -08:00
|
|
|
CLEANFILES += cockpit-*.tar.xz
|
2016-01-07 11:56:05 -09:00
|
|
|
|
2023-04-03 03:28:37 -08:00
|
|
|
# We override distdir as we want to dist some git-tracked files and dist/ without explicitly listing.
|
|
|
|
|
# The spec also gets patched to declare bundled NPM dependencies.
|
build: drop tar tricks in dist-hook
We use a dist-hook combined with tar for some fairly complicated
reasons, constituting one of the most non-obvious corners of the build
system. The main reasons for that are:
1) directly adding a list of files in git to EXTRA_DIST is not
something that can be done reasonably in make syntax, and
particularly when we also need it to work when building from tar
2) (and this is complicated) we support typing `make dist` directly
after configuring the package in order to get a .tar release,
containing the files built by webpack (which will be implicitly
built as a part of `make dist`). We know what files to ship because
`webpack-make` writes a set of `Makefile.deps` files, setting the
`WEBPACK_INPUTS` and `WEBPACK_OUTPUTS` variables. At the time of
the first `make dist` invocation on the freshly-configured project,
we immediately call `make distdir-am` which is what invokes
webpack-make. However: this invocation of make doesn't get a chance
to include the Makefiles that weren't present at the time it was
invoked, and as a result, doesn't have access to the final values of
`WEBPACK_INPUTS` and `WEBPACK_OUTPUTS`. We've solved this by using
`dist-hook` (which gets a fresh recursive make invocation, and a new
chance to read the Makefiles.deps).
3) we want to make some minor adjustments to the distdir (adding a
.tarball file, adjusting timestamps, etc).
Our use of tar is pretty evil here, though, and it breaks badly when
combined with out-of-tree builds. It turns out that automake has quite
some logic for dealing with VPATH demangling, if only we can get the
files that we want to ship into `EXTRA_DIST` at the time of the `make
distdir-am` invocation.
We achieve this by using our (already existing) `distdir:` target
override to gain more control over the `make distdir-am` invocation.
The three points above are addressed, as follows:
1) If we're in a git tree, we create (or update) a .committed_files
file on `make dist` and pass its contents to be added to
`EXTRA_DIST` in the `make distdir-am` invocation. We add this file
itself to the dist, avoiding the need to use `find` in the
"non-git" case.
2) By adding `$(DISTFILES)` as a dependency of the `distdir:` target,
we can be sure our webpack (and other things in parallel) will be
built by the time we do the recursive `make distdir-am` invocation.
This specifically means that the Makfefile.deps will be available
to be included, allowing `WEBPACK_INPUTS` and `WEBPACK_OUTPUTS` to
be added to `EXTRA_DIST` in the usual way.
3) We can make our minor adjustments to the distdir directly from the
`distdir:` target, after the `make distdir-am` invocation.
In addition to working with out-of-tree builds, the new approach is, to
my eye, much easier to understand in depth.
2022-03-09 02:38:50 -09:00
|
|
|
EXTRA_DIST += $(EXTRA_FILES)
|
|
|
|
|
distdir: $(DISTFILES)
|
|
|
|
|
@if [ -e '$(srcdir)/.git' ]; then \
|
2024-03-27 05:15:43 -08:00
|
|
|
git -C '$(srcdir)' ls-files -x test/reference .fmf .cockpit-ci plans pkg test tools > .extra_dist.tmp && \
|
build: drop tar tricks in dist-hook
We use a dist-hook combined with tar for some fairly complicated
reasons, constituting one of the most non-obvious corners of the build
system. The main reasons for that are:
1) directly adding a list of files in git to EXTRA_DIST is not
something that can be done reasonably in make syntax, and
particularly when we also need it to work when building from tar
2) (and this is complicated) we support typing `make dist` directly
after configuring the package in order to get a .tar release,
containing the files built by webpack (which will be implicitly
built as a part of `make dist`). We know what files to ship because
`webpack-make` writes a set of `Makefile.deps` files, setting the
`WEBPACK_INPUTS` and `WEBPACK_OUTPUTS` variables. At the time of
the first `make dist` invocation on the freshly-configured project,
we immediately call `make distdir-am` which is what invokes
webpack-make. However: this invocation of make doesn't get a chance
to include the Makefiles that weren't present at the time it was
invoked, and as a result, doesn't have access to the final values of
`WEBPACK_INPUTS` and `WEBPACK_OUTPUTS`. We've solved this by using
`dist-hook` (which gets a fresh recursive make invocation, and a new
chance to read the Makefiles.deps).
3) we want to make some minor adjustments to the distdir (adding a
.tarball file, adjusting timestamps, etc).
Our use of tar is pretty evil here, though, and it breaks badly when
combined with out-of-tree builds. It turns out that automake has quite
some logic for dealing with VPATH demangling, if only we can get the
files that we want to ship into `EXTRA_DIST` at the time of the `make
distdir-am` invocation.
We achieve this by using our (already existing) `distdir:` target
override to gain more control over the `make distdir-am` invocation.
The three points above are addressed, as follows:
1) If we're in a git tree, we create (or update) a .committed_files
file on `make dist` and pass its contents to be added to
`EXTRA_DIST` in the `make distdir-am` invocation. We add this file
itself to the dist, avoiding the need to use `find` in the
"non-git" case.
2) By adding `$(DISTFILES)` as a dependency of the `distdir:` target,
we can be sure our webpack (and other things in parallel) will be
built by the time we do the recursive `make distdir-am` invocation.
This specifically means that the Makfefile.deps will be available
to be included, allowing `WEBPACK_INPUTS` and `WEBPACK_OUTPUTS` to
be added to `EXTRA_DIST` in the usual way.
3) We can make our minor adjustments to the distdir directly from the
`distdir:` target, after the `make distdir-am` invocation.
In addition to working with out-of-tree builds, the new approach is, to
my eye, much easier to understand in depth.
2022-03-09 02:38:50 -09:00
|
|
|
mv .extra_dist.tmp '$(srcdir)/.extra_dist'; fi
|
|
|
|
|
$(MAKE) $(AM_MAKEFLAGS) distdir-am EXTRA_FILES="$$(tr '\n' ' ' < $(srcdir)/.extra_dist) .extra_dist"
|
2022-09-23 00:32:59 -08:00
|
|
|
sed -i "s/[@]VERSION@/$(VERSION)/" "$(distdir)/src/client/org.cockpit_project.CockpitClient.metainfo.xml"
|
2023-04-03 03:28:37 -08:00
|
|
|
$(srcdir)/tools/fix-spec $(distdir)/tools/cockpit.spec $(VERSION)
|
2022-06-15 05:29:26 -08:00
|
|
|
sed -i "/^pkgver=/ s/0/$(VERSION)/" "$(distdir)/tools/arch/PKGBUILD"
|
|
|
|
|
sed -i "1 s/0/$(VERSION)/" "$(distdir)/tools/debian/changelog"
|
2025-11-18 10:42:57 -09:00
|
|
|
cp -r "$(srcdir)/dist" "$(srcdir)/runtime-npm-modules.txt" "$(distdir)"
|
2022-03-09 02:41:15 -09:00
|
|
|
$(srcdir)/tools/adjust-distdir-timestamps "$(distdir)"
|
2022-03-11 00:03:50 -09:00
|
|
|
@echo ' DIST $(DIST_ARCHIVES)'
|
2016-07-01 15:41:25 -08:00
|
|
|
|
2022-06-01 00:03:30 -08:00
|
|
|
# Needed to ensure the tarball is correct for $(VERSION) override
|
2023-04-27 09:51:45 -08:00
|
|
|
dist-hook: $(distdir)/src/cockpit/_version.py
|
|
|
|
|
$(distdir)/src/cockpit/_version.py: FORCE
|
2025-02-03 22:44:07 -09:00
|
|
|
$(PYTHON3) '$(srcdir)'/src/build_backend.py --copy '$(srcdir)' '$(distdir)'
|
2023-04-27 09:51:45 -08:00
|
|
|
@rm -f $(distdir)/src/cockpit/_version.py
|
|
|
|
|
$(AM_V_GEN) echo "__version__ = '$(VERSION)'" > $@
|
|
|
|
|
|
2022-06-01 00:03:30 -08:00
|
|
|
$(distdir)/version.m4: FORCE
|
|
|
|
|
@rm -f $(distdir)/version.m4
|
|
|
|
|
$(AM_V_GEN) echo 'm4_define(VERSION_NUMBER, [$(VERSION)])' > $@
|
|
|
|
|
|
2023-01-07 07:03:17 -09:00
|
|
|
# be careful not to include autotools cache into dist tarballs
|
2022-06-01 00:03:30 -08:00
|
|
|
dist-hook: $(distdir)/configure
|
|
|
|
|
$(distdir)/configure: $(distdir)/version.m4
|
|
|
|
|
@rm -f $(distdir)/configure
|
|
|
|
|
$(AM_V_GEN) autoreconf $(distdir)
|
2023-01-07 07:03:17 -09:00
|
|
|
@rm -r $(distdir)/autom4te.cache
|
2022-06-01 00:03:30 -08:00
|
|
|
|
2022-05-24 03:44:24 -08:00
|
|
|
# Various downstream packaging assets
|
2025-12-04 12:30:46 -09:00
|
|
|
|
2025-12-15 00:21:30 -09:00
|
|
|
NODE_CACHE = $(CURDIR)/cockpit-node-$(VERSION).tar.xz
|
2025-12-04 12:30:46 -09:00
|
|
|
|
|
|
|
|
$(NODE_CACHE): $(srcdir)/package-lock.json
|
2025-12-15 00:21:30 -09:00
|
|
|
$(AM_V_GEN) $(srcdir)/tools/node-modules runtime-tar $(NODE_CACHE)
|
2025-12-04 12:30:46 -09:00
|
|
|
|
2022-05-24 03:44:24 -08:00
|
|
|
dist-hook: $(distdir)/tools/debian/copyright
|
2025-12-04 12:51:23 -09:00
|
|
|
# when building from a git checkout, we need to generate the copyright file
|
|
|
|
|
# when building from tarball (also separate build tree, dist-git), we can't
|
|
|
|
|
# rely on node_modules, so just copy the existing file
|
|
|
|
|
$(distdir)/tools/debian/copyright: $(srcdir)/tools/debian/copyright.template $(DIST_STAMP) $(if $(wildcard $(srcdir)/node_modules/.package-lock.json),$(NODE_CACHE))
|
2026-01-27 23:33:55 -09:00
|
|
|
$(AM_V_GEN) if [ -e "$(srcdir)/node_modules/.package-lock.json" ]; then \
|
|
|
|
|
$(srcdir)/tools/build-debian-copyright $< $(NODE_CACHE) > $@; \
|
2025-12-04 12:51:23 -09:00
|
|
|
else \
|
2026-01-27 23:33:55 -09:00
|
|
|
cp "$(srcdir)/tools/debian/copyright" $@; \
|
2025-12-04 12:51:23 -09:00
|
|
|
fi
|
2022-05-24 03:44:24 -08:00
|
|
|
|
2023-08-25 23:14:27 -08:00
|
|
|
DISTCHECK_CONFIGURE_FLAGS = --enable-prefix-only $(EXTRA_DISTCHECK_CONFIGURE_FLAGS)
|
2013-11-01 09:42:29 -08:00
|
|
|
|
2022-06-21 01:25:24 -08:00
|
|
|
# Validate our AppStream metadata
|
|
|
|
|
distcheck-hook::
|
2022-06-21 01:13:33 -08:00
|
|
|
find $(distdir) -name '*.metainfo.xml' -o -name '*.appdata.xml' | xargs appstream-util validate --nonet
|
2022-03-09 02:34:18 -09:00
|
|
|
|
2023-03-21 07:31:42 -08:00
|
|
|
# validate that we don't bundle the embedded patternfly font files, we use them from /static/fonts/
|
2022-06-21 01:25:24 -08:00
|
|
|
distcheck-hook::
|
|
|
|
|
! grep --color=auto -rn "\.\./fonts/OpenSans\|fonts/.*eot\|truetype" $(distdir)/dist
|
|
|
|
|
|
2022-03-09 02:34:18 -09:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
TESTS = \
|
2024-12-05 01:57:05 -09:00
|
|
|
test/common/static-code \
|
2022-03-09 02:34:18 -09:00
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
|
|
clean-local::
|
|
|
|
|
find $(builddir) -name '*.gc??' -delete
|
|
|
|
|
find $(srcdir) -name '*.pyc' -delete
|
|
|
|
|
|
2024-08-12 11:41:47 -08:00
|
|
|
# required for running integration tests
|
2023-03-20 21:42:53 -08:00
|
|
|
node_modules/%: $(srcdir)/package-lock.json
|
|
|
|
|
@true
|
|
|
|
|
|
2022-05-04 06:08:04 -08:00
|
|
|
check: export VERBOSE=1
|
|
|
|
|
|
2024-07-03 20:29:45 -08:00
|
|
|
TEST_EXTENSIONS = .sh
|
2014-02-26 21:54:30 -09:00
|
|
|
|
2022-07-12 22:02:25 -08:00
|
|
|
VALGRIND = valgrind --trace-children=yes --quiet --error-exitcode=33 --gen-suppressions=all \
|
2022-05-04 11:49:18 -08:00
|
|
|
$(foreach file,$(wildcard $(srcdir)/tools/*.supp),--suppressions=$(file)) \
|
2014-08-01 00:49:41 -08:00
|
|
|
--num-callers=16 --leak-check=yes --show-leak-kinds=definite \
|
2017-09-25 23:27:44 -08:00
|
|
|
--errors-for-leak-kinds=definite --trace-children-skip='*mock*,/bin*,/usr/bin/*,/usr/local/bin'
|
2014-03-05 04:36:37 -09:00
|
|
|
|
2022-02-25 06:44:52 -09:00
|
|
|
check-memory:
|
2022-07-12 22:02:25 -08:00
|
|
|
$(MAKE) LOG_FLAGS="$(VALGRIND)" \
|
2019-07-10 04:05:33 -08:00
|
|
|
COCKPIT_SKIP_SLOW_TESTS=1 \
|
test: introduce a proper git pre-push hook
This is based on running tools/test-static-code, which is now renamed to
test/static-code.
It is an improvement on using test-static-code as a pre-push hook, for
the following reasons:
- it checks each commit being pushed, finding code problems introduced
in intermediate commits, even if they were fixed again after
- it only runs on changed files, which speeds things up considerably
- it uses the version of test-static-code that belongs to each commit
that is being tested, instead of the one on the branch of the main
worktree that happens to be symlinked to from the git hooks
directory. This should eliminate future issues with improving the
script and fixing code at the same time where the wrong version of
the script would be run until all branches caught up to the changes.
- it actually tests what is being pushed, rather than the contents of
the current work tree, which is often — but not always — the same as
what you're pushing.
We also move a single check out of test/static-code, because it wasn't
actually a code check, but rather a commit check. It's a much better
fit in the pre-push hook itself.
Please update your pre-push hook:
ln -sf ../../test/git-hook-pre-push .git/hooks/pre-push
2022-01-12 11:04:14 -09:00
|
|
|
$(AM_MAKEFLAGS) check TESTS="$(filter-out test/% bots/%,$(TESTS))"
|
2022-02-25 06:44:52 -09:00
|
|
|
recheck-memory:
|
2022-07-12 22:02:25 -08:00
|
|
|
$(MAKE) LOG_FLAGS="$(VALGRIND_ARGS)" \
|
2014-03-05 04:36:37 -09:00
|
|
|
$(AM_MAKEFLAGS) recheck
|
|
|
|
|
|
2019-09-23 06:45:54 -08:00
|
|
|
# checkout Cockpit's bots for standard test VM images and API to launch them
|
2021-07-04 00:41:00 -08:00
|
|
|
# must be from main, as only that has current and existing images; but testvm.py API is stable
|
2019-10-02 12:19:02 -08:00
|
|
|
# support CI testing against a bots change
|
2019-09-23 06:45:54 -08:00
|
|
|
bots:
|
2023-05-26 00:17:05 -08:00
|
|
|
test/common/make-bots
|
2019-09-23 06:45:54 -08:00
|
|
|
|
2022-02-07 03:45:39 -09:00
|
|
|
.PHONY: rsync
|
|
|
|
|
RSYNC_HOST ?= c
|
|
|
|
|
RSYNC_DEST ?= $(RSYNC_HOST):/
|
|
|
|
|
rsync:
|
|
|
|
|
$(MAKE)
|
|
|
|
|
$(MAKE) install DESTDIR=tmp/rsync >/dev/null
|
|
|
|
|
rsync --recursive --links --checksum --verbose --inplace tmp/rsync/ $(RSYNC_DEST)
|
|
|
|
|
|
2022-03-09 01:12:42 -09:00
|
|
|
# We use these to add conditionally-enabled extra rules
|
|
|
|
|
# automake doesn't like mixing `::` and `if`
|
|
|
|
|
|
|
|
|
|
CHECK_LOCAL_TARGETS =
|
|
|
|
|
.PHONY: $(CHECK_LOCAL_TARGETS)
|
|
|
|
|
check-local:: $(CHECK_LOCAL_TARGETS)
|
|
|
|
|
|
|
|
|
|
CLEAN_LOCAL_TARGETS =
|
|
|
|
|
.PHONY: $(CLEAN_LOCAL_TARGETS)
|
|
|
|
|
clean-local:: $(CLEAN_LOCAL_TARGETS)
|
|
|
|
|
|
|
|
|
|
INSTALL_DATA_LOCAL_TARGETS =
|
|
|
|
|
.PHONY: $(INSTALL_DATA_LOCAL_TARGETS)
|
|
|
|
|
install-data-local:: $(INSTALL_DATA_LOCAL_TARGETS)
|
|
|
|
|
|
2022-03-09 01:18:50 -09:00
|
|
|
INSTALL_EXEC_HOOK_TARGETS =
|
|
|
|
|
.PHONY: $(INSTALL_EXEC_HOOK_TARGETS)
|
|
|
|
|
install-exec-hook:: $(INSTALL_EXEC_HOOK_TARGETS)
|
|
|
|
|
|
2022-03-09 01:12:42 -09:00
|
|
|
UNINSTALL_LOCAL_TARGETS =
|
|
|
|
|
.PHONY: $(UNINSTALL_LOCAL_TARGETS)
|
|
|
|
|
uninstall-local:: $(UNINSTALL_LOCAL_TARGETS)
|
|
|
|
|
|
|
|
|
|
|
2022-03-06 22:50:12 -09:00
|
|
|
# This Makefile includes several variable definitions that must come first
|
|
|
|
|
include src/testlib/Makefile.am
|
|
|
|
|
|
2022-01-10 05:02:30 -09:00
|
|
|
include containers/Makefile.am
|
|
|
|
|
include containers/flatpak/Makefile.am
|
|
|
|
|
include doc/Makefile-doc.am
|
2026-02-25 10:35:01 -09:00
|
|
|
include doc/Makefile-guide.am
|
|
|
|
|
include doc/Makefile-man.am
|
2016-09-06 05:55:21 -08:00
|
|
|
include pkg/Makefile.am
|
2022-01-10 05:02:30 -09:00
|
|
|
include po/Makefile.am
|
2022-01-22 23:58:48 -09:00
|
|
|
include selinux/Makefile.am
|
2022-07-05 01:28:51 -08:00
|
|
|
include src/Makefile.am
|
2021-08-10 22:34:52 -08:00
|
|
|
include src/branding/arch/Makefile.am
|
2016-06-25 12:21:56 -08:00
|
|
|
include src/branding/centos/Makefile.am
|
2016-10-26 08:40:54 -08:00
|
|
|
include src/branding/debian/Makefile.am
|
2016-06-25 12:21:56 -08:00
|
|
|
include src/branding/default/Makefile.am
|
|
|
|
|
include src/branding/fedora/Makefile.am
|
2020-10-08 03:06:17 -08:00
|
|
|
include src/branding/opensuse/Makefile.am
|
2016-06-25 12:21:56 -08:00
|
|
|
include src/branding/rhel/Makefile.am
|
2016-11-09 05:19:53 -09:00
|
|
|
include src/branding/ubuntu/Makefile.am
|
2021-11-23 04:58:30 -09:00
|
|
|
include src/client/Makefile.am
|
2014-06-25 04:03:42 -08:00
|
|
|
include src/common/Makefile-common.am
|
2022-01-10 05:02:30 -09:00
|
|
|
include src/pam-ssh-add/Makefile.am
|
2021-07-26 20:52:01 -08:00
|
|
|
include src/session/Makefile-session.am
|
2022-01-10 00:56:47 -09:00
|
|
|
include src/systemd/Makefile.am
|
2019-04-15 02:30:56 -08:00
|
|
|
include src/tls/Makefile-tls.am
|
2022-01-10 05:02:30 -09:00
|
|
|
include src/ws/Makefile-ws.am
|
|
|
|
|
include tools/Makefile-tools.am
|