chiark / gitweb /
udev: fix a few issues detected by the llvm static analyzer
[elogind.git] / Makefile.am
index edf92e3fff9a3969872596326a3ec292820c48ad..34e3982de4e522db86f2a5234d26a7da69771bcc 100644 (file)
@@ -83,7 +83,6 @@ BUILT_SOURCES =
 INSTALL_EXEC_HOOKS =
 UNINSTALL_EXEC_HOOKS =
 INSTALL_DATA_HOOKS =
-DISTCHECK_HOOKS =
 DISTCLEAN_LOCAL_HOOKS =
 pkginclude_HEADERS =
 noinst_LTLIBRARIES =
@@ -98,6 +97,8 @@ dist_pkgsysconf_DATA =
 dist_dbuspolicy_DATA =
 dbusinterface_DATA =
 dist_dbussystemservice_DATA =
+check_PROGRAMS =
+TESTS =
 
 AM_CPPFLAGS = \
        -include $(top_builddir)/config.h \
@@ -210,7 +211,7 @@ bin_PROGRAMS = \
        systemd-detect-virt
 
 dist_bin_SCRIPTS = \
-       src/systemd-analyze
+       src/analyze/systemd-analyze
 
 rootlibexec_PROGRAMS = \
        systemd \
@@ -230,21 +231,8 @@ rootlibexec_PROGRAMS = \
 systemgenerator_PROGRAMS = \
        systemd-getty-generator
 
-noinst_PROGRAMS = \
-       test-engine \
-       test-job-type \
-       test-ns \
-       test-loopback \
-       test-hostname \
-       test-daemon \
-       test-cgroup \
-       test-env-replace \
-       test-strv \
-       test-install \
-       test-watchdog
-
 dist_bashcompletion_DATA = \
-       src/systemd-bash-completion.sh
+       bash-completion/systemd-bash-completion.sh
 
 dist_tmpfiles_DATA = \
        tmpfiles.d/systemd.conf \
@@ -521,12 +509,12 @@ noinst_LTLIBRARIES += \
        libsystemd-shared.la
 
 libsystemd_shared_la_SOURCES = \
-       src/linux/auto_dev-ioctl.h \
-       src/linux/fanotify.h \
+       src/shared/linux/auto_dev-ioctl.h \
+       src/shared/linux/fanotify.h \
+       src/shared/missing.h \
        src/shared/list.h \
        src/shared/macro.h \
        src/shared/def.h \
-       src/shared/missing.h \
        src/shared/util.c \
        src/shared/util.h \
        src/shared/virt.c \
@@ -564,10 +552,6 @@ libsystemd_shared_la_SOURCES = \
        src/shared/watchdog.h \
        src/shared/spawn-ask-password-agent.c \
        src/shared/spawn-ask-password-agent.h \
-       src/shared/mount-setup.c \
-       src/shared/mount-setup.h \
-       src/shared/loopback-setup.h \
-       src/shared/loopback-setup.c \
        src/shared/specifier.c \
        src/shared/specifier.h \
        src/shared/spawn-polkit-agent.c \
@@ -759,8 +743,12 @@ libsystemd_core_la_SOURCES = \
        src/core/locale-setup.c \
        src/core/hostname-setup.c \
        src/core/hostname-setup.h \
-       src/shared/machine-id-setup.c \
-       src/shared/machine-id-setup.h \
+       src/core/machine-id-setup.c \
+       src/core/machine-id-setup.h \
+       src/core/mount-setup.c \
+       src/core/mount-setup.h \
+       src/core/loopback-setup.h \
+       src/core/loopback-setup.c \
        src/core/fdset.c \
        src/core/fdset.h \
        src/core/condition.c \
@@ -796,7 +784,6 @@ libsystemd_core_la_LIBADD = \
        libsystemd-shared.la \
        libsystemd-dbus.la \
        libudev.la \
-       $(DBUS_LIBS) \
        $(LIBWRAP_LIBS) \
        $(PAM_LIBS) \
        $(AUDIT_LIBS) \
@@ -869,6 +856,24 @@ EXTRA_DIST += \
        src/core/systemd.pc.in
 
 # ------------------------------------------------------------------------------
