summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile74
-rw-r--r--src/busctl/Makefile2
-rw-r--r--src/grp-boot/bootctl/Makefile1
-rw-r--r--src/grp-boot/systemd-boot/Makefile90
-rw-r--r--src/grp-coredump/coredumpctl/Makefile2
-rw-r--r--src/grp-coredump/systemd-coredump/Makefile4
-rw-r--r--src/grp-machine/Makefile1
-rw-r--r--src/grp-machine/libmachine-core/Makefile2
-rw-r--r--src/grp-machine/nss-mymachines/Makefile2
-rw-r--r--src/grp-resolve/nss-resolve/Makefile2
-rw-r--r--src/grp-resolve/systemd-resolved/Makefile14
l---------src/grp-resolve/systemd-resolved/gcrypt-util.c1
l---------src/grp-resolve/systemd-resolved/gcrypt-util.h1
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-manager.c1
-rw-r--r--src/grp-timedate/systemd-timedated/Makefile2
-rw-r--r--src/grp-timedate/timedatectl/Makefile3
-rw-r--r--src/grp-udev/Makefile3
-rw-r--r--src/grp-udev/libudev-core/Makefile12
l---------src/grp-udev/libudev-core/logind-acl.c1
l---------src/grp-udev/libudev-core/logind-acl.h1
-rw-r--r--src/grp-udev/libudev-core/net/Makefile31
l---------src/grp-udev/libudev-core/sd-login.c1
-rw-r--r--src/grp-udev/libudev-core/udev-builtin-net_setup_link.c2
-rw-r--r--src/grp-udev/mtd_probe/Makefile2
-rw-r--r--src/grp-udev/systemd-udevd/udevd.c1
-rw-r--r--src/grp-udev/udevadm/Makefile3
-rw-r--r--src/libbasic/Makefile9
-rw-r--r--src/libcore/Makefile10
-rw-r--r--src/libcore/loopback-setup.c1
-rw-r--r--src/libfirewall/Makefile2
-rw-r--r--src/libshared/Makefile22
-rw-r--r--src/libshared/local-addresses.c1
-rw-r--r--src/libsystemd-network/Makefile3
-rw-r--r--src/libsystemd/Makefile8
-rw-r--r--src/libsystemd/libsystemd-internal/Makefile8
l---------src/libsystemd/libsystemd-internal/sd-bus/Makefile1
l---------src/libsystemd/libsystemd-internal/sd-daemon/Makefile1
l---------src/libsystemd/libsystemd-internal/sd-device/Makefile1
l---------src/libsystemd/libsystemd-internal/sd-event/Makefile1
l---------src/libsystemd/libsystemd-internal/sd-hwdb/Makefile1
l---------src/libsystemd/libsystemd-internal/sd-id128/Makefile1
l---------src/libsystemd/libsystemd-internal/sd-login/Makefile1
l---------src/libsystemd/libsystemd-internal/sd-netlink/Makefile1
l---------src/libsystemd/libsystemd-internal/sd-network/Makefile1
l---------src/libsystemd/libsystemd-internal/sd-path/Makefile1
l---------src/libsystemd/libsystemd-internal/sd-resolve/Makefile1
l---------src/libsystemd/libsystemd-internal/sd-utf8/Makefile1
-rw-r--r--src/libsystemd/libsystemd-internal/subdir.mk6
-rw-r--r--src/libsystemd/libsystemd-journal-internal/Makefile9
l---------src/libsystemd/libsystemd-journal-internal/gcrypt-util.c1
l---------src/libsystemd/libsystemd-journal-internal/gcrypt-util.h1
-rw-r--r--src/libudev/src/Makefile10
-rw-r--r--src/nss-myhostname/Makefile2
-rw-r--r--src/systemd-cryptsetup/Makefile3
-rw-r--r--src/systemd-dbus1-generator/Makefile3
-rw-r--r--src/systemd-debug-generator/Makefile2
-rw-r--r--src/systemd-fsck/Makefile2
l---------src/systemd-fstab-generator/mount-setup.c1
l---------src/systemd-fstab-generator/mount-setup.h1
-rw-r--r--src/systemd-getty-generator/Makefile2
-rw-r--r--src/systemd-gpt-auto-generator/Makefile2
-rw-r--r--src/systemd-hibernate-resume/Makefile2
-rw-r--r--src/systemd-hwdb/Makefile3
-rw-r--r--src/systemd-initctl/Makefile2
-rw-r--r--src/systemd-nspawn/Makefile3
l---------src/systemd-nspawn/loopback-setup.c1
l---------src/systemd-nspawn/loopback-setup.h1
l---------src/systemd-nspawn/machine-id-setup.c1
l---------src/systemd-nspawn/machine-id-setup.h1
l---------src/systemd-nspawn/mount-setup.c1
l---------src/systemd-nspawn/mount-setup.h1
-rw-r--r--src/systemd-nspawn/nspawn-expose-ports.c1
-rw-r--r--src/systemd-nspawn/nspawn-network.c1
-rw-r--r--src/systemd-nspawn/nspawn-register.c2
-rw-r--r--src/systemd-nspawn/nspawn.c1
-rw-r--r--src/systemd-quotacheck/Makefile2
-rw-r--r--src/systemd-random-seed/Makefile3
-rw-r--r--src/systemd-remount-fs/Makefile3
l---------src/systemd-remount-fs/mount-setup.c1
l---------src/systemd-remount-fs/mount-setup.h1
-rw-r--r--src/systemd-shutdown/Makefile3
l---------src/systemd-shutdown/killall.c1
l---------src/systemd-shutdown/killall.h1
l---------src/systemd-shutdown/mount-setup.c1
l---------src/systemd-shutdown/mount-setup.h1
-rw-r--r--src/systemd-sleep/Makefile2
-rw-r--r--src/systemd-system-update-generator/Makefile2
-rw-r--r--src/systemd-timesyncd/Makefile3
88 files changed, 328 insertions, 97 deletions
diff --git a/src/Makefile b/src/Makefile
index b84e6076a0..2048196700 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -23,5 +23,79 @@
include $(dir $(lastword $(MAKEFILE_LIST)))/../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
+at.subdirs += busctl
+at.subdirs += grp-boot
+at.subdirs += grp-coredump
+#at.subdirs += grp-hostname
+#at.subdirs += grp-import
+#at.subdirs += grp-journal
+#at.subdirs += grp-journal-remote
+#at.subdirs += grp-locale
+#at.subdirs += grp-login
+#at.subdirs += grp-machine
+#at.subdirs += grp-network
+at.subdirs += grp-resolve
+#at.subdirs += grp-system
+at.subdirs += grp-timedate
+at.subdirs += grp-udev
+at.subdirs += kernel-install
+at.subdirs += libbasic
+at.subdirs += libcore
+at.subdirs += libfirewall
+at.subdirs += libshared
+at.subdirs += libsystemd
+at.subdirs += libsystemd-network
+at.subdirs += libudev
+at.subdirs += nss-myhostname
+at.subdirs += systemd-activate
+at.subdirs += systemd-ac-power
+at.subdirs += systemd-analyze
+at.subdirs += systemd-ask-password
+at.subdirs += systemd-backlight
+at.subdirs += systemd-binfmt
+at.subdirs += systemd-cgls
+at.subdirs += systemd-cgroups-agent
+at.subdirs += systemd-cgtop
+at.subdirs += systemd-cryptsetup
+at.subdirs += systemd-dbus1-generator
+at.subdirs += systemd-debug-generator
+at.subdirs += systemd-delta
+at.subdirs += systemd-detect-virt
+at.subdirs += systemd-escape
+at.subdirs += systemd-firstboot
+at.subdirs += systemd-fsck
+at.subdirs += systemd-fstab-generator
+at.subdirs += systemd-getty-generator
+at.subdirs += systemd-gpt-auto-generator
+at.subdirs += systemd-hibernate-resume
+at.subdirs += systemd-hwdb
+at.subdirs += systemd-initctl
+at.subdirs += systemd-machine-id-setup
+at.subdirs += systemd-modules-load
+at.subdirs += systemd-notify
+at.subdirs += systemd-nspawn
+at.subdirs += systemd-path
+at.subdirs += systemd-quotacheck
+at.subdirs += systemd-random-seed
+at.subdirs += systemd-rc-local-generator
+at.subdirs += systemd-remount-fs
+at.subdirs += systemd-reply-password
+at.subdirs += systemd-rfkill
+at.subdirs += systemd-run
+at.subdirs += systemd-shutdown
+at.subdirs += systemd-sleep
+at.subdirs += systemd-socket-proxyd
+at.subdirs += systemd-stdio-bridge
+at.subdirs += systemd-sysctl
+at.subdirs += systemd-sysusers
+at.subdirs += systemd-system-update-generator
+at.subdirs += systemd-sysv-generator
+at.subdirs += systemd-timesyncd
+at.subdirs += systemd-tmpfiles
+at.subdirs += systemd-tty-ask-password-agent
+at.subdirs += systemd-update-done
+at.subdirs += systemd-update-utmp
+at.subdirs += systemd-user-sessions
+at.subdirs += systemd-vconsole
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/busctl/Makefile b/src/busctl/Makefile
index e7ef92824c..4ea6019bc1 100644
--- a/src/busctl/Makefile
+++ b/src/busctl/Makefile
@@ -34,4 +34,6 @@ busctl_SOURCES = \
busctl_LDADD = \
libshared.la
+systemd.CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-internal/sd-bus
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-boot/bootctl/Makefile b/src/grp-boot/bootctl/Makefile
index 84253d2387..a983e32a9f 100644
--- a/src/grp-boot/bootctl/Makefile
+++ b/src/grp-boot/bootctl/Makefile
@@ -51,4 +51,5 @@ dist_zshcompletion_data += \
shell-completion/zsh/_bootctl
endif # HAVE_BLKID
endif # ENABLE_EFI
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-boot/systemd-boot/Makefile b/src/grp-boot/systemd-boot/Makefile
index 5b53fdc7e4..2a56560c2c 100644
--- a/src/grp-boot/systemd-boot/Makefile
+++ b/src/grp-boot/systemd-boot/Makefile
@@ -25,6 +25,7 @@ include $(topsrcdir)/build-aux/Makefile.head.mk
ifneq ($(ENABLE_EFI),)
ifneq ($(HAVE_GNUEFI),)
+# ------------------------------------------------------------------------------
efi_cppflags = \
$(EFI_CPPFLAGS) \
-I$(top_builddir) -include config.h \
@@ -81,9 +82,18 @@ EFI_FORMAT = -O binary
else
EFI_FORMAT = --target=efi-app-$(EFI_ARCH)
endif # ARCH_AARCH64
-endif # HAVE_GNUEFI
-endif # ENABLE_EFI
+$(outdir)/%.o: $(srcdir)/%.c
+ $(AM_V_EFI_CC)$(EFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@
+
+$(outdir)/%.so:
+ @if test $(words $^) = 0; then echo 'Cannot link EFI library with no dependencies: $@' >&2; exit 1; fi
+ $(AM_V_EFI_CCLD)$(LD) $(efi_ldflags) $^ -o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name)
+ $(AM_V_at)! { nm -D -u $@ | grep ' U '; }
+
+# These next 2 are the same rule
+$(outdir)/%$(EFI_MACHINE_TYPE_NAME).efi : $(outdir)/%.so; $(AM_V_GEN)$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel -j .rela -j .reloc $(EFI_FORMAT) $< $@
+$(outdir)/%$(EFI_MACHINE_TYPE_NAME).efi.stub: $(outdir)/%.so; $(AM_V_GEN)$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel -j .rela -j .reloc $(EFI_FORMAT) $< $@
# ------------------------------------------------------------------------------
systemd_boot_headers = \
src/boot/efi/util.h \
@@ -102,33 +112,10 @@ systemd_boot_sources = \
src/boot/efi/measure.c \
src/boot/efi/boot.c
-EXTRA_DIST += $(systemd_boot_sources) $(systemd_boot_headers)
-
-systemd_boot_objects = $(addprefix $(top_builddir)/,$(systemd_boot_sources:.c=.o))
-systemd_boot_solib = $(top_builddir)/src/boot/efi/systemd_boot.so
systemd_boot = systemd-boot$(EFI_MACHINE_TYPE_NAME).efi
-
-ifneq ($(ENABLE_EFI),)
-ifneq ($(HAVE_GNUEFI),)
-bootlib_DATA = $(systemd_boot)
-
-$(outdir)/%.o: $(top_srcdir)/src/boot/efi/%.c $(addprefix $(top_srcdir)/,$(systemd_boot_headers))
- @$(MKDIR_P) $(top_builddir)/src/boot/efi/
- $(AM_V_CC)$(EFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@
-
-$(systemd_boot_solib): $(systemd_boot_objects)
- $(AM_V_CCLD)$(LD) $(efi_ldflags) $(systemd_boot_objects) \
- -o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name); \
- nm -D -u $@ | grep ' U ' && exit 1 || :
-
-$(systemd_boot): $(systemd_boot_solib)
- $(AM_V_GEN)$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \
- -j .dynsym -j .rel -j .rela -j .reloc $(EFI_FORMAT) $< $@
-endif # HAVE_GNUEFI
-endif # ENABLE_EFI
-
-CLEANFILES += $(systemd_boot_objects) $(systemd_boot_solib) $(systemd_boot)
-
+std.out_files += $(systemd_boot)
+std.sys_files += $(bootlibdir)/$(systemd_boot)
+$(outdir)/systemd-boot.so: $(addprefix $(outdir)/,$(notdir $(systemd_boot_sources:.c=.o)))
# ------------------------------------------------------------------------------
stub_headers = \
src/boot/efi/util.h \
@@ -149,46 +136,19 @@ stub_sources = \
src/boot/efi/measure.c \
src/boot/efi/stub.c
-EXTRA_DIST += \
- $(stub_sources) \
- $(stub_headers) \
- test/splash.bmp
-
-stub_objects = $(addprefix $(top_builddir)/,$(stub_sources:.c=.o))
-stub_solib = $(top_builddir)/src/boot/efi/stub.so
stub = linux$(EFI_MACHINE_TYPE_NAME).efi.stub
-
-ifneq ($(ENABLE_EFI),)
-ifneq ($(HAVE_GNUEFI),)
-bootlib_DATA += $(stub)
-
-$(outdir)/%.o: $(top_srcdir)/src/boot/efi/%.c $(addprefix $(top_srcdir)/,$(stub_headers))
- @$(MKDIR_P) $(top_builddir)/src/boot/efi/
- $(AM_V_CC)$(EFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@
-
-$(stub_solib): $(stub_objects)
- $(AM_V_CCLD)$(LD) $(efi_ldflags) $(stub_objects) \
- -o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name); \
- nm -D -u $@ | grep ' U ' && exit 1 || :
-
-$(stub): $(stub_solib)
- $(AM_V_GEN)$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \
- -j .dynsym -j .rel -j .rela -j .reloc $(EFI_FORMAT) $< $@
-endif # HAVE_GNUEFI
-endif # ENABLE_EFI
-
-CLEANFILES += $(stub_objects) $(stub_solib) $(stub)
-
-
+std.out_files += $(stub)
+std.sys_files += $(bootlibdir)/$(stub)
+$(outdir)/linux.so: $(addprefix $(outdir)/,$(notdir $(stub_sources:.c=.o)))
# ------------------------------------------------------------------------------
-CLEANFILES += test-efi-disk.img
-
-test-efi-disk.img: $(systemd_boot) $(stub) test/test-efi-create-disk.sh
- $(AM_V_GEN)test/test-efi-create-disk.sh
+$(outdir)/test-efi-disk.img: $(outdir)/$(systemd_boot) $(outdir)/$(stub) $(srcdir)/test-efi-create-disk.sh
+ $(AM_V_GEN)$(@D)/test-efi-create-disk.sh
-test-efi: test-efi-disk.img
+test-efi: $(outdir)/test-efi-disk.img
$(QEMU) -machine accel=kvm -m 1024 -bios $(QEMU_BIOS) -snapshot test-efi-disk.img
-EXTRA_DIST += test/test-efi-create-disk.sh
-
+std.clean_files += test-efi-disk.img
+# ------------------------------------------------------------------------------
+endif # HAVE_GNUEFI
+endif # ENABLE_EFI
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-coredump/coredumpctl/Makefile b/src/grp-coredump/coredumpctl/Makefile
index 47a4397fa4..4b291feb44 100644
--- a/src/grp-coredump/coredumpctl/Makefile
+++ b/src/grp-coredump/coredumpctl/Makefile
@@ -38,4 +38,6 @@ dist_bashcompletion_data += \
dist_zshcompletion_data += \
shell-completion/zsh/_coredumpctl
+systemd.CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-journal-internal
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-coredump/systemd-coredump/Makefile b/src/grp-coredump/systemd-coredump/Makefile
index bc71db120e..083a80571a 100644
--- a/src/grp-coredump/systemd-coredump/Makefile
+++ b/src/grp-coredump/systemd-coredump/Makefile
@@ -78,4 +78,8 @@ EXTRA_DIST += \
sysctl.d/50-coredump.conf.in \
units/systemd-coredump@.service.in
+systemd.CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-journal-internal
+systemd.CPPFLAGS += -I$(topsrcdir)/src/grp-journal/libjournal-core
+systemd.CPPFLAGS += -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-machine/Makefile b/src/grp-machine/Makefile
index 7412341233..59142f78bd 100644
--- a/src/grp-machine/Makefile
+++ b/src/grp-machine/Makefile
@@ -24,6 +24,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
at.subdirs += machinectl systemd-machined
+at.subdirs += libmachine-core
at.subdirs += nss-mymachines
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-machine/libmachine-core/Makefile b/src/grp-machine/libmachine-core/Makefile
index 3881224746..d22e01e25f 100644
--- a/src/grp-machine/libmachine-core/Makefile
+++ b/src/grp-machine/libmachine-core/Makefile
@@ -49,4 +49,6 @@ test_machine_tables_LDADD = \
tests += \
test-machine-tables
+systemd.CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-internal/sd-bus
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-machine/nss-mymachines/Makefile b/src/grp-machine/nss-mymachines/Makefile
index c7c0d76907..00a62bbafc 100644
--- a/src/grp-machine/nss-mymachines/Makefile
+++ b/src/grp-machine/nss-mymachines/Makefile
@@ -43,4 +43,6 @@ libnss_mymachines_la_LIBADD = \
lib_LTLIBRARIES += \
libnss_mymachines.la
+systemd.CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-internal/sd-bus
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-resolve/nss-resolve/Makefile b/src/grp-resolve/nss-resolve/Makefile
index acfbe831ae..8ac66b2f7c 100644
--- a/src/grp-resolve/nss-resolve/Makefile
+++ b/src/grp-resolve/nss-resolve/Makefile
@@ -43,4 +43,6 @@ libnss_resolve_la_LIBADD = \
lib_LTLIBRARIES += \
libnss_resolve.la
+systemd.CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-internal/sd-bus
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-resolve/systemd-resolved/Makefile b/src/grp-resolve/systemd-resolved/Makefile
index e18b1b3d90..8d26124091 100644
--- a/src/grp-resolve/systemd-resolved/Makefile
+++ b/src/grp-resolve/systemd-resolved/Makefile
@@ -24,16 +24,13 @@ include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
-$(outdir)/dns_type-list.txt: src/resolve/dns-type.h
- $(AM_V_at)$(MKDIR_P) $(dir $@)
+$(outdir)/dns_type-list.txt: $(srcdir)/dns-type.h
$(AM_V_GEN)$(SED) -n -r 's/.* DNS_TYPE_(\w+).*/\1/p' <$< >$@
-$(outdir)/dns_type-to-name.h: src/resolve/dns_type-list.txt
- $(AM_V_at)$(MKDIR_P) $(dir $@)
+$(outdir)/dns_type-to-name.h: $(outdir)/dns_type-list.txt
$(AM_V_GEN)$(AWK) 'BEGIN{ print "const char *dns_type_to_string(int type) {\n\tswitch(type) {" } {printf " case DNS_TYPE_%s: return ", $$1; sub(/_/, "-"); printf "\"%s\";\n", $$1 } END{ print " default: return NULL;\n\t}\n}\n" }' <$< >$@
-$(outdir)/dns_type-from-name.gperf: src/resolve/dns_type-list.txt
- $(AM_V_at)$(MKDIR_P) $(dir $@)
+$(outdir)/dns_type-from-name.gperf: $(outdir)/dns_type-list.txt
$(AM_V_GEN)$(AWK) 'BEGIN{ print "struct dns_type_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { s=$$1; sub(/_/, "-", s); printf "%s, ", $$s; printf "DNS_TYPE_%s\n", $$1 }' <$< >$@
ifneq ($(ENABLE_RESOLVED),)
@@ -224,4 +221,9 @@ EXTRA_DIST += \
units/systemd-resolved.service.m4.in \
src/resolve/resolved.conf.in
+
+$(outdir)/dns-type.o: $(outdir)/dns_type-from-name.h $(outdir)/dns_type-to-name.h
+systemd.CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-internal/sd-bus
+systemd.CPPFLAGS += -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-resolve/systemd-resolved/gcrypt-util.c b/src/grp-resolve/systemd-resolved/gcrypt-util.c
new file mode 120000
index 0000000000..79dc82a466
--- /dev/null
+++ b/src/grp-resolve/systemd-resolved/gcrypt-util.c
@@ -0,0 +1 @@
+../../libshared/gcrypt-util.c \ No newline at end of file
diff --git a/src/grp-resolve/systemd-resolved/gcrypt-util.h b/src/grp-resolve/systemd-resolved/gcrypt-util.h
new file mode 120000
index 0000000000..6da58160eb
--- /dev/null
+++ b/src/grp-resolve/systemd-resolved/gcrypt-util.h
@@ -0,0 +1 @@
+../../libshared/gcrypt-util.h \ No newline at end of file
diff --git a/src/grp-resolve/systemd-resolved/resolved-manager.c b/src/grp-resolve/systemd-resolved/resolved-manager.c
index 7166b94d71..c447ff63af 100644
--- a/src/grp-resolve/systemd-resolved/resolved-manager.c
+++ b/src/grp-resolve/systemd-resolved/resolved-manager.c
@@ -28,7 +28,6 @@
#include "fileio-label.h"
#include "hostname-util.h"
#include "io-util.h"
-#include "netlink-util.h"
#include "network-internal.h"
#include "ordered-set.h"
#include "parse-util.h"
diff --git a/src/grp-timedate/systemd-timedated/Makefile b/src/grp-timedate/systemd-timedated/Makefile
index 798e3ba5a4..5d397e0bb0 100644
--- a/src/grp-timedate/systemd-timedated/Makefile
+++ b/src/grp-timedate/systemd-timedated/Makefile
@@ -62,4 +62,6 @@ polkitpolicy_in_files += \
EXTRA_DIST += \
units/systemd-timedated.service.in
+systemd.CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-internal/sd-bus
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-timedate/timedatectl/Makefile b/src/grp-timedate/timedatectl/Makefile
index c1be945443..1dfb81c2f6 100644
--- a/src/grp-timedate/timedatectl/Makefile
+++ b/src/grp-timedate/timedatectl/Makefile
@@ -39,4 +39,7 @@ dist_bashcompletion_data += \
dist_zshcompletion_data += \
shell-completion/zsh/_timedatectl
endif # ENABLE_TIMEDATED
+
+systemd.CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-internal/sd-bus
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-udev/Makefile b/src/grp-udev/Makefile
index cc85f0317f..f6c3b1ceb4 100644
--- a/src/grp-udev/Makefile
+++ b/src/grp-udev/Makefile
@@ -69,4 +69,7 @@ SYSINIT_TARGET_WANTS += \
systemd-udevd.service \
systemd-udev-trigger.service
+at.subdirs += systemd-udevd udevadm
+at.subdirs += ata_id cdrom_id collect mtd_probe scsi_id v4l_id
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-udev/libudev-core/Makefile b/src/grp-udev/libudev-core/Makefile
index e95d53120a..56efd36aa6 100644
--- a/src/grp-udev/libudev-core/Makefile
+++ b/src/grp-udev/libudev-core/Makefile
@@ -38,7 +38,7 @@ $(outdir)/keyboard-keys-from-name.h: $(outdir)/keyboard-keys-from-name.gperf
gperf_txt_sources += \
src/udev/keyboard-keys-list.txt
-libudev_core_la_SOURCES = \
+_libudev_core_la_SOURCES = \
src/udev/udev.h \
src/udev/udev-event.c \
src/udev/udev-watch.c \
@@ -59,7 +59,7 @@ libudev_core_la_SOURCES = \
src/udev/net/ethtool-util.h \
src/udev/net/ethtool-util.c
-nodist_libudev_core_la_SOURCES = \
+_nodist_libudev_core_la_SOURCES = \
src/udev/keyboard-keys-from-name.h \
src/udev/net/link-config-gperf.c
@@ -98,4 +98,12 @@ libudev_core_la_SOURCES += \
src/systemd/sd-login.h
endif # HAVE_ACL
+libudev-core.la.SOURCES = $(patsubst src/udev/%,%,$(filter %.c,$(_libudev_core_la_SOURCES) $(_nodist_libudev_core_la_SOURCES)))
+libudev-core.la.DEPENDS = $(addprefix $(outdir)/,$(libudev-core.la.SOURCES:.c=.lo))
+at.subdirs += net
+$(outdir)/udev-builtin-keyboard.lo: $(outdir)/keyboard-keys-from-name.h
+systemd.CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-internal/sd-netlink
+systemd.CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-internal/sd-hwdb
+systemd.CPPFLAGS += -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-udev/libudev-core/logind-acl.c b/src/grp-udev/libudev-core/logind-acl.c
new file mode 120000
index 0000000000..d554c77128
--- /dev/null
+++ b/src/grp-udev/libudev-core/logind-acl.c
@@ -0,0 +1 @@
+../../grp-login/logind-acl.c \ No newline at end of file
diff --git a/src/grp-udev/libudev-core/logind-acl.h b/src/grp-udev/libudev-core/logind-acl.h
new file mode 120000
index 0000000000..0355fa2378
--- /dev/null
+++ b/src/grp-udev/libudev-core/logind-acl.h
@@ -0,0 +1 @@
+../../grp-login/logind-acl.h \ No newline at end of file
diff --git a/src/grp-udev/libudev-core/net/Makefile b/src/grp-udev/libudev-core/net/Makefile
new file mode 100644
index 0000000000..7ff2f40349
--- /dev/null
+++ b/src/grp-udev/libudev-core/net/Makefile
@@ -0,0 +1,31 @@
+# -*- Mode: makefile; indent-tabs-mode: t -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2010-2012 Lennart Poettering
+# Copyright 2010-2012 Kay Sievers
+# Copyright 2013 Zbigniew Jędrzejewski-Szmek
+# Copyright 2013 David Strauss
+# Copyright 2016 Luke Shumaker
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+#
+# systemd is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with systemd; If not, see <http://www.gnu.org/licenses/>.
+
+include $(dir $(lastword $(MAKEFILE_LIST)))/../../../../config.mk
+include $(topsrcdir)/build-aux/Makefile.head.mk
+
+systemd.CPPFLAGS += $(libshared.CPPFLAGS)
+systemd.CPPFLAGS += $(libsystemd-network.CPPFLAGS)
+systemd.CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-internal/sd-netlink
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-udev/libudev-core/sd-login.c b/src/grp-udev/libudev-core/sd-login.c
new file mode 120000
index 0000000000..95a6042740
--- /dev/null
+++ b/src/grp-udev/libudev-core/sd-login.c
@@ -0,0 +1 @@
+../../libsystemd/libsystemd-internal/sd-login/sd-login.c \ No newline at end of file
diff --git a/src/grp-udev/libudev-core/udev-builtin-net_setup_link.c b/src/grp-udev/libudev-core/udev-builtin-net_setup_link.c
index 8e47775135..62689d4be9 100644
--- a/src/grp-udev/libudev-core/udev-builtin-net_setup_link.c
+++ b/src/grp-udev/libudev-core/udev-builtin-net_setup_link.c
@@ -18,7 +18,7 @@
***/
#include "alloc-util.h"
-#include "link-config.h"
+#include "net/link-config.h"
#include "log.h"
#include "udev.h"
diff --git a/src/grp-udev/mtd_probe/Makefile b/src/grp-udev/mtd_probe/Makefile
index d7392a8a3b..50703dddda 100644
--- a/src/grp-udev/mtd_probe/Makefile
+++ b/src/grp-udev/mtd_probe/Makefile
@@ -34,4 +34,6 @@ dist_udevrules_DATA += \
udevlibexec_PROGRAMS += \
mtd_probe
+mtd_probe_LDADD += libbasic.la
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-udev/systemd-udevd/udevd.c b/src/grp-udev/systemd-udevd/udevd.c
index 89006e6e3a..089a7eb591 100644
--- a/src/grp-udev/systemd-udevd/udevd.c
+++ b/src/grp-udev/systemd-udevd/udevd.c
@@ -53,7 +53,6 @@
#include "fs-util.h"
#include "hashmap.h"
#include "io-util.h"
-#include "netlink-util.h"
#include "parse-util.h"
#include "proc-cmdline.h"
#include "process-util.h"
diff --git a/src/grp-udev/udevadm/Makefile b/src/grp-udev/udevadm/Makefile
index ba3b466935..e3c5ed351f 100644
--- a/src/grp-udev/udevadm/Makefile
+++ b/src/grp-udev/udevadm/Makefile
@@ -42,4 +42,7 @@ udevadm_SOURCES = \
udevadm_LDADD = \
libudev-core.la
+systemd.CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-internal/sd-hwdb
+systemd.CPPFLAGS += -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libbasic/Makefile b/src/libbasic/Makefile
index 9f8d4ec995..ded8e4de8b 100644
--- a/src/libbasic/Makefile
+++ b/src/libbasic/Makefile
@@ -264,8 +264,8 @@ $(outdir)/arphrd-from-name.gperf: $(outdir)/arphrd-list.txt
$(AM_V_GEN)$(AWK) 'BEGIN{ print "struct arphrd_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, ARPHRD_%s\n", $$1, $$1 }' <$< >$@
-$(outdir)/cap-list.txt:
- $(AM_V_GEN)$(CPP) $(ALL_CPPFLAGS) -dM -include linux/capability.h -include missing.h - </dev/null | $(AWK) '/^#define[ \t]+CAP_[A-Z_]+[ \t]+/ { print $$2; }' | grep -v CAP_LAST_CAP >$@
+$(outdir)/cap-list.txt: $(srcdir)/missing.h
+ $(AM_V_GEN)$(CPP) $(ALL_CPPFLAGS) -dM -include linux/capability.h -include $< - </dev/null | $(AWK) '/^#define[ \t]+CAP_[A-Z_]+[ \t]+/ { print $$2; }' | grep -v CAP_LAST_CAP >$@
$(outdir)/cap-to-name.h: $(outdir)/cap-list.txt
$(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const capability_names[] = { "} { printf "[%s] = \"%s\",\n", $$1, tolower($$1) } END{print "};"}' <$< >$@
@@ -276,4 +276,9 @@ $(outdir)/cap-from-name.gperf: $(outdir)/cap-list.txt
$(outdir)/cap-from-name.h: $(outdir)/cap-from-name.gperf
$(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_capability -H hash_capability_name -p -C <$< >$@
+$(outdir)/af-list.lo: $(outdir)/af-from-name.h $(outdir)/af-to-name.h
+$(outdir)/arphrd-list.lo: $(outdir)/arphrd-from-name.h $(outdir)/arphrd-to-name.h
+$(outdir)/cap-list.lo: $(outdir)/cap-from-name.h $(outdir)/cap-to-name.h
+$(outdir)/errno-list.lo: $(outdir)/errno-from-name.h $(outdir)/errno-to-name.h
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libcore/Makefile b/src/libcore/Makefile
index f40a115042..53059eda20 100644
--- a/src/libcore/Makefile
+++ b/src/libcore/Makefile
@@ -163,8 +163,14 @@ libcore_la_LIBADD = \
$(APPARMOR_LIBS) \
$(MOUNT_LIBS)
-$(outdir)/load-fragment-gperf-nulstr.c: src/core/load-fragment-gperf.gperf
- $(AM_V_at)$(MKDIR_P) $(dir $@)
+$(outdir)/load-fragment-gperf-nulstr.c: $(outdir)/load-fragment-gperf.gperf
$(AM_V_GEN)$(AWK) 'BEGIN{ keywords=0 ; FS="," ; print "extern const char load_fragment_gperf_nulstr[];" ; print "const char load_fragment_gperf_nulstr[] ="} ; keyword==1 { print "\"" $$1 "\\0\"" } ; /%%/ { keyword=1} ; END { print ";" }' < $< > $@
+systemd.CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-internal/sd-bus
+systemd.CPPFLAGS += -I$(topsrcdir)/src/libudev/src
+systemd.CPPFLAGS += -DMOUNT_PATH=\"$(MOUNT_PATH)\"
+systemd.CPPFLAGS += -DUMOUNT_PATH=\"$(UMOUNT_PATH)\"
+systemd.CPPFLAGS += -DSYSTEMD_CGROUP_AGENT_PATH=\"$(libexecdir)/systemd-cgroups-agent\"
+systemd.CPPFLAGS += -DSYSTEMD_BINARY_PATH=\"$(libexecdir)/systemd\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libcore/loopback-setup.c b/src/libcore/loopback-setup.c
index d56bbfa6fc..1a8ec6166e 100644
--- a/src/libcore/loopback-setup.c
+++ b/src/libcore/loopback-setup.c
@@ -24,7 +24,6 @@
#include "loopback-setup.h"
#include "missing.h"
-#include "netlink-util.h"
static int start_loopback(sd_netlink *rtnl) {
_cleanup_(sd_netlink_message_unrefp) sd_netlink_message *req = NULL;
diff --git a/src/libfirewall/Makefile b/src/libfirewall/Makefile
index ced0f7e476..ebc567cc55 100644
--- a/src/libfirewall/Makefile
+++ b/src/libfirewall/Makefile
@@ -39,4 +39,6 @@ libfirewall_la_LIBADD = \
$(LIBIPTC_LIBS)
endif # HAVE_LIBIPTC
+systemd.CPPFLAGS += $(libbasic.CPPFLAGS)
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libshared/Makefile b/src/libshared/Makefile
index 67a19f4e21..052865e882 100644
--- a/src/libshared/Makefile
+++ b/src/libshared/Makefile
@@ -27,6 +27,8 @@ noinst_LTLIBRARIES += \
libshared.la
libshared_la_SOURCES = \
+ src/libsystemd/sd-netlink/local-addresses.h \
+ src/libsystemd/sd-netlink/local-addresses.c \
src/shared/output-mode.h \
src/shared/output-mode.c \
src/shared/gpt.h \
@@ -146,4 +148,24 @@ test_local_addresses_SOURCES = \
test_local_addresses_LDADD = \
libshared.la
+systemd.CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-journal-internal
+systemd.CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-internal/sd-bus
+
+systemd.CPPFLAGS += -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\"
+systemd.CPPFLAGS += -DSYSTEM_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/system\"
+systemd.CPPFLAGS += -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\"
+systemd.CPPFLAGS += -DSYSTEM_SYSVINIT_PATH=\"$(SYSTEM_SYSVINIT_PATH)\"
+systemd.CPPFLAGS += -DSYSTEM_SYSVRCND_PATH=\"$(SYSTEM_SYSVRCND_PATH)\"
+systemd.CPPFLAGS += -DUSER_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/user\"
+systemd.CPPFLAGS += -DUSER_DATA_UNIT_PATH=\"$(userunitdir)\"
+
+systemd.CPPFLAGS += -DSYSTEMD_FSCK_PATH=\"$(libexecdir)/systemd-fsck\"
+
+systemd.CPPFLAGS += -DSYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH=\"$(bindir)/systemd-tty-ask-password-agent\"
+
+systemd.CPPFLAGS += -DSYSTEM_GENERATOR_PATH=\"$(systemgeneratordir)\"
+systemd.CPPFLAGS += -DUSER_GENERATOR_PATH=\"$(usergeneratordir)\"
+
+systemd.CPPFLAGS += -DPOLKIT_AGENT_BINARY_PATH=\"$(bindir)/pkttyagent\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libshared/local-addresses.c b/src/libshared/local-addresses.c
index 1abce75b01..5cceddd03c 100644
--- a/src/libshared/local-addresses.c
+++ b/src/libshared/local-addresses.c
@@ -23,7 +23,6 @@
#include "alloc-util.h"
#include "local-addresses.h"
#include "macro.h"
-#include "netlink-util.h"
static int address_compare(const void *_a, const void *_b) {
const struct local_address *a = _a, *b = _b;
diff --git a/src/libsystemd-network/Makefile b/src/libsystemd-network/Makefile
index 6b16906c17..b3fc7d0640 100644
--- a/src/libsystemd-network/Makefile
+++ b/src/libsystemd-network/Makefile
@@ -170,4 +170,7 @@ tests += \
test-dhcp6-client \
test-lldp
+systemd.CPPFLAGS += $(libshared.CPPFLAGS)
+systemd.CPPFLAGS += -I$(topsrcdir)/src/libudev/src
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libsystemd/Makefile b/src/libsystemd/Makefile
index 2c6505918b..97fa201656 100644
--- a/src/libsystemd/Makefile
+++ b/src/libsystemd/Makefile
@@ -32,11 +32,11 @@ EXTRA_DIST += \
src/libsystemd/sd-bus/DIFFERENCES \
src/libsystemd/sd-bus/GVARIANT-SERIALIZATION
-libsystemd_la_SOURCES = \
+_libsystemd_la_SOURCES = \
$(libsystemd_internal_la_SOURCES) \
$(libsystemd_journal_internal_la_SOURCES)
-nodist_libsystemd_la_SOURCES = \
+_nodist_libsystemd_la_SOURCES = \
$(nodist_libsystemd_internal_la_SOURCES)
libsystemd_la_CFLAGS = \
@@ -107,4 +107,8 @@ nodist_test_libsystemd_sym_SOURCES = \
test_libsystemd_sym_LDADD = \
libsystemd.la
+$(outdir)/libsystemd.la: $(srcdir)/libsystemd.sym
+at.subdirs += libsystemd-internal libsystemd-journal-internal
+systemd.sed_files += libsystemd.pc
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libsystemd/libsystemd-internal/Makefile b/src/libsystemd/libsystemd-internal/Makefile
index 6bf0488bf5..be314d91c4 100644
--- a/src/libsystemd/libsystemd-internal/Makefile
+++ b/src/libsystemd/libsystemd-internal/Makefile
@@ -23,7 +23,7 @@
include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
-libsystemd_internal_la_SOURCES = \
+_libsystemd_internal_la_SOURCES = \
src/systemd/sd-bus.h \
src/systemd/sd-bus-protocol.h \
src/systemd/sd-bus-vtable.h \
@@ -92,8 +92,6 @@ libsystemd_internal_la_SOURCES = \
src/libsystemd/sd-netlink/netlink-types.c \
src/libsystemd/sd-netlink/netlink-util.h \
src/libsystemd/sd-netlink/netlink-util.c \
- src/libsystemd/sd-netlink/local-addresses.h \
- src/libsystemd/sd-netlink/local-addresses.c \
src/libsystemd/sd-id128/sd-id128.c \
src/libsystemd/sd-daemon/sd-daemon.c \
src/libsystemd/sd-login/sd-login.c \
@@ -244,4 +242,8 @@ test_resolve_SOURCES = \
test_resolve_LDADD = \
libshared.la
+libsystemd-internal.la.SOURCES = $(patsubst src/libsystemd/%,%,$(filter %.c,$(_libsystemd_internal_la_SOURCES)))
+libsystemd-internal.la.DEPENDS = $(addprefix $(outdir)/,$(libsystemd-internal.la.SOURCES:.c=.lo))
+at.subdirs += $(sort $(dir $(libsystemd-internal.la.SOURCES)))
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libsystemd/libsystemd-internal/sd-bus/Makefile b/src/libsystemd/libsystemd-internal/sd-bus/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/libsystemd-internal/sd-bus/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/libsystemd-internal/sd-daemon/Makefile b/src/libsystemd/libsystemd-internal/sd-daemon/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/libsystemd-internal/sd-daemon/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/libsystemd-internal/sd-device/Makefile b/src/libsystemd/libsystemd-internal/sd-device/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/libsystemd-internal/sd-device/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/libsystemd-internal/sd-event/Makefile b/src/libsystemd/libsystemd-internal/sd-event/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/libsystemd-internal/sd-event/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/libsystemd-internal/sd-hwdb/Makefile b/src/libsystemd/libsystemd-internal/sd-hwdb/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/libsystemd-internal/sd-hwdb/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/libsystemd-internal/sd-id128/Makefile b/src/libsystemd/libsystemd-internal/sd-id128/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/libsystemd-internal/sd-id128/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/libsystemd-internal/sd-login/Makefile b/src/libsystemd/libsystemd-internal/sd-login/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/libsystemd-internal/sd-login/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/libsystemd-internal/sd-netlink/Makefile b/src/libsystemd/libsystemd-internal/sd-netlink/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/libsystemd-internal/sd-netlink/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/libsystemd-internal/sd-network/Makefile b/src/libsystemd/libsystemd-internal/sd-network/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/libsystemd-internal/sd-network/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/libsystemd-internal/sd-path/Makefile b/src/libsystemd/libsystemd-internal/sd-path/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/libsystemd-internal/sd-path/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/libsystemd-internal/sd-resolve/Makefile b/src/libsystemd/libsystemd-internal/sd-resolve/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/libsystemd-internal/sd-resolve/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/libsystemd-internal/sd-utf8/Makefile b/src/libsystemd/libsystemd-internal/sd-utf8/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/libsystemd-internal/sd-utf8/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/libsystemd-internal/subdir.mk b/src/libsystemd/libsystemd-internal/subdir.mk
index 35def00fdc..30b6593b42 100644
--- a/src/libsystemd/libsystemd-internal/subdir.mk
+++ b/src/libsystemd/libsystemd-internal/subdir.mk
@@ -20,9 +20,13 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
-include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
+
+include $(dir $(lastword $(MAKEFILE_LIST)))/../../../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
+systemd.CPPFLAGS += $(libsystemd.CPPFLAGS)
+systemd.CPPFLAGS += $(libbasic.CPPFLAGS)
+systemd.CPPFLAGS += $(libshared.CPPFLAGS)
systemd.CPPFLAGS += -DLIBDIR=\"$(libdir)\"
systemd.CPPFLAGS += -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\"
diff --git a/src/libsystemd/libsystemd-journal-internal/Makefile b/src/libsystemd/libsystemd-journal-internal/Makefile
index 964e1b5b4f..1c8547f798 100644
--- a/src/libsystemd/libsystemd-journal-internal/Makefile
+++ b/src/libsystemd/libsystemd-journal-internal/Makefile
@@ -23,12 +23,12 @@
include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
-audit_list_includes = -include linux/audit.h -include missing.h
+audit_list_includes = -include linux/audit.h -include $(topsrcdir)/src/libbasic/missing.h
ifneq ($(HAVE_AUDIT),)
audit_list_includes += -include libaudit.h
endif # HAVE_AUDIT
-$(outdir)/audit_type-list.txt:
+$(outdir)/audit_type-list.txt: $(call at.path,$(topsrcdir)/src/libbasic/missing.h)
$(AM_V_GEN)$(CPP) $(ALL_CPPFLAGS) -dM $(audit_list_includes) - </dev/null | grep -vE 'AUDIT_.*(FIRST|LAST)_' | $(SED) -r -n 's/^#define\s+AUDIT_(\w+)\s+([0-9]{4})\s*$$/\1\t\2/p' | sort -k2 >$@
$(outdir)/audit_type-to-name.h: $(outdir)/audit_type-list.txt
@@ -110,4 +110,9 @@ endif # HAVE_GCRYPT
noinst_LTLIBRARIES += \
libsystemd-journal-internal.la
+
+systemd.CPPFLAGS += $(libbasic.CPPFLAGS)
+systemd.CPPFLAGS += -DCATALOG_DATABASE=\"$(catalogstatedir)/database\"
+$(outdir)/audit-type.lo: $(outdir)/audit_type-to-name.h
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libsystemd/libsystemd-journal-internal/gcrypt-util.c b/src/libsystemd/libsystemd-journal-internal/gcrypt-util.c
new file mode 120000
index 0000000000..79dc82a466
--- /dev/null
+++ b/src/libsystemd/libsystemd-journal-internal/gcrypt-util.c
@@ -0,0 +1 @@
+../../libshared/gcrypt-util.c \ No newline at end of file
diff --git a/src/libsystemd/libsystemd-journal-internal/gcrypt-util.h b/src/libsystemd/libsystemd-journal-internal/gcrypt-util.h
new file mode 120000
index 0000000000..6da58160eb
--- /dev/null
+++ b/src/libsystemd/libsystemd-journal-internal/gcrypt-util.h
@@ -0,0 +1 @@
+../../libshared/gcrypt-util.h \ No newline at end of file
diff --git a/src/libudev/src/Makefile b/src/libudev/src/Makefile
index ed606315e1..6628ec6253 100644
--- a/src/libudev/src/Makefile
+++ b/src/libudev/src/Makefile
@@ -67,9 +67,9 @@ noinst_LTLIBRARIES += \
libudev_internal_la_SOURCES =\
$(libudev_la_SOURCES)
-test-libudev-sym.c: \
- src/libudev/libudev.sym \
- src/udev/udev.h
+$(outdir)/test-libudev-sym.c: \
+ $(srcdir)/libudev.sym \
+ $(srcdir)/udev.h
$(generate-sym-test)
nodist_test_libudev_sym_SOURCES = \
@@ -80,4 +80,8 @@ test_libudev_sym_CFLAGS = \
test_libudev_sym_LDADD = \
libudev.la
+systemd.CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-internal/sd-device
+systemd.CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-internal/sd-hwdb
+systemd.sed_files += libudev.pc
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/nss-myhostname/Makefile b/src/nss-myhostname/Makefile
index b5f6ff62aa..201dbde20a 100644
--- a/src/nss-myhostname/Makefile
+++ b/src/nss-myhostname/Makefile
@@ -44,4 +44,6 @@ lib_LTLIBRARIES += \
libnss_myhostname.la
endif # HAVE_MYHOSTNAME
+libnss_myhostname_la_LIBADD += libshared.la # oops, because I moved local-addresses.{c,h} into libshared
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-cryptsetup/Makefile b/src/systemd-cryptsetup/Makefile
index 73a46bf6da..ccfa2f40ac 100644
--- a/src/systemd-cryptsetup/Makefile
+++ b/src/systemd-cryptsetup/Makefile
@@ -56,4 +56,7 @@ SYSINIT_TARGET_WANTS += \
endif # HAVE_LIBCRYPTSETUP
+systemd.CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-internal/sd-device
+systemd.CPPFLAGS += -DSYSTEMD_CRYPTSETUP_PATH=\"$(rootlibexecdir)/systemd-cryptsetup\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-dbus1-generator/Makefile b/src/systemd-dbus1-generator/Makefile
index 1d7f0d1a81..a817b954e5 100644
--- a/src/systemd-dbus1-generator/Makefile
+++ b/src/systemd-dbus1-generator/Makefile
@@ -46,4 +46,7 @@ dist_xinitrc_SCRIPTS = \
INSTALL_EXEC_HOOKS += dbus1-generator-install-hook
UNINSTALL_EXEC_HOOKS += dbus1-generator-uninstall-hook
+systemd.CPPFLAGS += -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\"
+systemd.CPPFLAGS += -DUSER_DATA_UNIT_PATH=\"$(userunitdir)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-debug-generator/Makefile b/src/systemd-debug-generator/Makefile
index bba46c2905..6d087d7f37 100644
--- a/src/systemd-debug-generator/Makefile
+++ b/src/systemd-debug-generator/Makefile
@@ -31,4 +31,6 @@ systemd_debug_generator_SOURCES = \
systemd_debug_generator_LDADD = \
libshared.la
+systemd.CPPFLAGS += -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-fsck/Makefile b/src/systemd-fsck/Makefile
index cc4e21055c..96537a0898 100644
--- a/src/systemd-fsck/Makefile
+++ b/src/systemd-fsck/Makefile
@@ -30,4 +30,6 @@ systemd_fsck_SOURCES = \
systemd_fsck_LDADD = \
libshared.la
+systemd.CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-internal/sd-device
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-fstab-generator/mount-setup.c b/src/systemd-fstab-generator/mount-setup.c
new file mode 120000
index 0000000000..a4ab487157
--- /dev/null
+++ b/src/systemd-fstab-generator/mount-setup.c
@@ -0,0 +1 @@
+../libcore/mount-setup.c \ No newline at end of file
diff --git a/src/systemd-fstab-generator/mount-setup.h b/src/systemd-fstab-generator/mount-setup.h
new file mode 120000
index 0000000000..1f984851f8
--- /dev/null
+++ b/src/systemd-fstab-generator/mount-setup.h
@@ -0,0 +1 @@
+../libcore/mount-setup.h \ No newline at end of file
diff --git a/src/systemd-getty-generator/Makefile b/src/systemd-getty-generator/Makefile
index 14f7d02a86..cfca8e1e1f 100644
--- a/src/systemd-getty-generator/Makefile
+++ b/src/systemd-getty-generator/Makefile
@@ -30,4 +30,6 @@ systemd_getty_generator_SOURCES = \
systemd_getty_generator_LDADD = \
libshared.la
+systemd.CPPFLAGS += -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-gpt-auto-generator/Makefile b/src/systemd-gpt-auto-generator/Makefile
index 177db8da7c..070d62ba83 100644
--- a/src/systemd-gpt-auto-generator/Makefile
+++ b/src/systemd-gpt-auto-generator/Makefile
@@ -40,4 +40,6 @@ systemd_gpt_auto_generator_CFLAGS = \
$(BLKID_CFLAGS)
endif # HAVE_BLKID
+systemd.CPPFLAGS += -DSYSTEMD_CRYPTSETUP_PATH=\"$(rootlibexecdir)/systemd-cryptsetup\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-hibernate-resume/Makefile b/src/systemd-hibernate-resume/Makefile
index 386f372f78..5a8a0b4ad1 100644
--- a/src/systemd-hibernate-resume/Makefile
+++ b/src/systemd-hibernate-resume/Makefile
@@ -57,4 +57,6 @@ EXTRA_DIST += \
units/systemd-hibernate-resume@.service.in \
units/systemd-hybrid-sleep.service.in
+systemd.CPPFLAGS += -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-hwdb/Makefile b/src/systemd-hwdb/Makefile
index ce10c46e99..7c64c801ca 100644
--- a/src/systemd-hwdb/Makefile
+++ b/src/systemd-hwdb/Makefile
@@ -73,4 +73,7 @@ EXTRA_DIST += \
hwdb/ids-update.pl \
hwdb/sdio.ids
+systemd.CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-internal/sd-hwdb
+systemd.CPPFLAGS += -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-initctl/Makefile b/src/systemd-initctl/Makefile
index bd19b4a090..ae4151a081 100644
--- a/src/systemd-initctl/Makefile
+++ b/src/systemd-initctl/Makefile
@@ -30,4 +30,6 @@ systemd_initctl_SOURCES = \
systemd_initctl_LDADD = \
libshared.la
+systemd.CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-internal/sd-bus
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-nspawn/Makefile b/src/systemd-nspawn/Makefile
index d6f928ebd6..5d6fcfdc5a 100644
--- a/src/systemd-nspawn/Makefile
+++ b/src/systemd-nspawn/Makefile
@@ -82,4 +82,7 @@ test_patch_uid_LDADD = \
manual_tests += \
test-patch-uid
+systemd.CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-internal/sd-bus
+systemd.CPPFLAGS += -I$(topsrcdir)/src/libudev/src
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-nspawn/loopback-setup.c b/src/systemd-nspawn/loopback-setup.c
new file mode 120000
index 0000000000..1078ace0bf
--- /dev/null
+++ b/src/systemd-nspawn/loopback-setup.c
@@ -0,0 +1 @@
+../libcore/loopback-setup.c \ No newline at end of file
diff --git a/src/systemd-nspawn/loopback-setup.h b/src/systemd-nspawn/loopback-setup.h
new file mode 120000
index 0000000000..18fc7663a2
--- /dev/null
+++ b/src/systemd-nspawn/loopback-setup.h
@@ -0,0 +1 @@
+../libcore/loopback-setup.h \ No newline at end of file
diff --git a/src/systemd-nspawn/machine-id-setup.c b/src/systemd-nspawn/machine-id-setup.c
new file mode 120000
index 0000000000..2f0f2d8cf1
--- /dev/null
+++ b/src/systemd-nspawn/machine-id-setup.c
@@ -0,0 +1 @@
+../libcore/machine-id-setup.c \ No newline at end of file
diff --git a/src/systemd-nspawn/machine-id-setup.h b/src/systemd-nspawn/machine-id-setup.h
new file mode 120000
index 0000000000..6b34cb74f4
--- /dev/null
+++ b/src/systemd-nspawn/machine-id-setup.h
@@ -0,0 +1 @@
+../libcore/machine-id-setup.h \ No newline at end of file
diff --git a/src/systemd-nspawn/mount-setup.c b/src/systemd-nspawn/mount-setup.c
new file mode 120000
index 0000000000..a4ab487157
--- /dev/null
+++ b/src/systemd-nspawn/mount-setup.c
@@ -0,0 +1 @@
+../libcore/mount-setup.c \ No newline at end of file
diff --git a/src/systemd-nspawn/mount-setup.h b/src/systemd-nspawn/mount-setup.h
new file mode 120000
index 0000000000..1f984851f8
--- /dev/null
+++ b/src/systemd-nspawn/mount-setup.h
@@ -0,0 +1 @@
+../libcore/mount-setup.h \ No newline at end of file
diff --git a/src/systemd-nspawn/nspawn-expose-ports.c b/src/systemd-nspawn/nspawn-expose-ports.c
index 8122a14f7b..71eb88873c 100644
--- a/src/systemd-nspawn/nspawn-expose-ports.c
+++ b/src/systemd-nspawn/nspawn-expose-ports.c
@@ -24,7 +24,6 @@
#include "firewall-util.h"
#include "in-addr-util.h"
#include "local-addresses.h"
-#include "netlink-util.h"
#include "nspawn-expose-ports.h"
#include "parse-util.h"
#include "socket-util.h"
diff --git a/src/systemd-nspawn/nspawn-network.c b/src/systemd-nspawn/nspawn-network.c
index 7052fb5804..917827eac1 100644
--- a/src/systemd-nspawn/nspawn-network.c
+++ b/src/systemd-nspawn/nspawn-network.c
@@ -27,7 +27,6 @@
#include "alloc-util.h"
#include "ether-addr-util.h"
#include "lockfile-util.h"
-#include "netlink-util.h"
#include "nspawn-network.h"
#include "siphash24.h"
#include "socket-util.h"
diff --git a/src/systemd-nspawn/nspawn-register.c b/src/systemd-nspawn/nspawn-register.c
index adef200cb5..08cbff9731 100644
--- a/src/systemd-nspawn/nspawn-register.c
+++ b/src/systemd-nspawn/nspawn-register.c
@@ -19,7 +19,7 @@
#include <systemd/sd-bus.h>
-#include "bus-error.h"
+#include "bus-error.h" /* for bus_error_message */
#include "bus-unit-util.h"
#include "bus-util.h"
#include "nspawn-register.h"
diff --git a/src/systemd-nspawn/nspawn.c b/src/systemd-nspawn/nspawn.c
index bdf054e5c6..6390197646 100644
--- a/src/systemd-nspawn/nspawn.c
+++ b/src/systemd-nspawn/nspawn.c
@@ -72,7 +72,6 @@
#include "missing.h"
#include "mkdir.h"
#include "mount-util.h"
-#include "netlink-util.h"
#include "nspawn-cgroup.h"
#include "nspawn-expose-ports.h"
#include "nspawn-mount.h"
diff --git a/src/systemd-quotacheck/Makefile b/src/systemd-quotacheck/Makefile
index ca09dc0263..2136c1351e 100644
--- a/src/systemd-quotacheck/Makefile
+++ b/src/systemd-quotacheck/Makefile
@@ -43,4 +43,6 @@ EXTRA_DIST += \
nodist_systemunit_DATA += \
units/quotaon.service
+systemd.CPPFLAGS += -DQUOTACHECK=\"$(QUOTACHECK)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-random-seed/Makefile b/src/systemd-random-seed/Makefile
index 4edf2a1609..2df6252927 100644
--- a/src/systemd-random-seed/Makefile
+++ b/src/systemd-random-seed/Makefile
@@ -44,4 +44,7 @@ endif # ENABLE_RANDOMSEED
EXTRA_DIST += \
units/systemd-random-seed.service.in
+systemd.CPPFLAGS += -DRANDOM_SEED_DIR=\"$(localstatedir)/lib/systemd/\"
+systemd.CPPFLAGS += -DRANDOM_SEED=\"$(localstatedir)/lib/systemd/random-seed\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-remount-fs/Makefile b/src/systemd-remount-fs/Makefile
index 49b10a879a..29d110625a 100644
--- a/src/systemd-remount-fs/Makefile
+++ b/src/systemd-remount-fs/Makefile
@@ -32,4 +32,7 @@ systemd_remount_fs_SOURCES = \
systemd_remount_fs_LDADD = \
libshared.la
+systemd.CPPFLAGS += -DMOUNT_PATH=\"$(MOUNT_PATH)\"
+systemd.CPPFLAGS += -DUMOUNT_PATH=\"$(UMOUNT_PATH)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-remount-fs/mount-setup.c b/src/systemd-remount-fs/mount-setup.c
new file mode 120000
index 0000000000..a4ab487157
--- /dev/null
+++ b/src/systemd-remount-fs/mount-setup.c
@@ -0,0 +1 @@
+../libcore/mount-setup.c \ No newline at end of file
diff --git a/src/systemd-remount-fs/mount-setup.h b/src/systemd-remount-fs/mount-setup.h
new file mode 120000
index 0000000000..1f984851f8
--- /dev/null
+++ b/src/systemd-remount-fs/mount-setup.h
@@ -0,0 +1 @@
+../libcore/mount-setup.h \ No newline at end of file
diff --git a/src/systemd-shutdown/Makefile b/src/systemd-shutdown/Makefile
index 72047133ce..1017422b75 100644
--- a/src/systemd-shutdown/Makefile
+++ b/src/systemd-shutdown/Makefile
@@ -36,4 +36,7 @@ systemd_shutdown_SOURCES = \
systemd_shutdown_LDADD = \
libshared.la
+systemd.CPPFLAGS += -DSYSTEM_SHUTDOWN_PATH=\"$(systemshutdowndir)\"
+systemd.CPPFLAGS += -DKEXEC=\"$(KEXEC)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-shutdown/killall.c b/src/systemd-shutdown/killall.c
new file mode 120000
index 0000000000..5ddb36306b
--- /dev/null
+++ b/src/systemd-shutdown/killall.c
@@ -0,0 +1 @@
+../libcore/killall.c \ No newline at end of file
diff --git a/src/systemd-shutdown/killall.h b/src/systemd-shutdown/killall.h
new file mode 120000
index 0000000000..60b334fe91
--- /dev/null
+++ b/src/systemd-shutdown/killall.h
@@ -0,0 +1 @@
+../libcore/killall.h \ No newline at end of file
diff --git a/src/systemd-shutdown/mount-setup.c b/src/systemd-shutdown/mount-setup.c
new file mode 120000
index 0000000000..a4ab487157
--- /dev/null
+++ b/src/systemd-shutdown/mount-setup.c
@@ -0,0 +1 @@
+../libcore/mount-setup.c \ No newline at end of file
diff --git a/src/systemd-shutdown/mount-setup.h b/src/systemd-shutdown/mount-setup.h
new file mode 120000
index 0000000000..1f984851f8
--- /dev/null
+++ b/src/systemd-shutdown/mount-setup.h
@@ -0,0 +1 @@
+../libcore/mount-setup.h \ No newline at end of file
diff --git a/src/systemd-sleep/Makefile b/src/systemd-sleep/Makefile
index 4de8d81e72..cfb1a8337a 100644
--- a/src/systemd-sleep/Makefile
+++ b/src/systemd-sleep/Makefile
@@ -30,4 +30,6 @@ systemd_sleep_SOURCES = \
systemd_sleep_LDADD = \
libshared.la
+systemd.CPPFLAGS += -DSYSTEM_SLEEP_PATH=\"$(systemsleepdir)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-system-update-generator/Makefile b/src/systemd-system-update-generator/Makefile
index fd44aef359..535f072fa8 100644
--- a/src/systemd-system-update-generator/Makefile
+++ b/src/systemd-system-update-generator/Makefile
@@ -30,4 +30,6 @@ systemd_system_update_generator_SOURCES = \
systemd_system_update_generator_LDADD = \
libshared.la
+systemd.CPPFLAGS += -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-timesyncd/Makefile b/src/systemd-timesyncd/Makefile
index c9289846c4..ad037c3625 100644
--- a/src/systemd-timesyncd/Makefile
+++ b/src/systemd-timesyncd/Makefile
@@ -61,4 +61,7 @@ EXTRA_DIST += \
units/systemd-timesyncd.service.in \
src/timesync/timesyncd.conf.in
+systemd.CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-internal/sd-network
+systemd.CPPFLAGS += -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk