Debian Codegraph @

src/Makefile.am

raw
1 # SPDX-License-Identifier: LGPL-2.1-or-later
2 BUILT_SOURCES =
3 bin_PROGRAMS =
4 libexec_PROGRAMS =
5 libexec_SCRIPTS =
6 sbin_PROGRAMS =
7 PYTHON3 ?= python3
8
9 # -----------------------------------------------------------------------------
10 # Python
11
12 # Will only be honoured if pytest-timeout plugin is installed
13 export PYTEST_TIMEOUT = 120
14
15 .PHONY: pytest
16 pytest: $(BUILT_SOURCES) $(DIST_STAMP) $(MANIFESTS)
17 $(MAKE) test-server
18 cd '$(srcdir)' && abs_builddir='$(abs_builddir)' pytest
19
20 .PHONY: pytest-cov
21 pytest-cov: $(BUILT_SOURCES) $(DIST_STAMP) $(MANIFESTS)
22 $(MAKE) test-server
23 cd '$(srcdir)' && abs_builddir='$(abs_builddir)' pytest --cov
24
25 INSTALL_DATA_LOCAL_TARGETS += install-python
26 install-python:
27 @# wheel-based installation with .dist-info.
28 @# This needs to work on RHEL8 up through modern Fedora, offline, with
29 @# system packages available to the build.
30 @# See https://github.com/pypa/pip/issues/3063 for --ignore-installed
31 $(PYTHON3) -m pip install --no-index --force-reinstall --ignore-installed --root='$(DESTDIR)/' --prefix='$(prefix)' \
32 "$$($(PYTHON3) '$(srcdir)'/src/build_backend.py --wheel '$(srcdir)' tmp/wheel)"
33 mkdir -p $(DESTDIR)$(libexecdir)
34 mv -t $(DESTDIR)$(libexecdir) $(DESTDIR)$(bindir)/cockpit-askpass
35
36 UNINSTALL_LOCAL_TARGETS += uninstall-python
37 uninstall-python:
38 rm -rf tmp/wheel
39 rm -f $(DESTDIR)$(libexecdir)/cockpit-askpass
40 rm -f $(DESTDIR)$(bindir)/cockpit-bridge
41 @# HACK: pip uninstall does not know about --root and --prefix
42 rm -r $(DESTDIR)$(prefix)/lib/python*/*-packages/cockpit \
43 $(DESTDIR)$(prefix)/lib/python*/*-packages/cockpit-*.dist-info
44
45
46 # -----------------------------------------------------------------------------
47 # C
48
49 AM_CPPFLAGS = \
50 -I$(top_srcdir)/src \
51 -DDATADIR=\"$(datadir)\" \
52 -DLIBEXECDIR=\""$(libexecdir)"\" \
53 -DPACKAGE_SYSCONF_DIR=\""$(sysconfdir)"\" \
54 $(NULL)
55
56 AM_CFLAGS = \
57 -std=gnu18 \
58 -pthread \
59 -Wall \
60 -Werror=strict-prototypes \
61 -Werror=missing-prototypes \
62 -Werror=implicit-function-declaration \
63 -Werror=implicit-int \
64 -Werror=int-conversion \
65 -Werror=old-style-definition \
66 -Werror=pointer-arith \
67 -Werror=init-self \
68 -Werror=format=2 \
69 -Werror=return-type \
70 -Werror=missing-include-dirs \
71 $(NULL)
72
73 # -----------------------------------------------------------------------------
74 # AppStream metadata
75 #
76 %.metainfo.xml: %.metainfo.xml.in
77 $(AM_V_GEN) mkdir -p $(dir $@) && msgfmt --xml -d $(top_srcdir)/po --template $< --output $@
78
79 metainfodir = ${datarootdir}/metainfo
80 nodist_metainfo_DATA = \
81 src/appstream/org.cockpit_project.cockpit_sosreport.metainfo.xml \
82 src/appstream/org.cockpit_project.cockpit_kdump.metainfo.xml \
83 src/appstream/org.cockpit_project.cockpit_selinux.metainfo.xml \
84 src/appstream/org.cockpit_project.cockpit_storaged.metainfo.xml \
85 src/appstream/org.cockpit_project.cockpit_networkmanager.metainfo.xml \
86 $(NULL)
87
88 metainfo_in = $(patsubst %,%.in,$(nodist_metainfo_DATA))
89 EXTRA_DIST += $(metainfo_in)
90 CLEANFILES += $(nodist_metainfo_DATA)