+check_PROGRAMS += \
+       test-engine \
+       test-job-type \
+       test-ns \
+       test-loopback \
+       test-hostname \
+       test-daemon \
+       test-cgroup \
+       test-env-replace \
+       test-strv \
+       test-install \
+       test-watchdog
+
+TESTS += \
+       test-job-type \
+       test-env-replace \
+       test-strv
+
 test_engine_SOURCES = \
        src/test/test-engine.c
 
@@ -901,7 +906,8 @@ test_loopback_SOURCES = \
        src/test/test-loopback.c
 
 test_loopback_LDADD = \
-       libsystemd-shared.la
+       libsystemd-shared.la \
+       libsystemd-core.la
 
 test_hostname_SOURCES = \
        src/test/test-hostname.c
@@ -954,7 +960,7 @@ test_watchdog_LDADD = \
 
 # ------------------------------------------------------------------------------
 systemd_initctl_SOURCES = \
-       src/initctl.c
+       src/initctl/initctl.c
 
 systemd_initctl_CFLAGS = \
        $(AM_CFLAGS) \
@@ -963,12 +969,11 @@ systemd_initctl_CFLAGS = \
 systemd_initctl_LDADD = \
        libsystemd-shared.la \
        libsystemd-daemon.la \
-       libsystemd-dbus.la \
-       $(DBUS_LIBS)
+       libsystemd-dbus.la
 
 # ------------------------------------------------------------------------------
 systemd_update_utmp_SOURCES = \
-       src/update-utmp.c
+       src/update-utmp/update-utmp.c
 
 systemd_update_utmp_CFLAGS = \
        $(AM_CFLAGS) \
@@ -978,12 +983,11 @@ systemd_update_utmp_CFLAGS = \
 systemd_update_utmp_LDADD = \
        libsystemd-shared.la \
        libsystemd-dbus.la \
-       $(DBUS_LIBS) \
        $(AUDIT_LIBS)
 
 # ------------------------------------------------------------------------------
 systemd_shutdownd_SOURCES = \
-       src/shutdownd.c
+       src/shutdownd/shutdownd.c
 
 systemd_shutdownd_LDADD = \
        libsystemd-label.la \
@@ -997,7 +1001,9 @@ pkginclude_HEADERS += \
 systemd_shutdown_SOURCES = \
        src/core/umount.c \
        src/core/umount.h \
-       src/core/shutdown.c
+       src/core/shutdown.c \
+       src/core/mount-setup.c \
+       src/core/mount-setup.h
 
 systemd_shutdown_LDADD = \
        libsystemd-label.la \
@@ -1006,7 +1012,7 @@ systemd_shutdown_LDADD = \
 
 # ------------------------------------------------------------------------------
 systemd_modules_load_SOURCES = \
-       src/modules-load.c
+       src/modules-load/modules-load.c
 
 systemd_modules_load_CFLAGS = \
        $(AM_CFLAGS) \
@@ -1018,7 +1024,7 @@ systemd_modules_load_LDADD = \
 
 # ------------------------------------------------------------------------------
 systemd_tmpfiles_SOURCES = \
-       src/tmpfiles.c
+       src/tmpfiles/tmpfiles.c
 
 systemd_tmpfiles_LDADD = \
        libsystemd-label.la \
@@ -1027,8 +1033,8 @@ systemd_tmpfiles_LDADD = \
 # ------------------------------------------------------------------------------
 systemd_machine_id_setup_SOURCES = \
        src/machine-id-setup/machine-id-setup-main.c \
-       src/shared/machine-id-setup.c \
-       src/shared/machine-id-setup.h
+       src/core/machine-id-setup.c \
+       src/core/machine-id-setup.h
 
 systemd_machine_id_setup_LDADD = \
        libsystemd-label.la \
@@ -1037,14 +1043,14 @@ systemd_machine_id_setup_LDADD = \
 
 # ------------------------------------------------------------------------------
 systemd_sysctl_SOURCES = \
-       src/sysctl.c
+       src/sysctl/sysctl.c
 
 systemd_sysctl_LDADD = \
        libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
 systemd_fsck_SOURCES = \
-       src/fsck.c
+       src/fsck/fsck.c
 
 systemd_fsck_CFLAGS = \
        $(AM_CFLAGS) \
@@ -1053,19 +1059,18 @@ systemd_fsck_CFLAGS = \
 systemd_fsck_LDADD = \
        libsystemd-shared.la \
        libsystemd-dbus.la \
-       libudev.la \
-       $(DBUS_LIBS)
+       libudev.la
 
 # ------------------------------------------------------------------------------
 systemd_timestamp_SOURCES = \
-       src/timestamp.c
+       src/timestamp/timestamp.c
 
 systemd_timestamp_LDADD = \
        libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
 systemd_ac_power_SOURCES = \
-       src/ac-power.c
+       src/ac-power/ac-power.c
 
 systemd_ac_power_LDADD = \
        libsystemd-shared.la \
@@ -1073,14 +1078,14 @@ systemd_ac_power_LDADD = \
 
 # ------------------------------------------------------------------------------
 systemd_detect_virt_SOURCES = \
-       src/detect-virt.c
+       src/detect-virt/detect-virt.c
 
 systemd_detect_virt_LDADD = \
        libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
 systemd_getty_generator_SOURCES = \
-       src/getty-generator.c
+       src/getty-generator/getty-generator.c
 
 systemd_getty_generator_LDADD = \
        libsystemd-label.la \
@@ -1088,7 +1093,7 @@ systemd_getty_generator_LDADD = \
 
 # ------------------------------------------------------------------------------
 systemd_rc_local_generator_SOURCES = \
-       src/rc-local-generator.c
+       src/rc-local-generator/rc-local-generator.c
 
 systemd_rc_local_generator_LDADD = \
        libsystemd-label.la \
@@ -1096,14 +1101,16 @@ systemd_rc_local_generator_LDADD = \
 
 # ------------------------------------------------------------------------------
 systemd_remount_api_vfs_SOURCES = \
-       src/remount-api-vfs.c
+       src/remount-api-vfs/remount-api-vfs.c \
+       src/core/mount-setup.c \
+       src/core/mount-setup.h
 
 systemd_remount_api_vfs_LDADD = \
        libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
 systemd_cgroups_agent_SOURCES = \
-       src/cgroups-agent.c
+       src/cgroups-agent/cgroups-agent.c
 
 systemd_cgroups_agent_CFLAGS = \
        $(AM_CFLAGS) \
@@ -1111,12 +1118,11 @@ systemd_cgroups_agent_CFLAGS = \
 
 systemd_cgroups_agent_LDADD = \
        libsystemd-shared.la \
-       libsystemd-dbus.la \
-       $(DBUS_LIBS)
+       libsystemd-dbus.la
 
 # ------------------------------------------------------------------------------
 systemctl_SOURCES = \
-       src/systemctl.c
+       src/systemctl/systemctl.c
 
 systemctl_CFLAGS = \
        $(AM_CFLAGS) \
@@ -1130,11 +1136,10 @@ systemctl_LDADD = \
        libsystemd-id128.la \
        libsystemd-dbus.la \
        libsystemd-logs.la
-       $(DBUS_LIBS)
 
 # ------------------------------------------------------------------------------
 systemd_notify_SOURCES = \
-       src/notify.c \
+       src/notify/notify.c \
        src/readahead/sd-readahead.c
 
 systemd_notify_LDADD = \
@@ -1143,7 +1148,7 @@ systemd_notify_LDADD = \
 
 # ------------------------------------------------------------------------------
 systemd_ask_password_SOURCES = \
-       src/ask-password.c
+       src/ask-password/ask-password.c
 
 systemd_ask_password_LDADD = \
        libsystemd-label.la \
@@ -1151,28 +1156,32 @@ systemd_ask_password_LDADD = \
 
 # ------------------------------------------------------------------------------
 systemd_reply_password_SOURCES = \
-       src/reply-password.c
+       src/reply-password/reply-password.c
 
 systemd_reply_password_LDADD = \
        libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
 systemd_cgls_SOURCES = \
-       src/cgls.c
+       src/cgls/cgls.c
 
 systemd_cgls_LDADD = \
        libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
 systemd_cgtop_SOURCES = \
-       src/cgtop.c
+       src/cgtop/cgtop.c
 
 systemd_cgtop_LDADD = \
        libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
 systemd_nspawn_SOURCES = \
