chiark / gitweb /
seccomp: add helper call to add all secondary archs to a seccomp filter
[elogind.git] / Makefile.am
index 0b891a771a0d84cddf767a15cd843e1003adef14..1a7f9fb5b050cadb02fa3bc24077c8c12c4d5d37 100644 (file)
@@ -145,6 +145,10 @@ TESTS =
 endif
 udevlibexec_PROGRAMS =
 
+.PHONY: $(INSTALL_EXEC_HOOKS) $(UNINSTALL_EXEC_HOOKS) \
+       $(INSTALL_DATA_HOOKS) $(UNINSTALL_DATA_HOOKS) \
+       $(DISTCLEAN_LOCAL_HOOKS) $(CLEAN_LOCAL_HOOKS)
+
 AM_CPPFLAGS = \
        -include $(top_builddir)/config.h \
        -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\" \
@@ -558,7 +562,7 @@ MANPAGES_ALIAS =
 
 include Makefile-man.am
 
-.PHONY: man
+.PHONY: man update-man-list
 man: $(MANPAGES) $(MANPAGES_ALIAS) $(HTML_FILES) $(HTML_ALIAS)
 
 XML_FILES = \
@@ -606,16 +610,16 @@ XML_GLOB = $(wildcard $(top_srcdir)/man/*.xml $(top_builddir)/man/*.xml)
 NON_INDEX_XML_FILES = $(filter-out man/systemd.index.xml,$(XML_FILES))
 SOURCE_XML_FILES = $(filter-out man/systemd.directives.xml,$(NON_INDEX_XML_FILES))
 
-update-man-list: make-man-rules.py $(XML_GLOB)
+update-man-list: $(top_srcdir)/tools/make-man-rules.py $(XML_GLOB)
        $(AM_V_GEN)$(PYTHON) $^ > $(top_srcdir)/Makefile-man.tmp
        $(AM_V_at)mv $(top_srcdir)/Makefile-man.tmp $(top_srcdir)/Makefile-man.am
        @echo "Makefile-man.am has been regenerated"
 
-man/systemd.index.xml: make-man-index.py $(NON_INDEX_XML_FILES)
+man/systemd.index.xml: $(top_srcdir)/tools/make-man-index.py $(NON_INDEX_XML_FILES)
        $(AM_V_at)$(MKDIR_P) $(dir $@)
        $(AM_V_GEN)$(PYTHON) $< $@ $(filter-out $<,$^)
 
-man/systemd.directives.xml: make-directive-index.py $(SOURCE_XML_FILES)
+man/systemd.directives.xml: $(top_srcdir)/tools/make-directive-index.py $(SOURCE_XML_FILES)
        $(AM_V_at)$(MKDIR_P) $(dir $@)
        $(AM_V_GEN)$(PYTHON) $< $@ $(filter-out $<,$^)
 
@@ -637,9 +641,11 @@ EXTRA_DIST += \
        $(HTML_FILES) \
        $(HTML_ALIAS) \
        $(man_MANS) \
-       make-man-index.py \
-       make-directive-index.py \
-       xml_helper.py
+       tools/make-man-index.py \
+       tools/make-directive-index.py \
+       tools/make-man-rules.py \
+       tools/xml_helper.py \
+       man/less-variables.xml
 
 # ------------------------------------------------------------------------------
 noinst_LTLIBRARIES += \
@@ -648,8 +654,6 @@ noinst_LTLIBRARIES += \
 libsystemd_shared_la_SOURCES = \
        src/shared/linux/auto_dev-ioctl.h \
        src/shared/linux/fanotify.h \
-       src/shared/linux/seccomp.h \
-       src/shared/linux/seccomp-bpf.h \
        src/shared/ioprio.h \
        src/shared/missing.h \
        src/shared/initreq.h \
@@ -757,8 +761,6 @@ libsystemd_shared_la_SOURCES = \
        src/shared/net-util.h \
        src/shared/errno-list.c \
        src/shared/errno-list.h \
-       src/shared/syscall-list.c \
-       src/shared/syscall-list.h \
        src/shared/audit.c \
        src/shared/audit.h \
        src/shared/xml.c \
@@ -766,9 +768,7 @@ libsystemd_shared_la_SOURCES = \
 
 nodist_libsystemd_shared_la_SOURCES = \
        src/shared/errno-from-name.h \
-       src/shared/errno-to-name.h \
-       src/shared/syscall-from-name.h \
-       src/shared/syscall-to-name.h
+       src/shared/errno-to-name.h
 
 # ------------------------------------------------------------------------------
 noinst_LTLIBRARIES += \
@@ -809,6 +809,26 @@ libsystemd_label_la_CFLAGS = \
 libsystemd_label_la_LIBADD = \
        $(SELINUX_LIBS)
 
+# ------------------------------------------------------------------------------
+
+if HAVE_SECCOMP
+
+noinst_LTLIBRARIES += \
+       libsystemd-seccomp.la
+
+libsystemd_seccomp_la_SOURCES = \
+       src/shared/seccomp-util.h \
+       src/shared/seccomp-util.c
+
+libsystemd_seccomp_la_CFLAGS = \
+       $(AM_CFLAGS) \
+       $(SECCOMP_CFLAGS)
+
+libsystemd_seccomp_la_LIBADD = \
+       $(SECCOMP_LIBS)
+
+endif
+
 # ------------------------------------------------------------------------------
 noinst_LTLIBRARIES += \
        libsystemd-logs.la
@@ -992,7 +1012,9 @@ libsystemd_core_la_CFLAGS = \
        $(LIBWRAP_CFLAGS) \
        $(PAM_CFLAGS) \
        $(AUDIT_CFLAGS) \
+       $(CAP_CFLAGS) \
        $(KMOD_CFLAGS) \
+       $(SECCOMP_CFLAGS) \
        -pthread
 
 libsystemd_core_la_LIBADD = \
@@ -1007,7 +1029,13 @@ libsystemd_core_la_LIBADD = \
        $(PAM_LIBS) \
        $(AUDIT_LIBS) \
        $(CAP_LIBS) \
-       $(KMOD_LIBS)
+       $(KMOD_LIBS) \
+       $(SECCOMP_LIBS)
+
+if HAVE_SECCOMP
+libsystemd_core_la_LIBADD += \
+       libsystemd-seccomp.la
+endif
 
 src/core/load-fragment-gperf-nulstr.c: src/core/load-fragment-gperf.gperf
        $(AM_V_at)$(MKDIR_P) $(dir $@)
@@ -1020,33 +1048,13 @@ CLEANFILES += \
        src/core/load-fragment-gperf.gperf \
        src/core/load-fragment-gperf.c \
        src/core/load-fragment-gperf-nulstr.c \
-       src/shared/syscall-list.txt \
-       src/shared/syscall-from-name.gperf \
        src/shared/errno-list.txt \
        src/shared/errno-from-name.gperf
 
 BUILT_SOURCES += \
-       src/shared/syscall-from-name.h \
-       src/shared/syscall-to-name.h \
        src/shared/errno-from-name.h \
        src/shared/errno-to-name.h
 
-src/shared/syscall-list.txt:
-       $(AM_V_at)$(MKDIR_P) $(dir $@)
-       $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include sys/syscall.h - < /dev/null | $(AWK) '/^#define[ \t]+__NR_[^ ]+[ \t]+[0-9(]/ { sub(/__NR_/, "", $$2); if ($$2 !~ /SYSCALL_BASE/) print $$2; }' > $@
-
-src/shared/syscall-from-name.gperf: src/shared/syscall-list.txt
-       $(AM_V_at)$(MKDIR_P) $(dir $@)
-       $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct syscall_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, __NR_%s\n", $$1, $$1 }' < $< > $@
-
-src/shared/syscall-from-name.h: src/shared/syscall-from-name.gperf
-       $(AM_V_at)$(MKDIR_P) $(dir $@)
-       $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_syscall -H hash_syscall_name -p -C < $< > $@
-
-src/shared/syscall-to-name.h: src/shared/syscall-list.txt
-       $(AM_V_at)$(MKDIR_P) $(dir $@)
-       $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const syscall_names[] = { "} { printf "[SYSCALL_TO_INDEX(__NR_%s)] = \"%s\",\n", $$1, $$1 } END{print "};"}' < $< > $@
-
 src/shared/errno-list.txt:
        $(AM_V_at)$(MKDIR_P) $(dir $@)
        $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include errno.h - < /dev/null | $(AWK) '/^#define[ \t]+E[^ _]+[ \t]+[0-9]/ { print $$2; }'  > $@
@@ -1122,6 +1130,7 @@ tests += \
        test-utf8 \
        test-ellipsize \
        test-util \
+       test-tmpfiles \
        test-namespace \
        test-date \
        test-sleep \
@@ -1228,6 +1237,12 @@ test_util_SOURCES = \
 test_util_LDADD = \
        libsystemd-core.la
 
+test_tmpfiles_SOURCES = \
+       src/test/test-tmpfiles.c
+
+test_tmpfiles_LDADD = \
+       libsystemd-shared.la
+
 test_namespace_SOURCES = \
        src/test/test-namespace.c
 
@@ -1415,7 +1430,7 @@ test_sched_prio_LDADD = \
 
 # ------------------------------------------------------------------------------
 ## .PHONY so it always rebuilds it
-.PHONY: coverage lcov-run lcov-report
+.PHONY: coverage lcov-run lcov-report coverage-sync
 
 # run lcov from scratch, always
 coverage:
@@ -1754,6 +1769,7 @@ systemd_dbus1_generator_LDADD = \
        libsystemd-internal.la
 
 dbus1-generator-install-hook:
+       $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(usergeneratordir)
        $(AM_V_LN)$(LN_S) -f $(systemgeneratordir)/systemd-dbus1-generator $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
 
 dbus1-generator-uninstall-hook:
@@ -1849,12 +1865,19 @@ systemd_nspawn_SOURCES = \
        src/core/loopback-setup.c \
        src/core/loopback-setup.h
 
+systemd_nspawn_CFLAGS = \
+       $(AM_CFLAGS) \
+       $(SECCOMP_CFLAGS)
+
 systemd_nspawn_LDADD = \
        libsystemd-label.la \
        libsystemd-capability.la \
        libsystemd-internal.la \
        libsystemd-daemon-internal.la \
-       libsystemd-shared.la
+       libudev-internal.la \
+       libsystemd-shared.la \
+       libsystemd-seccomp.la \
+       $(SECCOMP_LIBS)
 
 # ------------------------------------------------------------------------------
 systemd_run_SOURCES = \
@@ -1877,6 +1900,7 @@ systemd_bus_proxyd_LDADD = \
        libsystemd-shared.la
 
 bus-proxyd-install-hook:
+       $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(bindir)
        $(AM_V_LN)$(LN_S) -f ../lib/systemd/systemd-bus-proxyd $(DESTDIR)$(bindir)/systemd-stdio-bridge
 
 bus-proxyd-uninstall-hook:
@@ -2028,12 +2052,12 @@ nodist_libsystemd_la_SOURCES = \
 
 libsystemd_la_LIBADD = \
        libsystemd-daemon-internal.la \
-       libsystemd-shared.la
+       libsystemd-shared.la \
+       -lresolv
 
 libsystemd_la_CFLAGS = \
        $(AM_CFLAGS) \
-       -pthread \
-       -lresolv
+       -pthread
 
 libsystemd_la_LDFLAGS = \
        $(AM_LDFLAGS) \
@@ -2305,7 +2329,8 @@ test_resolve_SOURCES = \
 
 test_resolve_LDADD = \
        libsystemd-internal.la \
-       libsystemd-shared.la
+       libsystemd-shared.la \
+       -lresolv
 
 test_resolve_CFLAGS = \
        $(AM_CFLAGS) \
@@ -2333,8 +2358,11 @@ noinst_LTLIBRARIES += \
 libsystemd_dhcp_la_SOURCES = \
        src/systemd/sd-dhcp-client.h \
        src/libsystemd-dhcp/sd-dhcp-client.c \
+       src/libsystemd-dhcp/dhcp-lease.h \
+       src/libsystemd-dhcp/dhcp-lease.c \
        src/libsystemd-dhcp/dhcp-network.c \
        src/libsystemd-dhcp/dhcp-option.c \
+       src/libsystemd-dhcp/dhcp-packet.c \
        src/libsystemd-dhcp/dhcp-internal.h \
        src/libsystemd-dhcp/dhcp-protocol.h
 
@@ -3797,7 +3825,7 @@ dist_noinst_SCRIPT = \
        src/locale/generate-kbd-model-map
 
 update-kbd-model-map: src/locale/generate-kbd-model-map
-       $PYTHON $< > src/locale/kbd-model-map
+       $PYTHON $< >src/locale/kbd-model-map
 
 localectl_SOURCES = \
        src/locale/localectl.c
@@ -3818,6 +3846,8 @@ dist_zshcompletion_DATA += \
 
 endif
 
+.PHONY: update-kbd-model-map
+
 polkitpolicy_in_files += \
        src/locale/org.freedesktop.locale1.policy.in
 
@@ -3945,6 +3975,9 @@ machinectl_LDADD = \
 rootbin_PROGRAMS += \
        machinectl
 
+dist_bashcompletion_DATA += \
+       shell-completion/bash/machinectl
+
 test_machine_tables_SOURCES = \
        src/machine/test-machine-tables.c
 
@@ -4427,6 +4460,8 @@ endif
 
 CLEAN_LOCAL_HOOKS += clean-sphinx
 
+.PHONY: python-shell destdir-sphinx clean-sphinx clean-python
+
 clean-sphinx:
        -rm -rf docs/html/python-systemd/
 
@@ -4466,9 +4501,7 @@ libsystemd_id128_la_SOURCES = \
        src/compat-libs/libsystemd-id128.sym
 
 libsystemd_id128_la_CFLAGS = \
-       $(AM_CFLAGS) \
-       -fvisibility=default \
-       -imacros $(top_srcdir)/src/compat-libs/linkwarning.h
+       $(libsystemd_login_la_CFLAGS)
 
 libsystemd_id128_la_LDFLAGS = \
        $(AM_LDFLAGS) \
@@ -4627,7 +4660,7 @@ if ENABLE_MANPAGES
 man/custom-entities.ent:
        $(AM_V_GEN)$(MKDIR_P) $(dir $@)
        $(AM_V_GEN)(echo '<?xml version="1.0" encoding="utf-8" ?>' && \
-        echo '$(subst '|,<!ENTITY ,$(subst =, ",$(subst |',">,$(substitutions))))') \
+        printf '$(subst '|,<!ENTITY ,$(subst =, ",$(subst |',">\n,$(substitutions))))') \
         > $@ # '
 
 DISTCLEANFILES += \
@@ -4635,6 +4668,7 @@ DISTCLEANFILES += \
 
 XSLTPROC_FLAGS = \
        --nonet \
+       --xinclude \
        --stringparam man.output.quietly 1 \
        --stringparam funcsynopsis.style ansi \
        --stringparam man.authors.section.enabled 0 \
@@ -4836,6 +4870,7 @@ DISTCHECK_CONFIGURE_FLAGS += \
        --enable-gtk-doc
 endif
 
+.PHONY: hwdb-update
 hwdb-update:
        ( cd $(top_srcdir)/hwdb && \
        wget -N http://www.linux-usb.org/usb.ids \
@@ -4844,16 +4879,19 @@ hwdb-update:
                http://standards.ieee.org/develop/regauth/iab/iab.txt && \
        ./ids-update.pl )
 
+.PHONY: kdbus-update
 kdbus-update:
        ( cd $(top_srcdir)/src/libsystemd/ && \
        wget -N https://d-bus.googlecode.com/git/kdbus.h )
 
+.PHONY: upload
 upload: all distcheck
        cp -v systemd-$(VERSION).tar.xz /home/lennart/git.fedora/systemd/
        scp systemd-$(VERSION).tar.xz fdo:/srv/www.freedesktop.org/www/software/systemd/
        scp man/*.html tango:public/systemd-man/
 
 www_target = www.freedesktop.org:/srv/www.freedesktop.org/www/software/systemd
+.PHONY: doc-sync
 doc-sync: all destdir-sphinx
        gtkdoc-rebase --html-dir=docs/libudev/html --online
        rsync -rlv --delete docs/libudev/html/ --omit-dir-times $(www_target)/libudev/
@@ -4862,9 +4900,11 @@ doc-sync: all destdir-sphinx
        rsync -rlv --delete-excluded --include="*.html" --exclude="*" --omit-dir-times man/ $(www_target)/man/
        rsync -rlv --delete --omit-dir-times docs/html/python-systemd/ $(www_target)/python-systemd/
 
+.PHONY: git-tag
 git-tag:
        git tag "v$(VERSION)" -m "systemd $(VERSION)"
 
+.PHONY: install-tree
 install-tree: all
        rm -rf $(abs_srcdir)/install-tree
        $(MAKE) install DESTDIR=$(abs_srcdir)/install-tree
@@ -4872,6 +4912,7 @@ install-tree: all
 
 # Let's run all tests of the test suite, but under valgrind. Let's
 # exclude the one perl script we have in there
+.PHONY: valgrind-tests
 valgrind-tests: $(TESTS)
        $(AM_V_GEN)for f in $(filter-out %.pl, $^); do \
                if file $$f | grep -q shell; then \
@@ -4887,6 +4928,7 @@ exported-%: %
 exported: $(addprefix exported-, $(lib_LTLIBRARIES))
        $(AM_V_GEN)cat $^ > $@
 
+.PHONY: check-api-docs
 check-api-docs: exported man
        $(AM_V_GEN)for symbol in `cat exported` ; do \
                if test -f $(builddir)/man/$$symbol.html ; then \
@@ -4908,9 +4950,18 @@ CLEANFILES += \
        defined \
        undefined
 
+.PHONY: check-api-unused
 check-api-unused: defined undefined exported
        ( cat exported undefined ) | sort -u  | diff -u - defined | grep ^+ | grep -v ^+++ | cut -c2-
 
+.PHONY: check-includes
+check-includes: $(top_srcdir)/tools/check-includes.pl
+       $(AM_V_GEN) find * -name '*.[hcS]' -type f -print | sort -u \
+               | xargs $(top_srcdir)/tools/check-includes.pl
+
+EXTRA_DIST += \
+       $(top_srcdir)/tools/check-includes.pl
+
 # Stupid test that everything purported to be exported really is
 
 define generate-sym-test