-       src/nspawn.c
+       src/nspawn/nspawn.c \
+       src/core/mount-setup.c \
+       src/core/mount-setup.h \
+       src/core/loopback-setup.c \
+       src/core/loopback-setup.h
 
 systemd_nspawn_LDADD = \
        libsystemd-label.la \
@@ -1189,7 +1198,7 @@ systemd_stdio_bridge_LDADD = \
 
 # ------------------------------------------------------------------------------
 systemd_tty_ask_password_agent_SOURCES = \
-       src/tty-ask-password-agent.c
+       src/tty-ask-password-agent/tty-ask-password-agent.c
 
 systemd_tty_ask_password_agent_LDADD = \
        libsystemd-label.la \
@@ -1424,7 +1433,8 @@ libudev_core_la_SOURCES = \
        src/udev/udev-builtin-input_id.c \
        src/udev/udev-builtin-kmod.c \
        src/udev/udev-builtin-path_id.c \
-       src/udev/udev-builtin-usb_id.c
+       src/udev/udev-builtin-usb_id.c \
+       src/libsystemd-daemon/sd-daemon.c
 
 libudev_core_la_CFLAGS = \
        $(AM_CFLAGS) \
@@ -1433,7 +1443,6 @@ libudev_core_la_CFLAGS = \
 
 libudev_core_la_LIBADD = \
        libudev-private.la \
-       libsystemd-daemon.la \
        libsystemd-shared.la \
        $(BLKID_LIBS) \
        $(KMOD_LIBS)
@@ -1446,10 +1455,10 @@ libudev_core_la_CPPFLAGS = \
 if HAVE_ACL
 libudev_core_la_SOURCES += \
        src/udev/udev-builtin-uaccess.c \
-       src/login/logind-acl.c
+       src/login/logind-acl.c \
+       src/login/sd-login.c
 
 libudev_core_la_LIBADD += \
-       libsystemd-login.la \
        libsystemd-acl.la
 endif
 
@@ -1474,11 +1483,11 @@ udevadm_LDADD = \
        libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
-TESTS = \
+TESTS += \
        src/udev/test/udev-test.pl \
        src/udev/test/rules-test.sh
 
-check_PROGRAMS = \
+check_PROGRAMS += \
        test-libudev \
        test-udev
 
@@ -1509,7 +1518,8 @@ DISTCLEAN_LOCAL_HOOKS += test-sys-distclean
 
 EXTRA_DIST += \
        src/udev/test/sys.tar.xz \
-       $(TESTS) \
+       src/udev/test/udev-test.pl \
+       src/udev/test/rules-test.sh \
        src/udev/test/rule-syntax-check.py
 
 # ------------------------------------------------------------------------------
@@ -1694,7 +1704,7 @@ src/udev/gudev/gudevenumtypes.c: src/udev/gudev/gudevenumtypes.c.template src/ud
        $(AM_V_GEN)glib-mkenums --template $^ > \
            $@.tmp && mv $@.tmp $@
 
-if ENABLE_INTROSPECTION
+if HAVE_INTROSPECTION
 -include $(INTROSPECTION_MAKEFILE)
 
 src/udev/gudev/GUdev-1.0.gir: libgudev-1.0.la
@@ -1738,7 +1748,7 @@ typelibs_DATA = \
        src/udev/gudev/GUdev-1.0.typelib
 
 CLEANFILES += $(gir_DATA) $(typelibs_DATA)
-endif # ENABLE_INTROSPECTION
+endif # HAVE_INTROSPECTION
 
 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
 libgudev-install-move-hook:
@@ -1786,6 +1796,9 @@ dist_udevhome_SCRIPTS = \
        src/udev/keymap/findkeyboards \
        src/udev/keymap/keyboard-force-release.sh
 
+TESTS += \
+       src/udev/keymap/check-keymaps.sh
+
 EXTRA_DIST += \
        src/udev/keymap/check-keymaps.sh
 
@@ -1875,10 +1888,6 @@ src/udev/keymap/keys-from-name.h: src/udev/keymap/keys-from-name.gperf Makefile
 
 src/udev/keymap/keys-to-name.h: src/udev/keymap/keys.txt Makefile
        $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@
-
-keymaps-distcheck-hook: src/udev/keymap/keys.txt
-       $(top_srcdir)/src/udev/keymap/check-keymaps.sh $(top_srcdir) $^
-DISTCHECK_HOOKS += keymaps-distcheck-hook
 endif
 
 # ------------------------------------------------------------------------------
@@ -1920,7 +1929,10 @@ test_id128_LDADD = \
        libsystemd-shared.la \
        libsystemd-id128.la
 
-noinst_PROGRAMS += \
+check_PROGRAMS += \
+       test-id128
+
+TESTS += \
        test-id128
 
 pkginclude_HEADERS += \
@@ -2099,7 +2111,7 @@ libsystemd-journal-uninstall-hook:
 UNINSTALL_EXEC_HOOKS += \
        libsystemd-journal-uninstall-hook
 
-noinst_PROGRAMS += \
+check_PROGRAMS += \
        test-journal \
        test-journal-send
 
@@ -2306,7 +2318,7 @@ EXTRA_DIST += \
        units/quotacheck.service.in
 
 systemd_quotacheck_SOURCES = \
-       src/quotacheck.c
+       src/quotacheck/quotacheck.c
 
 systemd_quotacheck_LDADD = \
        libsystemd-shared.la
@@ -2326,7 +2338,7 @@ EXTRA_DIST += \
        units/systemd-random-seed-load.service.in
 
 systemd_random_seed_SOURCES = \
-       src/random-seed.c
+       src/random-seed/random-seed.c
 
 systemd_random_seed_LDADD = \
        libsystemd-label.la \
@@ -2401,8 +2413,7 @@ systemd_hostnamed_CFLAGS = \
 systemd_hostnamed_LDADD = \
        libsystemd-shared.la \
        libsystemd-daemon.la \
-       libsystemd-dbus.la \
-       $(DBUS_LIBS)
+       libsystemd-dbus.la
 
 rootlibexec_PROGRAMS += \
        systemd-hostnamed
@@ -2452,8 +2463,7 @@ systemd_localed_LDADD = \
        libsystemd-label.la \
        libsystemd-shared.la \
        libsystemd-daemon.la \
-       libsystemd-dbus.la \
-       $(DBUS_LIBS)
+       libsystemd-dbus.la
 
 nodist_systemunit_DATA += \
        units/systemd-localed.service
@@ -2512,8 +2522,7 @@ systemd_timedated_CFLAGS = \
 systemd_timedated_LDADD = \
        libsystemd-shared.la \
        libsystemd-daemon.la \
-       libsystemd-dbus.la \
-       $(DBUS_LIBS)
+       libsystemd-dbus.la
 
 rootlibexec_PROGRAMS += \
        systemd-timedated
@@ -2582,8 +2591,7 @@ systemd_logind_LDADD = \
        libsystemd-audit.la \
        libsystemd-daemon.la \
        libsystemd-dbus.la \
-       libudev.la \
-       $(DBUS_LIBS)
+       libudev.la
 
 if HAVE_ACL
 systemd_logind_SOURCES += \
@@ -2614,8 +2622,7 @@ loginctl_CFLAGS = \
 loginctl_LDADD = \
        libsystemd-shared.la \
        libsystemd-dbus.la \
-       libudev.la \
-       $(DBUS_LIBS)
+       libudev.la
 
 rootbin_PROGRAMS += \
        loginctl
@@ -2627,7 +2634,7 @@ test_login_LDADD = \
        libsystemd-login.la \
        libsystemd-shared.la
 
-noinst_PROGRAMS += \
+check_PROGRAMS += \
        test-login
 
 libsystemd_login_la_SOURCES = \
@@ -2667,9 +2674,9 @@ pam_systemd_la_LDFLAGS = \
 pam_systemd_la_LIBADD = \
        libsystemd-daemon.la \
        libsystemd-audit.la \
+       libsystemd-dbus.la \
        libsystemd-shared.la \
-       $(PAM_LIBS) \
-       $(DBUS_LIBS)
+       $(PAM_LIBS)
 
 pamlib_LTLIBRARIES = \
        pam_systemd.la
@@ -3173,8 +3180,6 @@ uninstall-hook: $(UNINSTALL_EXEC_HOOKS)
 
 install-data-hook: systemd-install-data-hook $(INSTALL_DATA_HOOKS)
 
-distcheck-hook: $(DISTCHECK_HOOKS)
-
 distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
 
 DISTCHECK_CONFIGURE_FLAGS = \