summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build-aux/Makefile.each.head/00-am.mk5
-rw-r--r--build-aux/Makefile.each.head/00-dist.mk5
-rw-r--r--build-aux/Makefile.each.head/00-files.mk29
-rw-r--r--build-aux/Makefile.each.head/00-nested.mk16
-rw-r--r--build-aux/Makefile.each.head/00-sd.mk1
-rw-r--r--build-aux/Makefile.each.head/zz-mod.mk1
-rw-r--r--build-aux/Makefile.each.tail/10-files.mk55
-rw-r--r--build-aux/Makefile.each.tail/10-nested.mk19
-rw-r--r--build-aux/Makefile.each.tail/10-std.mk46
-rw-r--r--build-aux/Makefile.each.tail/20-systemd.mk99
-rw-r--r--build-aux/Makefile.each.tail/30-automake2autothing.mk36
-rw-r--r--build-aux/Makefile.each.tail/30-directory-info.mk4
-rw-r--r--build-aux/Makefile.each.tail/50-sd.mk85
-rw-r--r--build-aux/Makefile.each.tail/60-am.mk64
-rw-r--r--build-aux/Makefile.head.mk101
-rw-r--r--build-aux/Makefile.once.head/00-write-ifchanged.mk1
-rw-r--r--build-aux/Makefile.once.head/10-dist.mk (renamed from build-aux/Makefile.once.head/00-dist.mk)10
-rw-r--r--build-aux/Makefile.once.head/10-files.mk (renamed from build-aux/Makefile.once.head/10-std.mk)26
-rw-r--r--build-aux/Makefile.once.head/10-gnuconf.mk (renamed from build-aux/Makefile.once.head/00-gnuconf.mk)56
-rw-r--r--build-aux/Makefile.once.head/10-lt.mk12
-rw-r--r--build-aux/Makefile.once.head/10-nested.mk18
-rw-r--r--build-aux/Makefile.once.head/10-write-ifchanged.mk3
-rw-r--r--build-aux/Makefile.once.head/20-sd.mk217
-rw-r--r--build-aux/Makefile.once.head/20-systemd.mk220
-rw-r--r--build-aux/Makefile.once.head/30-am.mk28
-rw-r--r--build-aux/Makefile.once.head/30-automake2autothing.mk11
-rw-r--r--build-aux/Makefile.once.head/zz-mod.mk24
-rw-r--r--build-aux/Makefile.once.tail/00-dist.mk12
-rw-r--r--build-aux/Makefile.once.tail/00-mod.mk32
-rw-r--r--build-aux/Makefile.once.tail/00-noop.mk2
-rw-r--r--build-aux/Makefile.once.tail/10-sd.mk (renamed from build-aux/Makefile.once.tail/20-systemd.mk)36
-rw-r--r--build-aux/Makefile.tail.mk40
-rw-r--r--build-aux/no-builtin-variables.mk15
-rw-r--r--config.mk.in2
-rw-r--r--f.org44
-rw-r--r--src/busctl/busctl.completion.bash (renamed from shell-completion/bash/busctl)0
-rw-r--r--src/busctl/busctl.completion.zsh (renamed from shell-completion/zsh/_busctl)0
-rw-r--r--src/grp-boot/bootctl/bootctl.completion.bash (renamed from shell-completion/bash/bootctl)0
-rw-r--r--src/grp-boot/bootctl/bootctl.completion.zsh (renamed from shell-completion/zsh/_bootctl)0
-rw-r--r--src/grp-boot/kernel-install/kernel-install.completion.bash (renamed from src/grp-boot/kernel-install/bash-completion_kernel-install)0
-rw-r--r--src/grp-boot/kernel-install/kernel-install.completion.zsh (renamed from src/grp-boot/kernel-install/zsh-completion_kernel-install)0
-rw-r--r--src/grp-coredump/coredumpctl/coredumpctl.completion.bash (renamed from shell-completion/bash/coredumpctl)0
-rw-r--r--src/grp-coredump/coredumpctl/coredumpctl.completion.zsh (renamed from shell-completion/zsh/_coredumpctl)0
-rw-r--r--src/grp-coredump/systemd-coredump/.gitignore1
-rw-r--r--src/grp-coredump/systemd-coredump/50-coredump.sysctl.in (renamed from sysctl.d/50-coredump.conf.in)0
-rw-r--r--src/grp-coredump/systemd-coredump/systemd-coredump.sysusers8
-rw-r--r--src/grp-initutils/systemd-detect-virt/systemd-detect-virt.completion.bash (renamed from shell-completion/bash/systemd-detect-virt)0
-rw-r--r--src/grp-initutils/systemd-sysctl/50-default.sysctl (renamed from sysctl.d/50-default.conf)0
-rw-r--r--src/grp-initutils/systemd-sysusers/basic.sysusers.in (renamed from sysusers.d/basic.conf.in)0
-rw-r--r--src/grp-initutils/systemd-tmpfiles/systemd-tmpfiles.completion.zsh (renamed from shell-completion/zsh/_systemd-tmpfiles)0
-rw-r--r--src/grp-journal/grp-remote/systemd-remote.sysusers.m4 (renamed from sysusers.d/systemd-remote.conf.m4)0
-rw-r--r--src/grp-journal/journalctl/journalctl.completion.bash (renamed from shell-completion/bash/journalctl)0
-rw-r--r--src/grp-journal/journalctl/journalctl.completion.zsh (renamed from shell-completion/zsh/_journalctl)0
-rw-r--r--src/grp-journal/systemd-cat/systemd-cat.completion.bash (renamed from shell-completion/bash/systemd-cat)0
-rw-r--r--src/grp-journal/systemd-journald/systemd-journald.sysusers8
-rw-r--r--src/grp-journal/var-log/.gitignore (renamed from docs/sysvinit/.gitignore)0
-rw-r--r--src/grp-journal/var-log/README.in (renamed from docs/var-log/README.in)0
-rw-r--r--src/grp-login/loginctl/loginctl.completion.bash (renamed from shell-completion/bash/loginctl)0
-rw-r--r--src/grp-login/loginctl/loginctl.completion.zsh (renamed from shell-completion/zsh/_loginctl)0
-rw-r--r--src/grp-login/systemd-inhibit/systemd-inhibit.completion.zsh (renamed from shell-completion/zsh/_systemd-inhibit)0
-rw-r--r--src/grp-machine/machinectl/machinectl.completion.bash (renamed from shell-completion/bash/machinectl)0
-rw-r--r--src/grp-machine/machinectl/machinectl.completion.zsh (renamed from shell-completion/zsh/_machinectl)0
-rw-r--r--src/grp-network/network/80-container-host0.network (renamed from network/80-container-host0.network)0
-rw-r--r--src/grp-network/network/80-container-ve.network (renamed from network/80-container-ve.network)0
-rw-r--r--src/grp-network/network/80-container-vz.network (renamed from network/80-container-vz.network)0
-rw-r--r--src/grp-network/network/99-default.link (renamed from network/99-default.link)0
-rw-r--r--src/grp-network/networkctl/networkctl.completion.bash (renamed from shell-completion/bash/networkctl)0
-rw-r--r--src/grp-network/networkctl/networkctl.completion.zsh (renamed from shell-completion/zsh/_networkctl)0
-rw-r--r--src/grp-network/systemd-networkd/systemd-networkd.sysusers8
-rw-r--r--src/grp-resolve/systemd-resolved/systemd-resolved.sysusers8
-rw-r--r--src/grp-system/grp-utils/systemd-analyze/systemd-analyze.completion.bash (renamed from shell-completion/bash/systemd-analyze)0
-rw-r--r--src/grp-system/grp-utils/systemd-analyze/systemd-analyze.completion.zsh (renamed from shell-completion/zsh/_systemd-analyze)0
-rw-r--r--src/grp-system/grp-utils/systemd-delta/systemd-delta.completion.bash (renamed from shell-completion/bash/systemd-delta)0
-rw-r--r--src/grp-system/grp-utils/systemd-delta/systemd-delta.completion.zsh (renamed from shell-completion/zsh/_systemd-delta)0
-rw-r--r--src/grp-system/grp-utils/systemd-run/systemd-run.completion.bash (renamed from shell-completion/bash/systemd-run)0
-rw-r--r--src/grp-system/grp-utils/systemd-run/systemd-run.completion.zsh (renamed from shell-completion/zsh/_systemd-run)0
-rw-r--r--src/grp-system/system-preset/90-systemd.preset (renamed from system-preset/90-systemd.preset)0
-rwxr-xr-xsrc/grp-system/systemd/50-systemd-user.xorg (renamed from xorg/50-systemd-user.sh)0
-rw-r--r--src/grp-system/sysvinit/.gitignore (renamed from docs/var-log/.gitignore)0
-rw-r--r--src/grp-system/sysvinit/README.in (renamed from docs/sysvinit/README.in)0
-rw-r--r--src/grp-timedate/timedatectl/timedatectl.completion.bash (renamed from shell-completion/bash/timedatectl)0
-rw-r--r--src/grp-timedate/timedatectl/timedatectl.completion.zsh (renamed from shell-completion/zsh/_timedatectl)0
-rw-r--r--src/grp-udev/hwdb/.gitignore (renamed from hwdb/.gitignore)0
-rw-r--r--src/grp-udev/hwdb/20-OUI.hwdb (renamed from hwdb/20-OUI.hwdb)0
-rw-r--r--src/grp-udev/hwdb/20-acpi-vendor.hwdb (renamed from hwdb/20-acpi-vendor.hwdb)0
-rw-r--r--src/grp-udev/hwdb/20-bluetooth-vendor-product.hwdb (renamed from hwdb/20-bluetooth-vendor-product.hwdb)0
-rw-r--r--src/grp-udev/hwdb/20-net-ifname.hwdb (renamed from hwdb/20-net-ifname.hwdb)0
-rw-r--r--src/grp-udev/hwdb/20-pci-classes.hwdb (renamed from hwdb/20-pci-classes.hwdb)0
-rw-r--r--src/grp-udev/hwdb/20-pci-vendor-model.hwdb (renamed from hwdb/20-pci-vendor-model.hwdb)0
-rw-r--r--src/grp-udev/hwdb/20-sdio-classes.hwdb (renamed from hwdb/20-sdio-classes.hwdb)0
-rw-r--r--src/grp-udev/hwdb/20-sdio-vendor-model.hwdb (renamed from hwdb/20-sdio-vendor-model.hwdb)0
-rw-r--r--src/grp-udev/hwdb/20-usb-classes.hwdb (renamed from hwdb/20-usb-classes.hwdb)0
-rw-r--r--src/grp-udev/hwdb/20-usb-vendor-model.hwdb (renamed from hwdb/20-usb-vendor-model.hwdb)0
-rw-r--r--src/grp-udev/hwdb/60-evdev.hwdb (renamed from hwdb/60-evdev.hwdb)0
-rw-r--r--src/grp-udev/hwdb/60-keyboard.hwdb (renamed from hwdb/60-keyboard.hwdb)0
-rw-r--r--src/grp-udev/hwdb/70-mouse.hwdb (renamed from hwdb/70-mouse.hwdb)0
-rw-r--r--src/grp-udev/hwdb/70-pointingstick.hwdb (renamed from hwdb/70-pointingstick.hwdb)0
-rw-r--r--src/grp-udev/hwdb/Makefile (renamed from hwdb/Makefile)0
-rwxr-xr-xsrc/grp-udev/hwdb/ids-update.pl (renamed from hwdb/ids-update.pl)0
-rw-r--r--src/grp-udev/hwdb/sdio.ids (renamed from hwdb/sdio.ids)0
-rw-r--r--src/grp-udev/rules/.gitignore (renamed from rules/.gitignore)0
-rw-r--r--src/grp-udev/rules/50-udev-default.rules (renamed from rules/50-udev-default.rules)0
-rw-r--r--src/grp-udev/rules/60-block.rules (renamed from rules/60-block.rules)0
-rw-r--r--src/grp-udev/rules/60-cdrom_id.rules (renamed from rules/60-cdrom_id.rules)0
-rw-r--r--src/grp-udev/rules/60-drm.rules (renamed from rules/60-drm.rules)0
-rw-r--r--src/grp-udev/rules/60-evdev.rules (renamed from rules/60-evdev.rules)0
-rw-r--r--src/grp-udev/rules/60-persistent-alsa.rules (renamed from rules/60-persistent-alsa.rules)0
-rw-r--r--src/grp-udev/rules/60-persistent-input.rules (renamed from rules/60-persistent-input.rules)0
-rw-r--r--src/grp-udev/rules/60-persistent-storage-tape.rules (renamed from rules/60-persistent-storage-tape.rules)0
-rw-r--r--src/grp-udev/rules/60-persistent-storage.rules (renamed from rules/60-persistent-storage.rules)0
-rw-r--r--src/grp-udev/rules/60-persistent-v4l.rules (renamed from rules/60-persistent-v4l.rules)0
-rw-r--r--src/grp-udev/rules/60-serial.rules (renamed from rules/60-serial.rules)0
-rw-r--r--src/grp-udev/rules/64-btrfs.rules (renamed from rules/64-btrfs.rules)0
-rw-r--r--src/grp-udev/rules/70-mouse.rules (renamed from rules/70-mouse.rules)0
-rw-r--r--src/grp-udev/rules/75-net-description.rules (renamed from rules/75-net-description.rules)0
-rw-r--r--src/grp-udev/rules/75-probe_mtd.rules (renamed from rules/75-probe_mtd.rules)0
-rw-r--r--src/grp-udev/rules/78-sound-card.rules (renamed from rules/78-sound-card.rules)0
-rw-r--r--src/grp-udev/rules/80-drivers.rules (renamed from rules/80-drivers.rules)0
-rw-r--r--src/grp-udev/rules/80-net-setup-link.rules (renamed from rules/80-net-setup-link.rules)0
-rw-r--r--src/grp-udev/rules/99-systemd.rules.in (renamed from rules/99-systemd.rules.in)0
-rw-r--r--src/grp-udev/udevadm/udevadm.completion.bash (renamed from shell-completion/bash/udevadm)0
-rw-r--r--src/grp-udev/udevadm/udevadm.completion.zsh (renamed from shell-completion/zsh/_udevadm)0
-rw-r--r--src/grp-utils/systemd-path/systemd-path.completion.bash (renamed from shell-completion/bash/systemd-path)0
-rw-r--r--src/systemd-cgls/systemd-cgls.completion.bash (renamed from shell-completion/bash/systemd-cgls)0
-rw-r--r--src/systemd-cgtop/systemd-cgtop.completion.bash (renamed from shell-completion/bash/systemd-cgtop)0
-rw-r--r--src/systemd-nspawn/systemd-nspawn.completion.bash (renamed from shell-completion/bash/systemd-nspawn)0
-rw-r--r--src/systemd-nspawn/systemd-nspawn.completion.zsh (renamed from shell-completion/zsh/_systemd-nspawn)0
-rw-r--r--src/systemd-timesyncd/systemd-timesyncd.sysusers (renamed from sysusers.d/systemd.conf.m4)12
-rw-r--r--sysctl.d/.gitignore1
-rw-r--r--sysusers.d/.gitignore3
-rwxr-xr-xtools/find_includes (renamed from find_includes)0
-rwxr-xr-xtools/fixup.sh (renamed from fixup.sh)0
-rwxr-xr-xtools/fixup_includes (renamed from fixup_includes)0
-rwxr-xr-xtools/move.sh (renamed from move.sh)0
-rwxr-xr-xtools/reset.sh (renamed from reset.sh)0
-rw-r--r--tools/test-header.c (renamed from test-header.c)0
-rwxr-xr-xtools/test-header.sh (renamed from test-header.sh)0
137 files changed, 861 insertions, 563 deletions
diff --git a/build-aux/Makefile.each.head/00-am.mk b/build-aux/Makefile.each.head/00-am.mk
new file mode 100644
index 0000000000..f8c20b7706
--- /dev/null
+++ b/build-aux/Makefile.each.head/00-am.mk
@@ -0,0 +1,5 @@
+$(foreach v,$(foreach p,$(am.primaries),am.inst_$p am.noinst_$p am.check_$p),\
+ $(eval $v ?=))
+am.CFLAGS ?=
+am.CPPFLAGS ?=
+am.subdirs ?=
diff --git a/build-aux/Makefile.each.head/00-dist.mk b/build-aux/Makefile.each.head/00-dist.mk
index a0943059ba..924d79aa7c 100644
--- a/build-aux/Makefile.each.head/00-dist.mk
+++ b/build-aux/Makefile.each.head/00-dist.mk
@@ -13,8 +13,11 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+mod.dist.depends += files
+
ifeq ($(outdir),$(topoutdir))
-std.clean_files += $(addprefix $(dist.pkgname)-*,$(dist.exts) .tar /)
+files.out.int += $(addprefix $(dist.pkgname)-*,$(dist.exts) .tar /) .tmp.$(dist.pkgname)-*/
endif
$(outdir)/dist: $(addprefix $(topoutdir)/$(dist.pkgname)-$(dist.version),$(dist.exts))
+.PHONY: $(outdir)/dist
diff --git a/build-aux/Makefile.each.head/00-files.mk b/build-aux/Makefile.each.head/00-files.mk
new file mode 100644
index 0000000000..7bf323e0c7
--- /dev/null
+++ b/build-aux/Makefile.each.head/00-files.mk
@@ -0,0 +1,29 @@
+# Copyright (C) 2015-2016 Luke Shumaker
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program 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 Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+files.src.src ?=
+files.src.int ?=
+files.src.cfg ?=
+files.src.gen ?=
+files.src = $(sort $(foreach _files.v,$(filter files.src.%,$(.VARIABLES)),$($(_files.v))))
+
+files.out.slow ?=
+files.out.int ?=
+files.out.cfg ?=
+$(foreach t,$(files.groups),$(eval files.out.$t ?=))
+files.out = $(sort $(foreach _files.v,$(filter files.out.%,$(.VARIABLES)),$($(_files.v))))
+
+$(foreach t,$(files.groups),$(eval files.sys.$t ?=))
+files.sys = $(sort $(foreach _files.v,$(filter files.sys.%,$(.VARIABLES)),$($(_files.v))))
diff --git a/build-aux/Makefile.each.head/00-nested.mk b/build-aux/Makefile.each.head/00-nested.mk
new file mode 100644
index 0000000000..4325825353
--- /dev/null
+++ b/build-aux/Makefile.each.head/00-nested.mk
@@ -0,0 +1,16 @@
+# Copyright (C) 2016 Luke Shumaker
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program 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 Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+nested.subdirs ?=
diff --git a/build-aux/Makefile.each.head/00-sd.mk b/build-aux/Makefile.each.head/00-sd.mk
new file mode 100644
index 0000000000..0dccebc138
--- /dev/null
+++ b/build-aux/Makefile.each.head/00-sd.mk
@@ -0,0 +1 @@
+sd.sed_files ?=
diff --git a/build-aux/Makefile.each.head/zz-mod.mk b/build-aux/Makefile.each.head/zz-mod.mk
new file mode 100644
index 0000000000..b83c2235a2
--- /dev/null
+++ b/build-aux/Makefile.each.head/zz-mod.mk
@@ -0,0 +1 @@
+_mod.each := $(sort $(_mod.each) $(filter-out $(_mod.once),$(_mod.vars)))
diff --git a/build-aux/Makefile.each.tail/10-files.mk b/build-aux/Makefile.each.tail/10-files.mk
new file mode 100644
index 0000000000..4607c433d0
--- /dev/null
+++ b/build-aux/Makefile.each.tail/10-files.mk
@@ -0,0 +1,55 @@
+# Copyright (C) 2015-2016 Luke Shumaker
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program 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 Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# Add some more defaults to the *_files variables
+
+$(foreach _files.var,$(patsubst files.%,%,files.src $(filter files.src.%,$(.VARIABLES))),\
+ $(eval _files.$(_files.var) = $$(call at.addprefix,$$(srcdir),$$(files.$(_files.var)))))
+$(foreach _files.var,$(patsubst files.%,%,files.out $(filter files.out.%,$(.VARIABLES))),\
+ $(eval _files.$(_files.var) = $$(call at.addprefix,$$(outdir),$$(files.$(_files.var)))))
+$(foreach _files.var,$(patsubst files.%,%,files.sys $(filter files.sys.%,$(.VARIABLES))),\
+ $(eval _files.$(_files.var) = $$(addprefix $$(DESTDIR),$$(files.$(_files.var)))))
+
+_files.all = $(_files.src) $(_files.out) $(_files.sys)
+
+at.targets += $(subst *,%,$(_files.all))
+
+# Creative targets
+$(outdir)/$(files.generate): $(_files.src.gen) $(_files.src.cfg)
+$(outdir)/install: $(_files.sys.$(files.default))
+$(outdir)/installdirs: $(sort $(dir $(_files.sys)))
+$(foreach _files.g,$(files.groups),\
+ $(eval $$(outdir)/$(_files.g): $$(_files.out.$(_files.g))))
+$(foreach _files.g,$(filter-out $(files.default),$(files.groups)),\
+ $(eval $$(outdir)/install-$(_files.g): $$(_files.sys.$(_files.g))))
+
+# Destructive targets
+_files.uninstall = $(_files.sys)
+_files.mostlyclean = $(filter-out $(_files.out.slow) $(_files.out.cfg),$(_files.out))
+_files.clean = $(filter-out $(_files.out.cfg),$(_files.out))
+_files.distclean = $(_files.out)
+$(addprefix $(outdir)/,uninstall mostlyclean clean distclean): %: %-hook
+ $(RM) -- $(sort $(filter-out %/,$(_files.$(@F))))
+ $(RM) -r -- $(sort $(filter %/,$(_files.$(@F))))
+ $(RMDIR_P) -- $(sort $(dir $(_files.$(@F))))
+_files.maintainer-clean = $(filter-out $(_files.src.cfg) $(_files.src.src),$(_files.src))
+_files.$(files.vcsclean) = $(filter-out $(_files.src.src),$(_files.src))
+$(addprefix $(outdir)/,maintainer-clean $(files.vcsclean)): $(outdir)/%: $(outdir)/distclean $(outdir)/%-hook
+ @echo 'This command is intended for maintainers to use; it'
+ @echo 'deletes files that may need special tools to rebuild.'
+ $(RM) -- $(sort $(filter-out %/,$(_files.$(@F))))
+ $(RM) -r -- $(sort $(filter %/,$(_files.$(@F))))
+ $(RMDIR_P) -- $(sort $(dir $(_files.$(@F))))
+$(foreach t,uninstall mostlyclean clean distclean maintainer-clean $(files.vcsclean), $(outdir)/$t-hook)::
+.PHONY: $(foreach t,uninstall mostlyclean clean distclean maintainer-clean $(files.vcsclean), $(outdir)/$t-hook)
diff --git a/build-aux/Makefile.each.tail/10-nested.mk b/build-aux/Makefile.each.tail/10-nested.mk
new file mode 100644
index 0000000000..e9d02ca5b0
--- /dev/null
+++ b/build-aux/Makefile.each.tail/10-nested.mk
@@ -0,0 +1,19 @@
+# Copyright (C) 2016 Luke Shumaker
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program 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 Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+$(addprefix $(outdir)/,$(nested.targets)): $(outdir)/%: $(addsuffix /%,$(call at.addprefix,$(outdir),$(nested.subdirs)))
+.PHONY: $(addprefix $(outdir)/,$(nested.targets))
+
+at.subdirs += $(nested.subdirs)
diff --git a/build-aux/Makefile.each.tail/10-std.mk b/build-aux/Makefile.each.tail/10-std.mk
deleted file mode 100644
index ca78f3cf8c..0000000000
--- a/build-aux/Makefile.each.tail/10-std.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright (C) 2015-2016 Luke Shumaker
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program 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 Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Add some more defaults to the *_files variables
-std.clean_files += $(std.gen_files) $(std.cfg_files) $(std.out_files)
-
-# Fix each variable at its current value to avoid any weirdness
-$(foreach c,src gen cfg out sys clean slow,$(eval std.$c_files := $$(std.$c_files)))
-
-# Make each of the standard variables relative to the correct directory
-std.src_files := $(call at.addprefix,$(srcdir)/,$(std.src_files))
-std.gen_files := $(call at.addprefix,$(srcdir)/,$(std.gen_files))
-std.cfg_files := $(call at.addprefix,$(outdir)/,$(std.cfg_files))
-std.out_files := $(call at.addprefix,$(outdir)/,$(std.out_files))
-std.sys_files := $(addprefix $(DESTDIR),$(std.sys_files))
-std.clean_files := $(call at.addprefix,$(outdir)/,$(std.clean_files))
-std.slow_files := $(call at.addprefix,$(outdir)/,$(std.slow_files))
-
-# Creative targets
-$(outdir)/build : $(std.out_files)
-$(outdir)/install : $(std.sys_files)
-$(outdir)/installdirs: $(sort $(dir $(std.sys_files)))
-
-# Destructive targets
-_std.uninstall/$(outdir) := $(std.sys_files)
-_std.mostlyclean/$(outdir) := $(filter-out $(std.slow_files) $(std.cfg_files) $(std.gen_files) $(std.src_files),$(std.clean_files))
-_std.clean/$(outdir) := $(filter-out $(std.cfg_files) $(std.gen_files) $(std.src_files),$(std.clean_files))
-_std.distclean/$(outdir) := $(filter-out $(std.gen_files) $(std.src_files),$(std.clean_files))
-_std.maintainer-clean/$(outdir) := $(filter-out $(std.src_files),$(std.clean_files))
-$(addprefix $(outdir)/,uninstall mostlyclean clean distclean maintainer-clean): %: %-hook
- $(RM) -- $(sort $(filter-out %/,$(_std.$(@F)/$(@D))))
- $(RM) -r -- $(sort $(filter %/,$(_std.$(@F)/$(@D))))
- $(RMDIR_P) $(sort $(dir $(_std.$(@F)/$(@D)))) 2>/dev/null || $(TRUE)
-$(foreach t,uninstall mostlyclean clean distclean maintainer-clean, $(outdir)/$t-hook)::
-.PHONY: $(foreach t,uninstall mostlyclean clean distclean maintainer-clean, $(outdir)/$t-hook)
diff --git a/build-aux/Makefile.each.tail/20-systemd.mk b/build-aux/Makefile.each.tail/20-systemd.mk
deleted file mode 100644
index 1a65c000e2..0000000000
--- a/build-aux/Makefile.each.tail/20-systemd.mk
+++ /dev/null
@@ -1,99 +0,0 @@
-# -*- 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 $(wildcard $(outdir)/$(DEPDIR)/*.P*)
-
-std.clean_files += *.o *.lo *.so .deps/ .libs/
-std.clean_files += *-list.txt
-std.clean_files += *-from-name.gperf
-std.clean_files += *-from-name.h
-std.clean_files += *-to-name.h
-std.clean_files += *-gperf.c
-
-$(outdir)/%.o : $(srcdir)/%.c $(topoutdir)/config.h | $(outdir)/.deps; $(AM_V_CC)$(COMPILE) -c -o $@ $<
-$(outdir)/%.o : $(outdir)/%.c $(topoutdir)/config.h | $(outdir)/.deps; $(AM_V_CC)$(COMPILE) -c -o $@ $<
-$(outdir)/%.lo: $(srcdir)/%.c $(topoutdir)/config.h | $(outdir)/.deps; $(AM_V_CC)$(LTCOMPILE) -c -o $@ $<
-$(outdir)/%.lo: $(outdir)/%.c $(topoutdir)/config.h | $(outdir)/.deps; $(AM_V_CC)$(LTCOMPILE) -c -o $@ $<
-
-$(outdir)/.deps:
- $(AM_V_at)$(MKDIR_P) $@
-
-_systemd.dups = $(sort $(foreach l,$1,$(if $(filter-out 1,$(words $(filter $l,$1))),$l)))
-_systemd.patsubst-all = $(if $1,$(call _systemd.patsubst-all,$(wordlist 2,$(words $1),$1),$2,$(patsubst $(firstword $1),$2,$3)),$3)
-_systemd.lt_libs = $(foreach l,$(filter %.la,$1), $l $(call _systemd.lt_libs,$($(notdir $l).DEPENDS)))
-_systemd.lt_filter = $(filter-out $(call _systemd.dups,$(call _systemd.lt_libs,$1)),$1)
-
-_systemd.rpath = $(dir $(patsubst $(DESTDIR)%,%,$(filter %/$(@F),$(std.sys_files/$(@D)))))
-_systemd.link_files = $(call _systemd.lt_filter,$(filter %.o %.lo %.la,$^)) $(call _systemd.patsubst-all,$(.LIBPATTERNS),-l%,$(filter $(.LIBPATTERNS),$(notdir $^)))
-$(outdir)/%.la:
- @if test $(words $^) = 0; then echo 'Cannot link library with no dependencies: $@' >&2; exit 1; fi
- $(AM_V_CCLD)$(LINK) $(if $(_systemd.rpath),-rpath $(_systemd.rpath)) $(_systemd.link_files)
-$(addprefix $(outdir)/,$(foreach d,$(am.bindirs),$($d_PROGRAMS))): $(outdir)/%:
- @if test $(words $^) = 0; then echo 'Cannot link executable with no dependencies: $@' >&2; exit 1; fi
- $(AM_V_CCLD)$(LINK) $(_systemd.link_files)
-
-_systemd.in_destdir = $(foreach f,$(std.sys_files),$(if $(filter $1,$(patsubst %/,%,$(dir $f))),$(DESTDIR)$f))
-
-define install_bindir
-$(call _systemd.in_destdir,$(bindir)): $(DESTDIR)$(bindir)/%: $(outdir)/%
- @$(NORMAL_INSTALL)
- $(AM_V_PROG)$(LIBTOOL) $(AM_V_lt) --tag=CC $(SYS_LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $< $@
-endef
-$(foreach bindir,$(sort $(foreach d,$(am.bindirs),$($ddir))),$(eval $(value install_bindir)))
-
-define install_libdir
-$(call _systemd.in_destdir,$(libdir)): $(DESTDIR)$(libdir)/%.la: $(outdir)/%.la
- @$(NORMAL_INSTALL)
- $(AM_V_LIB)$(LIBTOOL) $(AM_V_lt) --tag=CC $(SYS_LIBTOOLFLAGS) --mode=install $(INSTALL) $< $@
-endef
-$(foreach libdir,$(sort $(foreach d,lib rootlib,$($ddir))),$(eval $(value install_libdir)))
-
-define install_datadir
-$(call _systemd.in_destdir,$(datadir)): $(DESTDIR)$(datadir)/%: $(outdir)/%
- @$(NORMAL_INSTALL)
- $(AM_V_DATA)$(INSTALL_DATA) $< $@
-endef
-$(foreach datadir,$(sort $(foreach d,pkgconfigdata pkgconfiglib bootlib,$($ddir))),$(eval $(value install_datadir)))
-
-$(outdir)/%-from-name.gperf: $(outdir)/%-list.txt
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct $(notdir $*)_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' <$< >$@
-
-$(outdir)/%-from-name.h: $(outdir)/%-from-name.gperf
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_$(notdir $*) -H hash_$(notdir $*)_name -p -C <$< >$@
-
-$(addprefix $(outdir)/,$(systemd.sed_files)): $(outdir)/%: $(srcdir)/%.in
- $(SED_PROCESS)
-
-#$(outdir)/%.sh: $(srcdir)/%.sh.in
-# $(SED_PROCESS)
-# $(AM_V_GEN)chmod +x $@
-
-$(outdir)/%.c: $(srcdir)/%.gperf
- $(AM_V_GPERF)$(GPERF) < $< > $@
-$(outdir)/%.c: $(outdir)/%.gperf
- $(AM_V_GPERF)$(GPERF) < $< > $@
-
-$(outdir)/%: $(srcdir)/%.m4 $(top_builddir)/config.status
- $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
diff --git a/build-aux/Makefile.each.tail/30-automake2autothing.mk b/build-aux/Makefile.each.tail/30-automake2autothing.mk
deleted file mode 100644
index cd5cc4300d..0000000000
--- a/build-aux/Makefile.each.tail/30-automake2autothing.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-std.out_files += $(noinst_LTLIBRARIES) $(lib_LTLIBRARIES)
-std.sys_files += $(addprefix $(libdir)/,$(lib_LTLIBRARIES))
-
-_programs =
-$(foreach d,$(am.bindirs), \
- $(eval _programs += $($d_PROGRAMS) )\
- $(eval std.sys_files += $(addprefix $($(d)dir)/,$($d_PROGRAMS)) ))
-_programs += $(noinst_PROGRAMS)
-std.out_files += $(_programs)
-
-std.out_files += $(notdir $(pkgconfiglib_DATA))
-std.sys_files += $(addprefix $(pkgconfiglibdir)/,$(notdir $(pkgconfiglib_DATA)))
-
-$(foreach n,$(call automake_name,$(std.out_files)),\
- $(eval $n_SOURCES ?=)\
- $(eval nodist_$n_SOURCES ?=)\
- $(eval $n_CFLAGS ?=)\
- $(eval $n_CPPFLAGS ?=)\
- $(eval $n_LDFLAGS ?=)\
- $(eval $n_LIBADD ?=)\
- $(eval $n_LDADD ?=))
-$(foreach t,$(filter %.la,$(std.out_files)), \
- $(eval $t.DEPENDS += $(call at.path,$(call automake_lo,$t) $(call automake_lib,$t,LIBADD)) )\
- $(eval am.CPPFLAGS += $($(call automake_name,$t)_CPPFLAGS) $(call automake_cpp,$t,LIBADD) )\
- $(eval am.CFLAGS += $($(call automake_name,$t)_CFLAGS) )\
- $(eval $t: private ALL_LDFLAGS += $($(call automake_name,$t)_LDFLAGS) )\
- $(eval $(outdir)/$t: $($t.DEPENDS) )\
- $(eval at.depdirs += $(abspath $(sort $(dir $(filter-out -l% /%,$($t.DEPENDS))))) ))
-$(foreach t,$(_programs), \
- $(eval $t.DEPENDS += $(call at.path,$(call automake_o,$t) $(call automake_lib,$t,LDADD)) )\
- $(eval am.CPPFLAGS += $($(call automake_name,$t)_CPPFLAGS) $(call automake_cpp,$t,LDADD) )\
- $(eval am.CFLAGS += $($(call automake_name,$t)_CFLAGS) )\
- $(eval $t: private ALL_LDFLAGS += $($(call automake_name,$t)_LDFLAGS) )\
- $(eval $(outdir)/$t: $($t.DEPENDS) )\
- $(eval at.depdirs += $(sort $(filter-out $(abspath $(srcdir)), \
- $(abspath $(dir $(filter-out -l% /%,$($t.DEPENDS)))))) ))
diff --git a/build-aux/Makefile.each.tail/30-directory-info.mk b/build-aux/Makefile.each.tail/30-directory-info.mk
deleted file mode 100644
index 80f5e68c29..0000000000
--- a/build-aux/Makefile.each.tail/30-directory-info.mk
+++ /dev/null
@@ -1,4 +0,0 @@
-dir_variables = $(foreach v,$(filter-out _%,$(patsubst %/$(@D),%,$(filter %/$(@D),$(.VARIABLES)))),$(if $(findstring /,$v),, $v))
-$(outdir)/directory-info:
- $(AM_V_at)printf '%s = «%s»\n' $(foreach v,$(dir_variables),$(if $($v/$(@D)),'$v' '$($v/$(@D))')) | sort | column -s= -o= -t
-.PHONY: $(outdir)/module-info
diff --git a/build-aux/Makefile.each.tail/50-sd.mk b/build-aux/Makefile.each.tail/50-sd.mk
new file mode 100644
index 0000000000..832247ef72
--- /dev/null
+++ b/build-aux/Makefile.each.tail/50-sd.mk
@@ -0,0 +1,85 @@
+# -*- 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/>.
+
+mod.sd.depends += files am lt
+
+-include $(wildcard $(outdir)/$(DEPDIR)/*.P*)
+
+files.out.int += *.o *.lo *.so .deps/ .libs/
+files.out.int += *-list.txt
+files.out.int += *-from-name.gperf
+files.out.int += *-from-name.h
+files.out.int += *-to-name.h
+files.out.int += *-gperf.c
+
+$(outdir)/%.o : $(srcdir)/%.c $(topoutdir)/config.h | $(outdir)/$(DEPDIR); $(AM_V_CC)$(sd.COMPILE) -c -o $@ $<
+$(outdir)/%.o : $(outdir)/%.c $(topoutdir)/config.h | $(outdir)/$(DEPDIR); $(AM_V_CC)$(sd.COMPILE) -c -o $@ $<
+$(outdir)/%.lo: $(srcdir)/%.c $(topoutdir)/config.h | $(outdir)/$(DEPDIR); $(AM_V_CC)$(sd.LTCOMPILE) -c -o $@ $<
+$(outdir)/%.lo: $(outdir)/%.c $(topoutdir)/config.h | $(outdir)/$(DEPDIR); $(AM_V_CC)$(sd.LTCOMPILE) -c -o $@ $<
+
+$(outdir)/$(DEPDIR):
+ $(AM_V_at)$(MKDIR_P) $@
+
+$(outdir)/%.la:
+ @if test $(words $(lt.link_files)) = 0; then echo 'Cannot link library with no dependencies: $@' >&2; exit 1; fi
+ $(AM_V_CCLD)$(sd.LINK) $(if $(lt.rpath),-rpath $(lt.rpath)) $(lt.link_files)
+$(addprefix $(outdir)/,$(am.PROGRAMS)): $(outdir)/%:
+ @if test $(words $(lt.link_files)) = 0; then echo 'Cannot link executable with no dependencies: $@' >&2; exit 1; fi
+ $(AM_V_CCLD)$(sd.LINK) $(lt.link_files)
+
+# Stupid test that everything purported to be exported really is
+$(outdir)/test-lib%-sym.c: lib%.sym
+ $(AM_V_GEN){\
+ printf '#include <stdio.h>\n' && \
+ printf '#include "%s"\n' $(notdir $(filter %.h, $^)) && \
+ printf 'void* functions[] = {\n' && \
+ sed -r -n 's/^ +([a-zA-Z0-9_]+);/\1,/p' $< && \
+ printf '};\nint main(void) {\n' && \
+ printf 'unsigned i; for (i=0;i<sizeof(functions)/sizeof(void*);i++) printf("%%p\\n", functions[i]);\n' && \
+ printf 'return 0; }\n' && \
+ :; } > $@
+
+_sd.files_in = $(foreach f,$(files.sys),$(if $(filter $1,$(patsubst %/,%,$(dir $f))),$(DESTDIR)$f))
+
+$(outdir)/%-from-name.gperf: $(outdir)/%-list.txt
+ $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct $(notdir $*)_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' <$< >$@
+
+$(outdir)/%-from-name.h: $(outdir)/%-from-name.gperf
+ $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_$(notdir $*) -H hash_$(notdir $*)_name -p -C <$< >$@
+
+ifneq ($(sd.sed_files),)
+$(addprefix $(outdir)/,$(sd.sed_files)): $(outdir)/%: $(srcdir)/%.in
+ $(sd.SED_PROCESS)
+endif
+
+#$(outdir)/%.sh: $(srcdir)/%.sh.in
+# $(SED_PROCESS)
+# $(AM_V_GEN)chmod +x $@
+
+$(outdir)/%.c: $(srcdir)/%.gperf
+ $(AM_V_GPERF)$(GPERF) < $< > $@
+$(outdir)/%.c: $(outdir)/%.gperf
+ $(AM_V_GPERF)$(GPERF) < $< > $@
+
+$(outdir)/%: $(srcdir)/%.m4 $(top_builddir)/config.status
+ $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
diff --git a/build-aux/Makefile.each.tail/60-am.mk b/build-aux/Makefile.each.tail/60-am.mk
new file mode 100644
index 0000000000..ac8785d6ee
--- /dev/null
+++ b/build-aux/Makefile.each.tail/60-am.mk
@@ -0,0 +1,64 @@
+mod.am.depends += files
+
+########################################################################
+_am.primary2dirs = $(filter $(patsubst %dir,%,$(filter %dir,$(.VARIABLES))),\
+ $(patsubst %_$1,%,$(filter %_$1,$(.VARIABLES))))
+define _am.per_primary
+noinst_$p ?=
+check_$p ?=
+
+am.inst_$p := $$(foreach d,$$(call _am.primary2dirs,$p),$$($$d_$p))
+am.noinst_$p := $$(noinst_$p)
+am.check_$p := $$(check_$p)
+$(foreach d,$(call _am.primary2dirs,$p) nointt check,undefine $d_$p$(at.nl))
+ifneq ($$(am.inst_$p),)
+$$(am.inst_$p): private am.INSTALL = $$(am.INSTALL_$p)
+endif
+am.$p = $$(am.check_$p) $$(am.noinst_$p) $$(call am.inst2noinst_$p,$$(am.inst_$p))
+endef
+$(foreach p,$(am.primaries),$(eval $(_am.per_primary)))
+########################################################################
+files.sys.all += $(foreach p,$(am.primaries),$(am.inst_$p))
+files.out.all += $(foreach p,$(am.primaries),$(am.noinst_$p))
+files.out.all += $(foreach p,$(am.primaries),$(call am.inst2noinst_$p,$(am.inst_$p)))
+files.out.check += $(foreach p,$(am.primaries),$(am.check_$p))
+########################################################################
+# TODO: I'm not in love with how _am.per_PROGRAM figures out at.subdirs
+define _am.per_PROGRAM
+$$(foreach var,_am.depends $$(call am.var_PROGRAMS,$v),$$(eval $$(var) ?=))
+_am.depends += $$(call at.path,$$(call am.file2.o,$f) $$(call am.file2lib,$f,LDADD))
+am.CPPFLAGS += $$($v_CPPFLAGS) $$(call am.file2cpp,$f,LDADD)
+am.CFLAGS += $$($v_CFLAGS)
+$$(outdir)/$f: private ALL_LDFLAGS += $$($v_LDFLAGS)
+$$(outdir)/$f: $$(_am.depends)
+am.subdirs := $$(sort $$(am.subdirs)\
+ $$(filter-out $$(abspath $$(srcdir)),\
+ $$(abspath $$(dir $$(filter-out -l% /%,$$(_am.depends))))))
+$$(foreach var,_am.depends $$(call am.var_PROGRAMS,$v),$$(eval undefine $$(var)))
+endef
+$(foreach f,$(am.PROGRAMS),$(foreach v,$(call am.file2var,$f),$(eval $(_am.per_PROGRAM))))
+########################################################################
+# TODO: I'm not in love with how _am.per_LTLIBRARY figures out at.subdirs
+define _am.per_LTLIBRARY
+$$(foreach var,_am.depends $$(call am.var_LTLIBRARIES,$v),$$(eval $$(var) ?=))
+_am.depends += $$(call at.path,$$(call am.file2.lo,$f) $$(call am.file2lib,$f,LIBADD))
+am.CPPFLAGS += $$($v_CPPFLAGS) $$(call am.file2cpp,$f,LIBADD)
+am.CFLAGS += $$($v_CFLAGS)
+$$(outdir)/$f: private ALL_LDFLAGS += $$($v_LDFLAGS)
+$$(outdir)/$f: $$(_am.depends)
+am.subdirs := $$(sort $$(am.subdirs)\
+ $$(filter-out $$(abspath $$(srcdir)),\
+ $$(abspath $$(dir $$(filter-out -l% /%,$$(_am.depends))))))
+$$(foreach var,_am.depends $$(call am.var_LTLIBRARIES,$v),$$(eval undefine $$(var)))
+endef
+$(foreach f,$(am.LTLIBRARIES),$(foreach v,$(call am.file2var,$f),$(eval $(_am.per_LTLIBRARY))))
+########################################################################
+define _am.per_directory
+$$(DESTDIR)$d/%: $$(outdir)/%
+ @$$(NORMAL_INSTALL)
+ $$(am.INSTALL)
+$$(DESTDIR)$d/%: $$(srcdir)/%
+ @$$(NORMAL_INSTALL)
+ $$(am.INSTALL)
+endef
+$(foreach d,$(sort $(dir $(foreach p,$(am.primaries),$(am.inst_$p)))),$(eval $(_am.per_directory)))
diff --git a/build-aux/Makefile.head.mk b/build-aux/Makefile.head.mk
index 36c2c0a2e8..8213043c79 100644
--- a/build-aux/Makefile.head.mk
+++ b/build-aux/Makefile.head.mk
@@ -12,60 +12,103 @@
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+_at.MAKEFILE_LIST ?=
+_at.MAKEFILE_LIST := $(strip $(_at.MAKEFILE_LIST) $(abspath $(lastword $(filter-out %.mk,$(MAKEFILE_LIST)))))
# This bit only gets evaluated once, at the very beginning
ifeq ($(origin _at.NO_ONCE),undefined)
+# Internal functions ###################################################
+
+# These 4 functions are all $(call _at.func,parent,child)
+_at.is_strict_subdir = $(filter $(abspath $1)/%,$(abspath $2))
+_at.is_subdir = $(filter $(abspath $1)/%,$(abspath $2)/.)
+_at.relbase = $(strip \
+ $(if $(call _at.is_subdir,$1,$2), \
+ $(patsubst $(abspath $1)/%,%,$(abspath $2)/.), \
+ $(abspath $2)))
+_at.relto = $(strip \
+ $(if $(call _at.is_subdir,$1,$2), \
+ $(patsubst $(abspath $1)/%,%,$(abspath $2)/.), \
+ ../$(call _at.relto,$(dir $1),$2)))
+
+# These 3 functions only take one operand; we define public multi-operand
+# versions below.
+_at.path = $(strip \
+ $(if $(call _at.is_subdir,$(topoutdir),$1), \
+ $(patsubst %/.,%,$(topoutdir)/$(call _at.relto,.,$1)), \
+ $(if $(call _at.is_subdir,$(topsrcdir),$1), \
+ $(patsubst %/.,%,$(topsrcdir)/$(call _at.relto,$(topsrcdir),$1)), \
+ $(abspath $1))))
+_at.out2src = $(call _at.path,$(if $(call _at.is_subdir,$(topoutdir),$1),$(topsrcdir)/$(call _at.path,$1),$1))
+_at.addprefix = $(call _at.path,$(if $(filter-out /%,$2),$1/$2,$2))
+
+_at.rest = $(wordlist 2,$(words $1),$1)
+_at.reverse = $(if $1,$(call _at.reverse,$(_at.rest))) $(firstword $1)
+
+# Sanity checking ######################################################
+ifeq ($(filter undefine,$(.FEATURES)),)
+$(error Autothing: We need a version of Make that supports 'undefine')
+endif
ifeq ($(topsrcdir),)
-$(error topsrcdir must be set before including Makefile.head.mk)
+$(error Autothing: topsrcdir must be set (and non-empty) before including Makefile.head.mk)
endif
ifeq ($(topoutdir),)
-$(error topoutdir must be set before including Makefile.head.mk)
+$(error Autothing: topoutdir must be set (and non-empty) before including Makefile.head.mk)
endif
+ifneq ($(call _at.is_strict_subdir,$(topoutdir),$(topsrcdir)),)
+$(error Autothing: topsrcdir=$(topsrcdir) must not be a subdirectory of topoutdir=$(topoutdir))
+endif
+
+# Internal setup #######################################################
-_at.noslash = $(patsubst %/.,%,$(patsubst %/,%,$1))
-# These are all $(call _at.func,parent,child)
-#at.relto = $(if $2,$(shell realpath -sm --relative-to='$1' $2))
-_at.is_subdir = $(filter $(abspath $1)/%,$(abspath $2)/.)
-_at.relto_helper = $(if $(call _at.is_subdir,$1,$2),$(patsubst $1/%,%,$(addsuffix /.,$2)),$(addprefix ../,$(call _at.relto_helper,$(patsubst %/,%,$(dir $1)),$2)))
-_at.relto = $(call _at.noslash,$(call _at.relto_helper,$(call _at.noslash,$(abspath $1)),$(call _at.noslash,$(abspath $2))))
-at.relto = $(foreach p,$2,$(call _at.relto,$1,$p))
-# Note that _at.is_subdir says that a directory is a subdirectory of
-# itself.
-at.path = $(call at.relto,.,$1)
+# External provisions ##################################################
-_at.addprefix = $(if $(filter /%,$2),$2,$1/$2)
-at.addprefix = $(foreach f,$2, $(addsuffix $(if $(filter %/,$f),/),$(call at.path,$(call _at.addprefix,$1,$f)) ))
+# These 4 functions are all $(call _at.func,parent,child)
+at.is_subdir = $(_at.is_subdir)
+at.is_strict_subdir = $(_at.is_strict_subdir)
+#at.relbase = $(if $2,$(shell realpath -sm --relative-base=$1 -- $2))
+at.relbase = $(foreach _at.tmp,$2,$(call _at.relbase,$1,$(_at.tmp)))
+#at.relto = $(if $2,$(shell realpath -sm --relative-to=$1 -- $2))
+at.relto = $(foreach _at.tmp,$2,$(call _at.relto,$1,$(_at.tmp)))
+
+at.path = $(foreach _at.tmp,$1,$(call _at.path,$(_at.tmp)))
+at.out2src = $(foreach _at.tmp,$1,$(call _at.out2src,$(_at.tmp)))
+at.addprefix = $(foreach _at.tmp,$2,$(call _at.addprefix,$1,$(_at.tmp)))
define at.nl
endef
+# External configuration ###############################################
at.Makefile ?= Makefile
-_at.rest = $(wordlist 2,$(words $1),$1)
-_at.reverse = $(if $1,$(call _at.reverse,$(_at.rest))) $(firstword $1)
-
-at.dirlocal += at.subdirs
-at.dirlocal += at.depdirs
-
-_at.outdirs ?=
-_at.included_makefiles ?=
-
+# Include modules ######################################################
include $(sort $(wildcard $(topsrcdir)/build-aux/Makefile.once.head/*.mk))
+_at.tmp_targets =
+_at.tmp_subdirs =
+_at.VARIABLES =
+_at.VARIABLES := $(.VARIABLES)
endif # _at.NO_ONCE
# This bit gets evaluated for each Makefile
-## Set outdir and srcdir (assumes that topoutdir and topsrcdir are
-## already set)
-outdir := $(call at.path,$(dir $(lastword $(filter-out %.mk,$(MAKEFILE_LIST)))))
-srcdir := $(call at.path,$(topsrcdir)/$(call _at.relto,$(topoutdir),$(outdir)))
+outdir := $(call _at.path,$(dir $(lastword $(_at.MAKEFILE_LIST))))
+ifeq ($(call _at.is_subdir,$(topoutdir),$(outdir)),)
+$(error Autothing: not a subdirectory of topoutdir=$(topoutdir): $(outdir))
+endif
-_at.included_makefiles := $(_at.included_makefiles) $(call at.path,$(outdir)/$(at.Makefile))
+# Don't use at.out2src because we *know* that $(outdir) is inside $(topoutdir),
+# and has already had $(_at.path) called on it.
+srcdir := $(call _at.path,$(topsrcdir)/$(outdir))
+ifeq ($(call _at.is_subdir,$(topsrcdir),$(srcdir)),)
+$(error Autothing: not a subdirectory of topsrcdir=$(topsrcdir): $(srcdir))
+endif
-$(foreach v,$(at.dirlocal),$(eval $v=))
+at.subdirs =
+at.targets =
include $(sort $(wildcard $(topsrcdir)/build-aux/Makefile.each.head/*.mk))
diff --git a/build-aux/Makefile.once.head/00-write-ifchanged.mk b/build-aux/Makefile.once.head/00-write-ifchanged.mk
deleted file mode 100644
index 79ef1c419c..0000000000
--- a/build-aux/Makefile.once.head/00-write-ifchanged.mk
+++ /dev/null
@@ -1 +0,0 @@
-WRITE_IFCHANGED = $(topsrcdir)/build-aux/write-ifchanged
diff --git a/build-aux/Makefile.once.head/00-dist.mk b/build-aux/Makefile.once.head/10-dist.mk
index 4326cde72a..0e13ea2e28 100644
--- a/build-aux/Makefile.once.head/00-dist.mk
+++ b/build-aux/Makefile.once.head/10-dist.mk
@@ -13,6 +13,8 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+mod.dist.description = Make distribution tarballs
+
# Developer configuration
dist.exts ?= .tar.gz
@@ -20,10 +22,10 @@ dist.pkgname ?= $(firstword $(PACKAGE_TARNAME) $(PACKAGE) $(PACKAGE_NAME))
dist.version ?= $(firstword $(PACKAGE_VERSION) $(VERSION))
ifeq ($(dist.pkgname),)
-$(error dist.pkgname must be set)
+$(error Autothing module: dist: dist.pkgname must be set)
endif
ifeq ($(dist.version),)
-$(error dist.version must be set)
+$(error Autothing module: dist: dist.version must be set)
endif
# User configuration
@@ -38,7 +40,3 @@ TAR ?= tar
GZIPFLAGS ?= $(GZIP_ENV)
GZIP_ENV ?= --best
-
-# Implementation
-
-at.phony += dist
diff --git a/build-aux/Makefile.once.head/10-std.mk b/build-aux/Makefile.once.head/10-files.mk
index 3e058eca57..56e06acc34 100644
--- a/build-aux/Makefile.once.head/10-std.mk
+++ b/build-aux/Makefile.once.head/10-files.mk
@@ -13,27 +13,25 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Declare the default target
-all: build
-.PHONY: all noop
+mod.files.description = Keeping track of groups of files
+mod.files.depends += nested
+
+files.groups ?= all
+files.default ?= all
+files.vcsclean ?= files.vcsclean
+files.generate ?= files.generate
+
+.DEFAULT_GOAL = $(files.default_group)
# Standard creative PHONY targets
-at.phony += build install installdirs
+nested.targets += $(foreach g,$(files.groups), $g install-$g install-$gdirs)
# Standard destructive PHONY targets
-at.phony += uninstall mostlyclean clean distclean maintainer-clean
-
-at.dirlocal += std.src_files
-at.dirlocal += std.gen_files
-at.dirlocal += std.cfg_files
-at.dirlocal += std.out_files
-at.dirlocal += std.sys_files
-at.dirlocal += std.clean_files
-at.dirlocal += std.slow_files
+nested.targets += uninstall mostlyclean clean distclean maintainer-clean
# User configuration
DESTDIR ?=
RM ?= rm -f
-RMDIR_P ?= rmdir -p
+RMDIR_P ?= rmdir -p --ignore-fail-on-non-empty
TRUE ?= true
diff --git a/build-aux/Makefile.once.head/00-gnuconf.mk b/build-aux/Makefile.once.head/10-gnuconf.mk
index 83cb110c59..c07cfb5cf3 100644
--- a/build-aux/Makefile.once.head/00-gnuconf.mk
+++ b/build-aux/Makefile.once.head/10-gnuconf.mk
@@ -14,11 +14,13 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# This file is based on §7.2 "Makefile Conventions" of the release of
-# the GNU Coding Standards dated April 13, 2016.
+# the GNU Coding Standards dated July 25, 2016.
+
+mod.gnuconf.description = GNU standard configuration variables
gnuconf.pkgname ?= $(firstword $(PACKAGE_TARNAME) $(PACKAGE) $(PACKAGE_NAME))
ifeq ($(gnuconf.pkgname),)
-$(error gnuconf.pkgname must be set)
+$(error Autothing module: gnuconf: gnuconf.pkgname must be set)
endif
# 7.2.2: Utilities in Makefiles
@@ -54,43 +56,69 @@ TOUCH ?= touch
TR ?= tr
TRUE ?= true
-# These must be user-configurable
+# 7.2.2: Utilities in Makefiles/7.2.3: Variables for Specifying Commands
+# ----------------------------------------------------------------------
+
+# Standard user-configurable programs.
+#
+# The list of programs here is specified in §7.2.2, but the associated FLAGS
+# variables are specified in §7.2.3. I found it cleaner to list them together.
AR ?= ar
ARFLAGS ?=
BISON ?= bison
BISONFLAGS ?=
CC ?= cc
-CCFLAGS ?= $(CFLAGS)
+CFLAGS ?= # CFLAGS instead of CCFLAGS
FLEX ?= flex
FLEXFLAGS ?=
INSTALL ?= install
-#INSTALLFLAGS ?=
+# There is no INSTALLFLAGS[0]
LD ?= ld
LDFLAGS ?=
-LDCONFIG ?= ldconfig #TODO
+LDCONFIG ?= ldconfig # TODO[1]
LDCONFIGFLAGS ?=
LEX ?= lex
-LEXFLAGS ?= $(LFLAGS)
+LFLAGS ?= # LFLAGS instead of LEXFLAGS
#MAKE
MAKEINFO ?= makeinfo
MAKEINFOFLAGS ?=
-RANLIB ?= ranlib #TODO
+RANLIB ?= ranlib # TODO[1]
RANLIBFLAGS ?=
TEXI2DVI ?= texi2dvi
TEXI2DVIFLAGS ?=
YACC ?= yacc
-YACCFLAGS ?= $(YFLAGS)
+YFLAGS ?= # YFLAGS instead of YACCFLAGS
-CFLAGS ?=
-LFLAGS ?=
-YFLAGS ?=
-
-LN_S ?= ln -s #TODO
+LN_S ?= ln -s # TODO[2]
CHGRP ?= chgrp
+CHGRPFLAGS ?=
CHMOD ?= chmod
+CHMODFLAGS ?=
CHOWN ?= chown
+CHOWNFLAGS ?=
MKNOD ?= mknod
+MKNODFLAGS ?=
+
+# [0]: There is no INSTALLFLAGS because it would be inconsistent with how the
+# standards otherwise recommend using $(INSTALL); with INSTALL_PROGRAM and
+# INSTALL_DATA; which are specified in a way precluding the use of
+# INSTALLFLAGS. To have the variable, but to ignore it in the common case
+# would be confusing.
+#
+# [1]: The RANLIB and LDCONFIG variables need some extra smarts; §7.2.2 says:
+#
+# > When you use ranlib or ldconfig, you should make sure nothing bad
+# > happens if the system does not have the program in question. Arrange
+# > to ignore an error from that command, and print a message before the
+# > command to tell the user that failure of this command does not mean a
+# > problem. (The Autoconf ‘AC_PROG_RANLIB’ macro can help with this.)
+#
+# [2]: The LN_S variable isn't standard, but we have it here as an (incomplete)
+# stub to help support this bit of §7.2.2:
+#
+# > If you use symbolic links, you should implement a fallback for
+# > systems that don’t have symbolic links.
# 7.2.3: Variables for Specifying Commands
# ----------------------------------------
diff --git a/build-aux/Makefile.once.head/10-lt.mk b/build-aux/Makefile.once.head/10-lt.mk
new file mode 100644
index 0000000000..c8410d4e38
--- /dev/null
+++ b/build-aux/Makefile.once.head/10-lt.mk
@@ -0,0 +1,12 @@
+mod.lt.description = Easy handling of libtool dependencies
+mod.lt.deps += files
+
+_lt.dups = $(sort $(foreach l,$1,$(if $(filter-out 1,$(words $(filter $l,$1))),$l)))
+_lt.patsubst-all = $(if $1,$(call _sd.patsubst-all,$(wordlist 2,$(words $1),$1),$2,$(patsubst $(firstword $1),$2,$3)),$3)
+_lt.unLIBPATTERNS = $(foreach _lt.tmp,$1,$(if $(filter $(.LIBPATTERNS),$(_lt.tmp)),$(call _lt.patsubst-all,$(.LIBPATTERNS),-l%,$(_lt.tmp)),$(_lt.tmp)))
+
+# The semantics for the de-dup bit are a bit weird. My head hurts thinking
+# about them. TODO: clarify/simplify/something
+lt.rpath = $(dir $(patsubst $(DESTDIR)%,%,$(filter %/$(@F),$(files.sys))))
+_lt.link_files = $(filter %.o %.lo %.la -l%,$(call _lt.unLIBPATTERNS$,$^))
+lt.link_files = $(filter-out $(call _lt.dups,$(_lt.link_files)),$(_lt.link_files))
diff --git a/build-aux/Makefile.once.head/10-nested.mk b/build-aux/Makefile.once.head/10-nested.mk
new file mode 100644
index 0000000000..af9fdf7d8a
--- /dev/null
+++ b/build-aux/Makefile.once.head/10-nested.mk
@@ -0,0 +1,18 @@
+# Copyright (C) 2016 Luke Shumaker
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program 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 Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+mod.nested.description = Easy nested .PHONY targets
+
+nested.targets ?=
diff --git a/build-aux/Makefile.once.head/10-write-ifchanged.mk b/build-aux/Makefile.once.head/10-write-ifchanged.mk
new file mode 100644
index 0000000000..7917201159
--- /dev/null
+++ b/build-aux/Makefile.once.head/10-write-ifchanged.mk
@@ -0,0 +1,3 @@
+mod.write-ifchanged.description = build-aux/write-ifchanged helper script
+
+WRITE_IFCHANGED ?= $(topsrcdir)/build-aux/write-ifchanged
diff --git a/build-aux/Makefile.once.head/20-sd.mk b/build-aux/Makefile.once.head/20-sd.mk
new file mode 100644
index 0000000000..c8462f285c
--- /dev/null
+++ b/build-aux/Makefile.once.head/20-sd.mk
@@ -0,0 +1,217 @@
+# -*- 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/>.
+
+mod.sd.description = systemd build rules
+mod.sd.depends += am
+
+TESTS ?=
+
+# Make behavior
+SHELL = bash -o pipefail
+
+.DELETE_ON_ERROR:
+.SECONDARY:
+
+# Autoconf
+OUR_CPPFLAGS += -MT $@ -MD -MP -MF $(@D)/$(DEPDIR)/$(basename $(@F)).P$(patsubst .%,%,$(suffix $(@F)))
+OUR_CPPFLAGS += -include $(topoutdir)/config.h
+OUR_CPPFLAGS += $(sort -I$(@D) $(if $(<D),-I$(<D) -I$(call at.out2src,$(<D))))
+
+#
+sd.ALL_CFLAGS = $(OUR_CFLAGS) $(am.CFLAGS) $(sd.CFLAGS) $(CFLAGS)
+sd.ALL_CPPFLAGS = $(OUR_CPPFLAGS) $(am.CPPFLAGS) $(sd.CPPFLAGS) $(CPPFLAGS)
+sd.ALL_LDFLAGS = $(OUR_LDFLAGS) $(am.LDFLAGS) $(sd.LDFLAGS) $(LDFLAGS)
+sd.ALL_LIBTOOLFLAGS = $(OUR_LIBTOOLFLAGS) $(am.LIBTOOLFLAGS) $(sd.LIBTOOLFLAGS) $(LIBTOOLFLAGS)
+
+sd.COMPILE = $(CC) $(sd.ALL_CPPFLAGS) $(sd.ALL_CFLAGS)
+sd.LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(sd.ALL_LIBTOOLFLAGS) --mode=compile $(CC) $(sd.ALL_CPPFLAGS) $(sd.ALL_CFLAGS)
+sd.LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(sd.ALL_LIBTOOLFLAGS) --mode=link $(CCLD) $(sd.ALL_CFLAGS) $(sd.ALL_LDFLAGS) -o $@
+
+am.INSTALL_PROGRAM = $(AM_V_PROG)$(LIBTOOL) $(AM_V_lt) --tag=CC $(sd.ALL_LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $< $@
+am.INSTALL_SCRIPT = $(AM_V_SCRIPT)$(INSTALL_SCRIPT) $< $@
+am.INSTALL_LTLIBRARY = $(AM_V_LIB)$(LIBTOOL) $(AM_V_lt) --tag=CC $(sd.ALL_LIBTOOLFLAGS) --mode=install $(INSTALL) $< $@
+am.INSTALL_DATA = $(AM_V_DATA)$(INSTALL_DATA) $< $@
+
+CC ?= c99
+CCLD ?= c99
+LIBTOOL ?= libtool
+
+V ?=
+
+AM_V_M4 ?= $(AM_V_M4_$(V))
+AM_V_M4_ ?= $(AM_V_M4_$(AM_DEFAULT_VERBOSITY))
+AM_V_M4_0 ?= @echo " M4 " $@;
+AM_V_M4_1 ?=
+
+AM_V_XSLT ?= $(AM_V_XSLT_$(V))
+AM_V_XSLT_ ?= $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
+AM_V_XSLT_0 ?= @echo " XSLT " $@;
+AM_V_XSLT_1 ?=
+
+AM_V_GPERF ?= $(AM_V_GPERF_$(V))
+AM_V_GPERF_ ?= $(AM_V_GPERF_$(AM_DEFAULT_VERBOSITY))
+AM_V_GPERF_0 ?= @echo " GPERF " $@;
+AM_V_GPERF_1 ?=
+
+AM_V_LN ?= $(AM_V_LN_$(V))
+AM_V_LN_ ?= $(AM_V_LN_$(AM_DEFAULT_VERBOSITY))
+AM_V_LN_0 ?= @echo " LN " $@;
+AM_V_LN_1 ?=
+
+AM_V_RM ?= $(AM_V_RM_$(V))
+AM_V_RM_ ?= $(AM_V_RM_$(AM_DEFAULT_VERBOSITY))
+AM_V_RM_0 ?= @echo " RM " $@;
+AM_V_RM_1 ?=
+
+AM_V_CC ?= $(AM_V_CC_$(V))
+AM_V_CC_ ?= $(AM_V_CC_$(AM_DEFAULT_VERBOSITY))
+AM_V_CC_0 ?= @echo " CC " $@;
+AM_V_CC_1 ?=
+
+AM_V_CCLD ?= $(AM_V_CCLD_$(V))
+AM_V_CCLD_ ?= $(AM_V_CCLD_$(AM_DEFAULT_VERBOSITY))
+AM_V_CCLD_0 ?= @echo " CCLD " $@;
+AM_V_CCLD_1 ?=
+
+AM_V_EFI_CC ?= $(AM_V_EFI_CC_$(V))
+AM_V_EFI_CC_ ?= $(AM_V_EFI_CC_$(AM_DEFAULT_VERBOSITY))
+AM_V_EFI_CC_0 ?= @echo " EFI_CC " $@;
+AM_V_EFI_CC_1 ?=
+
+AM_V_EFI_CCLD ?= $(AM_V_EFI_CCLD_$(V))
+AM_V_EFI_CCLD_ ?= $(AM_V_EFI_CCLD_$(AM_DEFAULT_VERBOSITY))
+AM_V_EFI_CCLD_0 ?= @echo " EFI_CCLD" $@;
+AM_V_EFI_CCLD_1 ?=
+
+AM_V_P ?= $(AM_V_P_$(V))
+AM_V_P_ ?= $(AM_V_P_$(AM_DEFAULT_VERBOSITY))
+AM_V_P_0 ?= false
+AM_V_P_1 ?= :
+
+AM_V_GEN ?= $(AM_V_GEN_$(V))
+AM_V_GEN_ ?= $(AM_V_GEN_$(AM_DEFAULT_VERBOSITY))
+AM_V_GEN_0 ?= @echo " GEN " $@;
+AM_V_GEN_1 ?=
+
+AM_V_DATA ?= $(AM_V_DATA_$(V))
+AM_V_DATA_ ?= $(AM_V_DATA_$(AM_DEFAULT_VERBOSITY))
+AM_V_DATA_0 ?= @echo " DATA " $@;
+AM_V_DATA_1 ?=
+
+AM_V_PROG ?= $(AM_V_PROG_$(V))
+AM_V_PROG_ ?= $(AM_V_PROG_$(AM_DEFAULT_VERBOSITY))
+AM_V_PROG_0 ?= @echo " PROG " $@;
+AM_V_PROG_1 ?=
+
+AM_V_SCRIPT ?= $(AM_V_SCRIPT_$(V))
+AM_V_SCRIPT_ ?= $(AM_V_SCRIPT_$(AM_DEFAULT_VERBOSITY))
+AM_V_SCRIPT_0 ?= @echo " SCRIPT " $@;
+AM_V_SCRIPT_1 ?=
+
+AM_V_LIB ?= $(AM_V_LIB_$(V))
+AM_V_LIB_ ?= $(AM_V_LIB_$(AM_DEFAULT_VERBOSITY))
+AM_V_LIB_0 ?= @echo " LIB " $@;
+AM_V_LIB_1 ?=
+
+AM_V_at ?= $(AM_V_at_$(V))
+AM_V_at_ ?= $(AM_V_at_$(AM_DEFAULT_VERBOSITY))
+AM_V_at_0 ?= @
+AM_V_at_1 ?=
+
+AM_V_lt ?= $(AM_V_lt_$(V))
+AM_V_lt_ ?= $(AM_V_lt_$(AM_DEFAULT_VERBOSITY))
+AM_V_lt_0 ?= --silent
+AM_V_lt_1 ?=
+
+INTLTOOL_V_MERGE ?= $(INTLTOOL_V_MERGE_$(V))
+INTLTOOL_V_MERGE_OPTIONS ?= $(intltool_v_merge_options_$(V))
+INTLTOOL_V_MERGE_ ?= $(INTLTOOL_V_MERGE_$(AM_DEFAULT_VERBOSITY))
+INTLTOOL_V_MERGE_0 ?= @echo " ITMRG " $@;
+INTLTOOL_V_MERGE_1 ?=
+
+sd.substitutions = \
+ '|rootlibexecdir=$(rootlibexecdir)|' \
+ '|rootbindir=$(rootbindir)|' \
+ '|bindir=$(bindir)|' \
+ '|SYSTEMCTL=$(rootbindir)/systemctl|' \
+ '|SYSTEMD_NOTIFY=$(rootbindir)/systemd-notify|' \
+ '|pkgsysconfdir=$(pkgsysconfdir)|' \
+ '|SYSTEM_CONFIG_UNIT_PATH=$(pkgsysconfdir)/system|' \
+ '|USER_CONFIG_UNIT_PATH=$(pkgsysconfdir)/user|' \
+ '|pkgdatadir=$(pkgdatadir)|' \
+ '|systemunitdir=$(systemunitdir)|' \
+ '|userunitdir=$(userunitdir)|' \
+ '|systempresetdir=$(systempresetdir)|' \
+ '|userpresetdir=$(userpresetdir)|' \
+ '|udevhwdbdir=$(udevhwdbdir)|' \
+ '|udevrulesdir=$(udevrulesdir)|' \
+ '|catalogdir=$(catalogdir)|' \
+ '|tmpfilesdir=$(tmpfilesdir)|' \
+ '|sysusersdir=$(sysusersdir)|' \
+ '|sysctldir=$(sysctldir)|' \
+ '|systemgeneratordir=$(systemgeneratordir)|' \
+ '|usergeneratordir=$(usergeneratordir)|' \
+ '|CERTIFICATEROOT=$(CERTIFICATEROOT)|' \
+ '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
+ '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
+ '|PACKAGE_URL=$(PACKAGE_URL)|' \
+ '|RANDOM_SEED_DIR=$(localstatedir)/lib/systemd/|' \
+ '|RANDOM_SEED=$(localstatedir)/lib/systemd/random-seed|' \
+ '|prefix=$(prefix)|' \
+ '|exec_prefix=$(exec_prefix)|' \
+ '|libdir=$(libdir)|' \
+ '|includedir=$(includedir)|' \
+ '|VERSION=$(VERSION)|' \
+ '|rootprefix=$(rootprefix)|' \
+ '|udevlibexecdir=$(udevlibexecdir)|' \
+ '|SUSHELL=$(SUSHELL)|' \
+ '|SULOGIN=$(SULOGIN)|' \
+ '|DEBUGTTY=$(DEBUGTTY)|' \
+ '|KILL=$(KILL)|' \
+ '|KMOD=$(KMOD)|' \
+ '|MOUNT_PATH=$(MOUNT_PATH)|' \
+ '|UMOUNT_PATH=$(UMOUNT_PATH)|' \
+ '|MKDIR_P=$(MKDIR_P)|' \
+ '|QUOTAON=$(QUOTAON)|' \
+ '|QUOTACHECK=$(QUOTACHECK)|' \
+ '|SYSTEM_SYSVINIT_PATH=$(sysvinitdir)|' \
+ '|VARLOGDIR=$(varlogdir)|' \
+ '|RC_LOCAL_SCRIPT_PATH_START=$(RC_LOCAL_SCRIPT_PATH_START)|' \
+ '|RC_LOCAL_SCRIPT_PATH_STOP=$(RC_LOCAL_SCRIPT_PATH_STOP)|' \
+ '|PYTHON=$(PYTHON)|' \
+ '|NTP_SERVERS=$(NTP_SERVERS)|' \
+ '|DNS_SERVERS=$(DNS_SERVERS)|' \
+ '|DEFAULT_DNSSEC_MODE=$(DEFAULT_DNSSEC_MODE)|' \
+ '|KILL_USER_PROCESSES=$(KILL_USER_PROCESSES)|' \
+ '|systemuidmax=$(SYSTEM_UID_MAX)|' \
+ '|systemgidmax=$(SYSTEM_GID_MAX)|' \
+ '|TTY_GID=$(TTY_GID)|' \
+ '|systemsleepdir=$(systemsleepdir)|' \
+ '|systemshutdowndir=$(systemshutdowndir)|' \
+ '|binfmtdir=$(binfmtdir)|' \
+ '|modulesloaddir=$(modulesloaddir)|'
+
+sd.SED_PROCESS = \
+ $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
+ $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(sd.substitutions)))) \
+ < $< > $@
diff --git a/build-aux/Makefile.once.head/20-systemd.mk b/build-aux/Makefile.once.head/20-systemd.mk
deleted file mode 100644
index 04627a9497..0000000000
--- a/build-aux/Makefile.once.head/20-systemd.mk
+++ /dev/null
@@ -1,220 +0,0 @@
-# -*- 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/>.
-
-TESTS ?=
-
-
-SHELL = bash -o pipefail
-
-OUR_CPPFLAGS += -MT $@ -MD -MP -MF $(@D)/$(DEPDIR)/$(basename $(@F)).P$(patsubst .%,%,$(suffix $(@F)))
-OUR_CPPFLAGS += -include $(topoutdir)/config.h
-OUR_CPPFLAGS += $(sort $(if $(<D),-I$(<D)) \
- $(if $(filter $(abspath $(topoutdir))/%,$(abspath $<)),-I$(call at.path,$(dir $(patsubst $(abspath $(topoutdir))/%,$(abspath $(topsrcdir))/%,$(abspath $<))))) \
- -I$(@D) )
-
-at.dirlocal += systemd.CFLAGS systemd.CPPFLAGS systemd.LDFLAGS systemd.LIBTOOLFLAGS
-ALL_CFLAGS = $(OUR_CFLAGS) $(am.CFLAGS/$(@D)) $(systemd.CFLAGS/$(@D)) $(CFLAGS)
-ALL_CPPFLAGS = $(OUR_CPPFLAGS) $(am.CPPFLAGS/$(@D)) $(systemd.CPPFLAGS/$(@D)) $(CPPFLAGS)
-ALL_LDFLAGS = $(OUR_LDFLAGS) $(am.LDFLAGS/$(@D)) $(systemd.LDFLAGS/$(@D)) $(LDFLAGS)
-ALL_LIBTOOLFLAGS = $(OUR_LIBTOOLFLAGS) $(am.LIBTOOLFLAGS/$(@D)) $(systemd.LIBTOOLFLAGS/$(@D)) $(LIBTOOLFLAGS)
-
-SYS_CFLAGS = $(OUR_CFLAGS) $(am.CFLAGS/$(<D)) $(systemd.CFLAGS/$(<D)) $(CFLAGS)
-SYS_CPPFLAGS = $(OUR_CPPFLAGS) $(am.CPPFLAGS/$(<D)) $(systemd.CPPFLAGS/$(<D)) $(CPPFLAGS)
-SYS_LDFLAGS = $(OUR_LDFLAGS) $(am.LDFLAGS/$(<D)) $(systemd.LDFLAGS/$(<D)) $(LDFLAGS)
-SYS_LIBTOOLFLAGS = $(OUR_LIBTOOLFLAGS) $(am.LIBTOOLFLAGS/$(<D)) $(systemd.LIBTOOLFLAGS/$(<D)) $(LIBTOOLFLAGS)
-
-COMPILE = $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(ALL_LIBTOOLFLAGS) --mode=compile $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(ALL_LIBTOOLFLAGS) --mode=link $(CCLD) $(ALL_CFLAGS) $(ALL_LDFLAGS) -o $@
-
-.DELETE_ON_ERROR:
-.SECONDARY:
-
-V ?=
-
-AM_V_M4 = $(AM_V_M4_$(V))
-AM_V_M4_ = $(AM_V_M4_$(AM_DEFAULT_VERBOSITY))
-AM_V_M4_0 = @echo " M4 " $@;
-AM_V_M4_1 =
-
-AM_V_XSLT = $(AM_V_XSLT_$(V))
-AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
-AM_V_XSLT_0 = @echo " XSLT " $@;
-AM_V_XSLT_1 =
-
-AM_V_GPERF = $(AM_V_GPERF_$(V))
-AM_V_GPERF_ = $(AM_V_GPERF_$(AM_DEFAULT_VERBOSITY))
-AM_V_GPERF_0 = @echo " GPERF " $@;
-AM_V_GPERF_1 =
-
-AM_V_LN = $(AM_V_LN_$(V))
-AM_V_LN_ = $(AM_V_LN_$(AM_DEFAULT_VERBOSITY))
-AM_V_LN_0 = @echo " LN " $@;
-AM_V_LN_1 =
-
-AM_V_RM = $(AM_V_RM_$(V))
-AM_V_RM_ = $(AM_V_RM_$(AM_DEFAULT_VERBOSITY))
-AM_V_RM_0 = @echo " RM " $@;
-AM_V_RM_1 =
-
-AM_V_CC = $(AM_V_CC_$(V))
-AM_V_CC_ = $(AM_V_CC_$(AM_DEFAULT_VERBOSITY))
-AM_V_CC_0 = @echo " CC " $@;
-AM_V_CC_1 =
-
-AM_V_CCLD = $(AM_V_CCLD_$(V))
-AM_V_CCLD_ = $(AM_V_CCLD_$(AM_DEFAULT_VERBOSITY))
-AM_V_CCLD_0 = @echo " CCLD " $@;
-AM_V_CCLD_1 =
-
-AM_V_EFI_CC = $(AM_V_EFI_CC_$(V))
-AM_V_EFI_CC_ = $(AM_V_EFI_CC_$(AM_DEFAULT_VERBOSITY))
-AM_V_EFI_CC_0 = @echo " EFI_CC " $@;
-AM_V_EFI_CC_1 =
-
-AM_V_EFI_CCLD = $(AM_V_EFI_CCLD_$(V))
-AM_V_EFI_CCLD_ = $(AM_V_EFI_CCLD_$(AM_DEFAULT_VERBOSITY))
-AM_V_EFI_CCLD_0 = @echo " EFI_CCLD" $@;
-AM_V_EFI_CCLD_1 =
-
-AM_V_P = $(AM_V_P_$(V))
-AM_V_P_ = $(AM_V_P_$(AM_DEFAULT_VERBOSITY))
-AM_V_P_0 = false
-AM_V_P_1 = :
-
-AM_V_GEN = $(AM_V_GEN_$(V))
-AM_V_GEN_ = $(AM_V_GEN_$(AM_DEFAULT_VERBOSITY))
-AM_V_GEN_0 = @echo " GEN " $@;
-AM_V_GEN_1 =
-
-AM_V_DATA = $(AM_V_DATA_$(V))
-AM_V_DATA_ = $(AM_V_DATA_$(AM_DEFAULT_VERBOSITY))
-AM_V_DATA_0 = @echo " DATA " $@;
-AM_V_DATA_1 =
-
-AM_V_PROG = $(AM_V_PROG_$(V))
-AM_V_PROG_ = $(AM_V_PROG_$(AM_DEFAULT_VERBOSITY))
-AM_V_PROG_0 = @echo " PROG " $@;
-AM_V_PROG_1 =
-
-AM_V_LIB = $(AM_V_LIB_$(V))
-AM_V_LIB_ = $(AM_V_LIB_$(AM_DEFAULT_VERBOSITY))
-AM_V_LIB_0 = @echo " LIB " $@;
-AM_V_LIB_1 =
-
-AM_V_at = $(AM_V_at_$(V))
-AM_V_at_ = $(AM_V_at_$(AM_DEFAULT_VERBOSITY))
-AM_V_at_0 = @
-AM_V_at_1 =
-
-AM_V_lt = $(AM_V_lt_$(V))
-AM_V_lt_ = $(AM_V_lt_$(AM_DEFAULT_VERBOSITY))
-AM_V_lt_0 = --silent
-AM_V_lt_1 =
-
-INTLTOOL_V_MERGE = $(INTLTOOL_V_MERGE_$(V))
-INTLTOOL_V_MERGE_OPTIONS = $(intltool_v_merge_options_$(V))
-INTLTOOL_V_MERGE_ = $(INTLTOOL_V_MERGE_$(AM_DEFAULT_VERBOSITY))
-INTLTOOL_V_MERGE_0 = @echo " ITMRG " $@;
-INTLTOOL_V_MERGE_1 =
-
-substitutions = \
- '|rootlibexecdir=$(rootlibexecdir)|' \
- '|rootbindir=$(rootbindir)|' \
- '|bindir=$(bindir)|' \
- '|SYSTEMCTL=$(rootbindir)/systemctl|' \
- '|SYSTEMD_NOTIFY=$(rootbindir)/systemd-notify|' \
- '|pkgsysconfdir=$(pkgsysconfdir)|' \
- '|SYSTEM_CONFIG_UNIT_PATH=$(pkgsysconfdir)/system|' \
- '|USER_CONFIG_UNIT_PATH=$(pkgsysconfdir)/user|' \
- '|pkgdatadir=$(pkgdatadir)|' \
- '|systemunitdir=$(systemunitdir)|' \
- '|userunitdir=$(userunitdir)|' \
- '|systempresetdir=$(systempresetdir)|' \
- '|userpresetdir=$(userpresetdir)|' \
- '|udevhwdbdir=$(udevhwdbdir)|' \
- '|udevrulesdir=$(udevrulesdir)|' \
- '|catalogdir=$(catalogdir)|' \
- '|tmpfilesdir=$(tmpfilesdir)|' \
- '|sysusersdir=$(sysusersdir)|' \
- '|sysctldir=$(sysctldir)|' \
- '|systemgeneratordir=$(systemgeneratordir)|' \
- '|usergeneratordir=$(usergeneratordir)|' \
- '|CERTIFICATEROOT=$(CERTIFICATEROOT)|' \
- '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
- '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
- '|PACKAGE_URL=$(PACKAGE_URL)|' \
- '|RANDOM_SEED_DIR=$(localstatedir)/lib/systemd/|' \
- '|RANDOM_SEED=$(localstatedir)/lib/systemd/random-seed|' \
- '|prefix=$(prefix)|' \
- '|exec_prefix=$(exec_prefix)|' \
- '|libdir=$(libdir)|' \
- '|includedir=$(includedir)|' \
- '|VERSION=$(VERSION)|' \
- '|rootprefix=$(rootprefix)|' \
- '|udevlibexecdir=$(udevlibexecdir)|' \
- '|SUSHELL=$(SUSHELL)|' \
- '|SULOGIN=$(SULOGIN)|' \
- '|DEBUGTTY=$(DEBUGTTY)|' \
- '|KILL=$(KILL)|' \
- '|KMOD=$(KMOD)|' \
- '|MOUNT_PATH=$(MOUNT_PATH)|' \
- '|UMOUNT_PATH=$(UMOUNT_PATH)|' \
- '|MKDIR_P=$(MKDIR_P)|' \
- '|QUOTAON=$(QUOTAON)|' \
- '|QUOTACHECK=$(QUOTACHECK)|' \
- '|SYSTEM_SYSVINIT_PATH=$(sysvinitdir)|' \
- '|VARLOGDIR=$(varlogdir)|' \
- '|RC_LOCAL_SCRIPT_PATH_START=$(RC_LOCAL_SCRIPT_PATH_START)|' \
- '|RC_LOCAL_SCRIPT_PATH_STOP=$(RC_LOCAL_SCRIPT_PATH_STOP)|' \
- '|PYTHON=$(PYTHON)|' \
- '|NTP_SERVERS=$(NTP_SERVERS)|' \
- '|DNS_SERVERS=$(DNS_SERVERS)|' \
- '|DEFAULT_DNSSEC_MODE=$(DEFAULT_DNSSEC_MODE)|' \
- '|KILL_USER_PROCESSES=$(KILL_USER_PROCESSES)|' \
- '|systemuidmax=$(SYSTEM_UID_MAX)|' \
- '|systemgidmax=$(SYSTEM_GID_MAX)|' \
- '|TTY_GID=$(TTY_GID)|' \
- '|systemsleepdir=$(systemsleepdir)|' \
- '|systemshutdowndir=$(systemshutdowndir)|' \
- '|binfmtdir=$(binfmtdir)|' \
- '|modulesloaddir=$(modulesloaddir)|'
-
-SED_PROCESS = \
- $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
- $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
- < $< > $@
-
-# Stupid test that everything purported to be exported really is
-define generate-sym-test
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_at)printf '#include <stdio.h>\n' > $@
- $(AM_V_at)printf '#include "%s"\n' $(notdir $(filter %.h, $^)) >> $@
- $(AM_V_at)printf 'void* functions[] = {\n' >> $@
- $(AM_V_GEN)sed -r -n 's/^ +([a-zA-Z0-9_]+);/\1,/p' $< >> $@
- $(AM_V_at)printf '};\nint main(void) {\n' >> $@
- $(AM_V_at)printf 'unsigned i; for (i=0;i<sizeof(functions)/sizeof(void*);i++) printf("%%p\\n", functions[i]);\n' >> $@
- $(AM_V_at)printf 'return 0; }\n' >> $@
-endef
-
-at.dirlocal += systemd.sed_files
diff --git a/build-aux/Makefile.once.head/30-am.mk b/build-aux/Makefile.once.head/30-am.mk
new file mode 100644
index 0000000000..9049f2c88a
--- /dev/null
+++ b/build-aux/Makefile.once.head/30-am.mk
@@ -0,0 +1,28 @@
+mod.am.description = Support for Automake variables (systemd specific)
+mod.am.depends += gnuconf
+
+am.inst2noinst_DATA = $(notdir \
+ $(patsubst $(sysusersdir)/%.conf,%.sysusers,\
+ $(patsubst $(sysctldir)/%.conf,%.sysctl,\
+ $1)))
+am.var_PROGRAMS = $1_SOURCES nodist_$1_SOURCES $1_CFLAGS $1_CPPFLAGS $1_LDFLAGS $1_LDADD
+am.var_LTLIBRARIES = $1_SOURCES nodist_$1_SOURCES $1_CFLAGS $1_CPPFLAGS $1_LDFLAGS $1_LIBADD
+
+am.INSTALL_PROGRAM ?= $(INSTALL_PROGRAM) $< $@
+am.INSTALL_SCRIPT ?= $(INSTALL) $< $@
+am.INSTALL_LTLIBRARY ?= $(INSTALL) $< $@
+am.INSTALL_DATA ?= $(INSTALL_DATA) $< $@
+
+################################################################################
+
+# this list of primaries is based on the Automake 1.15 manual
+am.primaries ?= PROGRAMS LIBRARIES LTLIBRARIES LISP PYTHON JAVA SCRIPTS DATA HEADERS MANS TEXINFOS
+$(foreach p,$(am.primaries),$(eval am.inst2noinst_$p ?= $$(notdir $$1)))
+
+am.file2var = $(subst -,_,$(subst .,_,$1))
+am.file2sources = $(addprefix $(srcdir)/,$(notdir $($(am.file2var)_SOURCES)))
+am.file2sources += $(addprefix $(outdir)/,$(notdir $(nodist_$(am.file2var)_SOURCES)))
+am.file2.o = $(patsubst $(srcdir)/%,$(outdir)/%,$(patsubst %.c,%.o ,$(filter %.c,$(am.file2sources))))
+am.file2.lo = $(patsubst %.o,%.lo,$(am.file2.o))
+am.file2lib = $(foreach l, $($(am.file2var)_$2),$(if $(filter lib%.la,$l), $($(l:.la=).DEPENDS) , $l ))
+am.file2cpp = $(foreach l,$1 $($(am.file2var)_$2),$(if $(filter lib%.la,$l), $($(l:.la=).CPPFLAGS) , ))
diff --git a/build-aux/Makefile.once.head/30-automake2autothing.mk b/build-aux/Makefile.once.head/30-automake2autothing.mk
deleted file mode 100644
index ee21fba45a..0000000000
--- a/build-aux/Makefile.once.head/30-automake2autothing.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-am.bindirs = bin rootbin libexec rootlibexec systemgenerator udevlibexec
-at.dirlocal += am.CFLAGS am.CPPFLAGS am.LDFLAGS am.LIBTOOLFLAGS
-at.dirlocal += noinst_LTLIBRARIES lib_LTLIBRARIES
-at.dirlocal += $(addsuffix _PROGRAMS,noinst $(am.bindirs))
-at.dirlocal += pkgconfiglib_DATA
-automake_name = $(subst -,_,$(subst .,_,$1))
-automake_sources = $(addprefix $(outdir)/,$(notdir $($(automake_name)_SOURCES) $(nodist_$(automake_name)_SOURCES)))
-automake_lo = $(patsubst %.c,%.lo,$(filter %.c,$(automake_sources)))
-automake_o = $(patsubst %.c,%.o,$(filter %.c,$(automake_sources)))
-automake_lib = $(foreach l, $($(automake_name)_$2),$(if $(filter lib%.la,$l), $($(l:.la=).DEPENDS) , $l ))
-automake_cpp = $(foreach l,$1 $($(automake_name)_$2),$(if $(filter lib%.la,$l), $($(l:.la=).CPPFLAGS) , ))
diff --git a/build-aux/Makefile.once.head/zz-mod.mk b/build-aux/Makefile.once.head/zz-mod.mk
new file mode 100644
index 0000000000..3bf6398e13
--- /dev/null
+++ b/build-aux/Makefile.once.head/zz-mod.mk
@@ -0,0 +1,24 @@
+# Copyright (C) 2016 Luke Shumaker
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program 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 Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+mod.mod.description = Print information about Autothing modules
+
+_mod.target = at-mod-info
+_mod.modules := $(sort $(patsubst %.mk,%,$(filter %.mk,$(subst -, ,$(notdir $(wildcard $(topsrcdir)/build-aux/Makefile.*/??-*.mk))))))
+_mod.quote = '$(subst ','\'',$1)'
+
+_mod.vars = $(filter $(addsuffix .%,$(_mod.modules)),$(.VARIABLES))
+_mod.once := $(_mod.vars)
+_mod.each :=
diff --git a/build-aux/Makefile.once.tail/00-dist.mk b/build-aux/Makefile.once.tail/00-dist.mk
index b8b7733319..6c6aaedbce 100644
--- a/build-aux/Makefile.once.tail/00-dist.mk
+++ b/build-aux/Makefile.once.tail/00-dist.mk
@@ -16,12 +16,12 @@
_dist.copyfile = $(MKDIR_P) $(dir $2) && $(CP) -T $1 $2
_dist.addfile = $(call _dist.copyfile,$3,$2/$(call at.relto,$1,$3))
$(topoutdir)/$(dist.pkgname)-$(dist.version): $(foreach v,$(filter std.src_files/% std.gen_files/%,$(.VARIABLES)),$($v))
- $(RM) -r $@ $(@D)/tmp.$(@F)
- $(MKDIR) $(@D)/tmp.$(@F)
- $(foreach f,$^,$(call _dist.addfile,$(topsrcdir),$(@D)/tmp.$(@F),$f)$(at.nl))
- $(MV) $(@D)/tmp.$(@F) $@ || $(RM) -r $(@D)/tmp.$(@F)
+ $(RM) -r $@ $(@D)/.tmp.$(@F)
+ $(MKDIR) $(@D)/.tmp.$(@F)
+ $(foreach f,$^,$(call _dist.addfile,$(topsrcdir),$(@D)/.tmp.$(@F),$f)$(at.nl))
+ $(MV) $(@D)/.tmp.$(@F) $@ || $(RM) -r $(@D)/.tmp.$(@F)
-$(topoutdir)/$(dist.pkgname)-$(dist.version).tar: $(topoutdir)/$(dist.pkgname)-$(dist.version)
+$(topoutdir)/$(dist.pkgname)-$(dist.version).tar: %.tar: %
$(TAR) cf $@ -C $(<D) $(<F)
-$(topoutdir)/$(dist.pkgname)-$(dist.version).tar.gz: $(topoutdir)/$(dist.pkgname)-$(dist.version).tar
+$(topoutdir)/$(dist.pkgname)-$(dist.version).tar.gz: %.gz: %
$(GZIP) $(GZIPFLAGS) < $< > $@
diff --git a/build-aux/Makefile.once.tail/00-mod.mk b/build-aux/Makefile.once.tail/00-mod.mk
new file mode 100644
index 0000000000..68350f09ea
--- /dev/null
+++ b/build-aux/Makefile.once.tail/00-mod.mk
@@ -0,0 +1,32 @@
+# Copyright (C) 2016 Luke Shumaker
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program 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 Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+$(_mod.target):
+ @printf 'Autothing modules used in this project:\n'
+ @printf ' - %s\n' $(foreach _mod.tmp,$(_mod.modules),$(call _mod.quote,$(_mod.tmp)))
+$(addprefix $(_mod.target)/,$(_mod.modules)): $(_mod.target)/%:
+ @printf 'Module : %s ' $(call _mod.quote,$*)
+ @$(if $(at.mod.$*.description),printf ' - %s' $(call _mod.quote,mod.$*.description))
+ @echo
+ @echo Depends on : $(mod.$*.depends)
+ @echo User configuration:
+ @egrep '^\s*[^:#]+\s*\?=' $(topsrcdir)/build-aux/Makefile.once.head/??-$*.mk 2>/dev/null | sed 's|^\s*||;s|?=|:' | grep -v -e ^'_' -e ^'$*' | column -t -s: |sed 's|^| |'
+ @echo Developer global inputs:
+ @egrep '^\s*[^:#]+\s*\?=' $(topsrcdir)/build-aux/Makefile.once.head/??-$*.mk 2>/dev/null | sed 's|^\s*||;s|?=|:' | grep ^'$*\.' | column -t -s: |sed 's|^| |'
+ @echo Developer per-directory inputs:
+ @egrep '^\s*[^:#]+\s*\?=' $(topsrcdir)/build-aux/Makefile.each.head/??-$*.mk 2>/dev/null | sed 's|^\s*||;s|?=|:' | grep ^'$*\.' | column -t -s: |sed 's|^| |'
+ @echo Developer outputs:
+ @egrep '^\s*[^:#]+\s*(|:|::)=' $(topsrcdir)/build-aux/Makefile.once.head/??-$*.mk 2>/dev/null | sed 's|^\s*||;s|?=|:' | grep ^'$*\.' | column -t -s: |sed 's|^| |'
+.PHONY: $(addprefix mod/,$(_mod.modules))
diff --git a/build-aux/Makefile.once.tail/00-noop.mk b/build-aux/Makefile.once.tail/00-noop.mk
new file mode 100644
index 0000000000..bac2ec11dd
--- /dev/null
+++ b/build-aux/Makefile.once.tail/00-noop.mk
@@ -0,0 +1,2 @@
+noop:
+.PHONY: noop
diff --git a/build-aux/Makefile.once.tail/20-systemd.mk b/build-aux/Makefile.once.tail/10-sd.mk
index d4b63baad1..228d4d0db7 100644
--- a/build-aux/Makefile.once.tail/20-systemd.mk
+++ b/build-aux/Makefile.once.tail/10-sd.mk
@@ -21,9 +21,9 @@
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
-autogen_files = aclocal.m4 automake.mk.in config.h.in configure po/Makefile.in.in
-# $*=% had better be $(topsrcdir), but we can't enforce that
-$(addprefix %/,$(autogen_files)): %/configure.ac %/autogen.sh
+_sd.autogen_files = aclocal.m4 automake.mk.in config.h.in configure po/Makefile.in.in
+# `$*`/`%` had better be $(topsrcdir), but we can't enforce that
+$(addprefix %/,$(_sd.autogen_files)): %/configure.ac %/autogen.sh
cd $(topsrcdir) && ./autogen.sh
config_files = config.mk automake.mk autoconf.mk gnustandards.mk po/Makefile.in
@@ -51,21 +51,21 @@ valgrind-tests: $(TESTS)
x="\n\n"; \
done
-exported-%: %
- $(AM_V_GEN)$(NM) -g --defined-only $(builddir)/.libs/$(<:.la=.so) 2>&1 /dev/null | grep " T " | cut -d" " -f3 > $@
-
-exported: $(addprefix exported-, $(lib_LTLIBRARIES))
- $(AM_V_GEN)sort -u $^ > $@
-
-.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 \
- echo " Symbol $$symbol() is documented." ; \
- else \
- echo "‣ Symbol $$symbol() lacks documentation." ; \
- fi ; \
- done
+# exported-%: %
+# $(AM_V_GEN)$(NM) -g --defined-only $(builddir)/.libs/$(<:.la=.so) 2>&1 /dev/null | grep " T " | cut -d" " -f3 > $@
+
+# exported: $(addprefix exported-, $(lib_LTLIBRARIES))
+# $(AM_V_GEN)sort -u $^ > $@
+
+# .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 \
+# echo " Symbol $$symbol() is documented." ; \
+# else \
+# echo "‣ Symbol $$symbol() lacks documentation." ; \
+# fi ; \
+# done
OBJECT_VARIABLES:=$(filter %_OBJECTS,$(.VARIABLES))
ALL_OBJECTS:=$(foreach v,$(OBJECT_VARIABLES),$($(v)))
diff --git a/build-aux/Makefile.tail.mk b/build-aux/Makefile.tail.mk
index a8b3d8938f..136e483837 100644
--- a/build-aux/Makefile.tail.mk
+++ b/build-aux/Makefile.tail.mk
@@ -17,36 +17,26 @@
include $(call _at.reverse,$(sort $(wildcard $(topsrcdir)/build-aux/Makefile.each.tail/*.mk)))
-# Move all of the dirlocal variables to their namespaced version
-$(foreach v,$(at.dirlocal),$(eval $v/$(outdir) := $$($v)))
-$(foreach v,$(at.dirlocal),$(eval undefine $v))
-
-# Adjust subdirs and depdirs to be relative to $(outdir)
-at.subdirs/$(outdir) := $(sort $(patsubst %/,%,$(call at.addprefix,$(outdir)/,$(at.subdirs/$(outdir)))))
-at.depdirs/$(outdir) := $(sort $(patsubst %/,%,$(call at.addprefix,$(outdir)/,$(at.depdirs/$(outdir)))))
-
-# Remember that this is a directory that we've visited
-_at.outdirs := $(_at.outdirs) $(outdir)
-
-# Generic phony target declarations:
-# mark them phony
-.PHONY: $(addprefix $(outdir)/,$(at.phony))
-# have them depend on subdirs
-$(foreach t,$(at.phony),$(eval $(outdir)/$t: $(addsuffix /$t,$(at.subdirs/$(outdir)))))
-
-# Include Makefiles from other directories
+_at.tmp_targets := $(at.targets)
+_at.tmp_subdirs := $(call at.addprefix,$(outdir),$(at.subdirs))
+
+# Clean the environment
+$(foreach _at.tmp_variable,$(filter-out _at.tmp_variable $(_at.VARIABLES),$(.VARIABLES)), \
+ $(foreach _at.tmp_target,$(_at.tmp_targets), \
+ $(if $(filter recursive,$(flavor $(_at.tmp_variable))), \
+ $(eval $(_at.tmp_target): private $(_at.tmp_variable) = $(subst $(at.nl),$$(at.nl),$(value $(_at.tmp_variable)))), \
+ $(eval $(_at.tmp_target): private $(_at.tmp_variable) := $$($(_at.tmp_variable))))) \
+ $(eval undefine $(_at.tmp_variable)))
+
+# Recurse
$(foreach _at.NO_ONCE,y,\
- $(foreach makefile,$(call at.path,$(addsuffix /$(at.Makefile),$(at.subdirs/$(outdir)) $(at.depdirs/$(outdir)))),\
- $(eval include $(filter-out $(_at.included_makefiles),$(makefile)))))
+ $(foreach _at.tmp,$(call at.path,$(addsuffix /$(at.Makefile),$(_at.tmp_subdirs))),\
+ $(if $(filter-out $(_at.MAKEFILE_LIST),$(abspath $(_at.tmp))),\
+ $(eval include $(_at.tmp)))))
# This bit only gets evaluated once, after all of the other Makefiles are read
ifeq ($(origin _at.NO_ONCE),undefined)
-outdir = /bogus
-srcdir = /bogus
-
-$(foreach v,$(at.dirlocal),$(eval $v=))
-
include $(call _at.reverse,$(sort $(wildcard $(topsrcdir)/build-aux/Makefile.once.tail/*.mk)))
endif # _at.NO_ONCE
diff --git a/build-aux/no-builtin-variables.mk b/build-aux/no-builtin-variables.mk
deleted file mode 100644
index c3aef5874f..0000000000
--- a/build-aux/no-builtin-variables.mk
+++ /dev/null
@@ -1,15 +0,0 @@
-MAKEFLAGS += --no-builtin-variables
-
-# This version is more correct, but is slower:
-# $(foreach v,$(shell bash -c 'comm -23 <(env -i $(MAKE) -f - <<<"\$$(info \$$(.VARIABLES))all:"|sed "s/ /\n/g"|sort) <(env -i $(MAKE) -R -f - <<<"\$$(info \$$(.VARIABLES))all:"|sed "s/ /\n/g"|sort)'),
-# $(if $(filter default,$(origin $v)),$(eval undefine $v)))
-
-_default_variables = $(foreach v,$(.VARIABLES),$(if $(filter default,$(origin $v)),$v))
-$(foreach v,$(filter-out .% MAKE% SUFFIXES,$(_default_variables))\
- $(filter .LIBPATTERNS MAKEINFO,$(_default_variables)),\
- $(eval undefine $v))
-undefine _default_variables
-
-# Because Make uses .LIBPATTERNS internally, it should always be
-# defined in case --warn-undefined-variables
-.LIBPATTERNS ?=
diff --git a/config.mk.in b/config.mk.in
index 2c839fb81f..868df370c1 100644
--- a/config.mk.in
+++ b/config.mk.in
@@ -25,8 +25,6 @@ ifeq ($(origin topsrcdir),undefined)
topoutdir := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
topsrcdir := $(topoutdir)/@top_srcdir@
-MAKEFLAGS += --warn-undefined-variables
-include $(topsrcdir)/build-aux/no-builtin-variables.mk
.LIBPATTERNS = lib%.so lib%.a
include $(topoutdir)/gnustandards.mk
diff --git a/f.org b/f.org
new file mode 100644
index 0000000000..9d5ed3d8c3
--- /dev/null
+++ b/f.org
@@ -0,0 +1,44 @@
+| check | DATA | | PROGRAMS | |
+| noinst | DATA | LTLIBRARIES | PROGRAMS | |
+|----------------------+------+-------------+----------+---------|
+| lib | | LTLIBRARIES | | |
+| pamlib | | LTLIBRARIES | | |
+|----------------------+------+-------------+----------+---------|
+| bin | | | PROGRAMS | SCRIPTS |
+| kernelinstall | | | | SCRIPTS |
+| rootbin | | | PROGRAMS | |
+| systemgenerator | | | PROGRAMS | |
+| udevlibexec | | | PROGRAMS | |
+| xinitrc | | | | SCRIPTS |
+|----------------------+------+-------------+----------+---------|
+| rootlibexec | DATA | | PROGRAMS | |
+|----------------------+------+-------------+----------+---------|
+| bashcompletion | DATA | | | |
+| bootlib | DATA | | | |
+| catalog | DATA | | | |
+| dbuspolicy | DATA | | | |
+| dbussystemservice | DATA | | | |
+| doc | DATA | | | |
+| etc | DATA | | | |
+| gatewayddocumentroot | DATA | | | |
+| network | DATA | | | |
+| pam | DATA | | | |
+| pamconf | DATA | | | |
+| pkgconfigdata | DATA | | | |
+| pkgconfiglib | DATA | | | |
+| pkgdata | DATA | | | |
+| pkgsysconf | DATA | | | |
+| polkitpolicy | DATA | | | |
+| rpmmacros | DATA | | | |
+| sysctl | DATA | | | |
+| systempreset | DATA | | | |
+| systemunit | DATA | | | |
+| sysusers | DATA | | | |
+| sysvinit | DATA | | | |
+| tmpfiles | DATA | | | |
+| udevconf | DATA | | | |
+| udevhwdb | DATA | | | |
+| udevrules | DATA | | | |
+| userunit | DATA | | | |
+| varlog | DATA | | | |
+| zshcompletion | DATA | | | |
diff --git a/shell-completion/bash/busctl b/src/busctl/busctl.completion.bash
index 6a770b1b84..6a770b1b84 100644
--- a/shell-completion/bash/busctl
+++ b/src/busctl/busctl.completion.bash
diff --git a/shell-completion/zsh/_busctl b/src/busctl/busctl.completion.zsh
index a425b8c700..a425b8c700 100644
--- a/shell-completion/zsh/_busctl
+++ b/src/busctl/busctl.completion.zsh
diff --git a/shell-completion/bash/bootctl b/src/grp-boot/bootctl/bootctl.completion.bash
index c86ec7edc9..c86ec7edc9 100644
--- a/shell-completion/bash/bootctl
+++ b/src/grp-boot/bootctl/bootctl.completion.bash
diff --git a/shell-completion/zsh/_bootctl b/src/grp-boot/bootctl/bootctl.completion.zsh
index 0e1b0a5562..0e1b0a5562 100644
--- a/shell-completion/zsh/_bootctl
+++ b/src/grp-boot/bootctl/bootctl.completion.zsh
diff --git a/src/grp-boot/kernel-install/bash-completion_kernel-install b/src/grp-boot/kernel-install/kernel-install.completion.bash
index 7cd2494cf7..7cd2494cf7 100644
--- a/src/grp-boot/kernel-install/bash-completion_kernel-install
+++ b/src/grp-boot/kernel-install/kernel-install.completion.bash
diff --git a/src/grp-boot/kernel-install/zsh-completion_kernel-install b/src/grp-boot/kernel-install/kernel-install.completion.zsh
index 4fdd3a4ae7..4fdd3a4ae7 100644
--- a/src/grp-boot/kernel-install/zsh-completion_kernel-install
+++ b/src/grp-boot/kernel-install/kernel-install.completion.zsh
diff --git a/shell-completion/bash/coredumpctl b/src/grp-coredump/coredumpctl/coredumpctl.completion.bash
index 6091677506..6091677506 100644
--- a/shell-completion/bash/coredumpctl
+++ b/src/grp-coredump/coredumpctl/coredumpctl.completion.bash
diff --git a/shell-completion/zsh/_coredumpctl b/src/grp-coredump/coredumpctl/coredumpctl.completion.zsh
index e4c04a697f..e4c04a697f 100644
--- a/shell-completion/zsh/_coredumpctl
+++ b/src/grp-coredump/coredumpctl/coredumpctl.completion.zsh
diff --git a/src/grp-coredump/systemd-coredump/.gitignore b/src/grp-coredump/systemd-coredump/.gitignore
new file mode 100644
index 0000000000..768e3d4d9f
--- /dev/null
+++ b/src/grp-coredump/systemd-coredump/.gitignore
@@ -0,0 +1 @@
+/50-coredump.sysctl
diff --git a/sysctl.d/50-coredump.conf.in b/src/grp-coredump/systemd-coredump/50-coredump.sysctl.in
index 5a25de4512..5a25de4512 100644
--- a/sysctl.d/50-coredump.conf.in
+++ b/src/grp-coredump/systemd-coredump/50-coredump.sysctl.in
diff --git a/src/grp-coredump/systemd-coredump/systemd-coredump.sysusers b/src/grp-coredump/systemd-coredump/systemd-coredump.sysusers
new file mode 100644
index 0000000000..bc0816ca5e
--- /dev/null
+++ b/src/grp-coredump/systemd-coredump/systemd-coredump.sysusers
@@ -0,0 +1,8 @@
+# This file is part of systemd.
+#
+# 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.
+
+u systemd-coredump - "systemd Core Dumper"
diff --git a/shell-completion/bash/systemd-detect-virt b/src/grp-initutils/systemd-detect-virt/systemd-detect-virt.completion.bash
index df06c29841..df06c29841 100644
--- a/shell-completion/bash/systemd-detect-virt
+++ b/src/grp-initutils/systemd-detect-virt/systemd-detect-virt.completion.bash
diff --git a/sysctl.d/50-default.conf b/src/grp-initutils/systemd-sysctl/50-default.sysctl
index def151bb84..def151bb84 100644
--- a/sysctl.d/50-default.conf
+++ b/src/grp-initutils/systemd-sysctl/50-default.sysctl
diff --git a/sysusers.d/basic.conf.in b/src/grp-initutils/systemd-sysusers/basic.sysusers.in
index b2dc5ebd4f..b2dc5ebd4f 100644
--- a/sysusers.d/basic.conf.in
+++ b/src/grp-initutils/systemd-sysusers/basic.sysusers.in
diff --git a/shell-completion/zsh/_systemd-tmpfiles b/src/grp-initutils/systemd-tmpfiles/systemd-tmpfiles.completion.zsh
index 6ff02e5d98..6ff02e5d98 100644
--- a/shell-completion/zsh/_systemd-tmpfiles
+++ b/src/grp-initutils/systemd-tmpfiles/systemd-tmpfiles.completion.zsh
diff --git a/sysusers.d/systemd-remote.conf.m4 b/src/grp-journal/grp-remote/systemd-remote.sysusers.m4
index 0e9d71cdd0..0e9d71cdd0 100644
--- a/sysusers.d/systemd-remote.conf.m4
+++ b/src/grp-journal/grp-remote/systemd-remote.sysusers.m4
diff --git a/shell-completion/bash/journalctl b/src/grp-journal/journalctl/journalctl.completion.bash
index 7c8a9ce361..7c8a9ce361 100644
--- a/shell-completion/bash/journalctl
+++ b/src/grp-journal/journalctl/journalctl.completion.bash
diff --git a/shell-completion/zsh/_journalctl b/src/grp-journal/journalctl/journalctl.completion.zsh
index 2bee23b6d3..2bee23b6d3 100644
--- a/shell-completion/zsh/_journalctl
+++ b/src/grp-journal/journalctl/journalctl.completion.zsh
diff --git a/shell-completion/bash/systemd-cat b/src/grp-journal/systemd-cat/systemd-cat.completion.bash
index 8d84042af1..8d84042af1 100644
--- a/shell-completion/bash/systemd-cat
+++ b/src/grp-journal/systemd-cat/systemd-cat.completion.bash
diff --git a/src/grp-journal/systemd-journald/systemd-journald.sysusers b/src/grp-journal/systemd-journald/systemd-journald.sysusers
new file mode 100644
index 0000000000..dcb01f606a
--- /dev/null
+++ b/src/grp-journal/systemd-journald/systemd-journald.sysusers
@@ -0,0 +1,8 @@
+# This file is part of systemd.
+#
+# 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.
+
+g systemd-journal - -
diff --git a/docs/sysvinit/.gitignore b/src/grp-journal/var-log/.gitignore
index c3fea7424f..c3fea7424f 100644
--- a/docs/sysvinit/.gitignore
+++ b/src/grp-journal/var-log/.gitignore
diff --git a/docs/var-log/README.in b/src/grp-journal/var-log/README.in
index 2e64fb196a..2e64fb196a 100644
--- a/docs/var-log/README.in
+++ b/src/grp-journal/var-log/README.in
diff --git a/shell-completion/bash/loginctl b/src/grp-login/loginctl/loginctl.completion.bash
index 776eca4e62..776eca4e62 100644
--- a/shell-completion/bash/loginctl
+++ b/src/grp-login/loginctl/loginctl.completion.bash
diff --git a/shell-completion/zsh/_loginctl b/src/grp-login/loginctl/loginctl.completion.zsh
index 6f6ff6e314..6f6ff6e314 100644
--- a/shell-completion/zsh/_loginctl
+++ b/src/grp-login/loginctl/loginctl.completion.zsh
diff --git a/shell-completion/zsh/_systemd-inhibit b/src/grp-login/systemd-inhibit/systemd-inhibit.completion.zsh
index 1b3247b2cd..1b3247b2cd 100644
--- a/shell-completion/zsh/_systemd-inhibit
+++ b/src/grp-login/systemd-inhibit/systemd-inhibit.completion.zsh
diff --git a/shell-completion/bash/machinectl b/src/grp-machine/machinectl/machinectl.completion.bash
index e7829ca968..e7829ca968 100644
--- a/shell-completion/bash/machinectl
+++ b/src/grp-machine/machinectl/machinectl.completion.bash
diff --git a/shell-completion/zsh/_machinectl b/src/grp-machine/machinectl/machinectl.completion.zsh
index 198fa28f7b..198fa28f7b 100644
--- a/shell-completion/zsh/_machinectl
+++ b/src/grp-machine/machinectl/machinectl.completion.zsh
diff --git a/network/80-container-host0.network b/src/grp-network/network/80-container-host0.network
index b012cf98cb..b012cf98cb 100644
--- a/network/80-container-host0.network
+++ b/src/grp-network/network/80-container-host0.network
diff --git a/network/80-container-ve.network b/src/grp-network/network/80-container-ve.network
index ac796bfb07..ac796bfb07 100644
--- a/network/80-container-ve.network
+++ b/src/grp-network/network/80-container-ve.network
diff --git a/network/80-container-vz.network b/src/grp-network/network/80-container-vz.network
index 3d532d6f60..3d532d6f60 100644
--- a/network/80-container-vz.network
+++ b/src/grp-network/network/80-container-vz.network
diff --git a/network/99-default.link b/src/grp-network/network/99-default.link
index 79538f9b29..79538f9b29 100644
--- a/network/99-default.link
+++ b/src/grp-network/network/99-default.link
diff --git a/shell-completion/bash/networkctl b/src/grp-network/networkctl/networkctl.completion.bash
index 942c7e1c00..942c7e1c00 100644
--- a/shell-completion/bash/networkctl
+++ b/src/grp-network/networkctl/networkctl.completion.bash
diff --git a/shell-completion/zsh/_networkctl b/src/grp-network/networkctl/networkctl.completion.zsh
index 61f173b78e..61f173b78e 100644
--- a/shell-completion/zsh/_networkctl
+++ b/src/grp-network/networkctl/networkctl.completion.zsh
diff --git a/src/grp-network/systemd-networkd/systemd-networkd.sysusers b/src/grp-network/systemd-networkd/systemd-networkd.sysusers
new file mode 100644
index 0000000000..208148d6b8
--- /dev/null
+++ b/src/grp-network/systemd-networkd/systemd-networkd.sysusers
@@ -0,0 +1,8 @@
+# This file is part of systemd.
+#
+# 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.
+
+u systemd-network - "systemd Network Management"
diff --git a/src/grp-resolve/systemd-resolved/systemd-resolved.sysusers b/src/grp-resolve/systemd-resolved/systemd-resolved.sysusers
new file mode 100644
index 0000000000..5872bf2db7
--- /dev/null
+++ b/src/grp-resolve/systemd-resolved/systemd-resolved.sysusers
@@ -0,0 +1,8 @@
+# This file is part of systemd.
+#
+# 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.
+
+u systemd-resolve - "systemd Resolver"
diff --git a/shell-completion/bash/systemd-analyze b/src/grp-system/grp-utils/systemd-analyze/systemd-analyze.completion.bash
index 7a5f46ba1d..7a5f46ba1d 100644
--- a/shell-completion/bash/systemd-analyze
+++ b/src/grp-system/grp-utils/systemd-analyze/systemd-analyze.completion.bash
diff --git a/shell-completion/zsh/_systemd-analyze b/src/grp-system/grp-utils/systemd-analyze/systemd-analyze.completion.zsh
index efafddc686..efafddc686 100644
--- a/shell-completion/zsh/_systemd-analyze
+++ b/src/grp-system/grp-utils/systemd-analyze/systemd-analyze.completion.zsh
diff --git a/shell-completion/bash/systemd-delta b/src/grp-system/grp-utils/systemd-delta/systemd-delta.completion.bash
index cb1732895f..cb1732895f 100644
--- a/shell-completion/bash/systemd-delta
+++ b/src/grp-system/grp-utils/systemd-delta/systemd-delta.completion.bash
diff --git a/shell-completion/zsh/_systemd-delta b/src/grp-system/grp-utils/systemd-delta/systemd-delta.completion.zsh
index 757f1b66fb..757f1b66fb 100644
--- a/shell-completion/zsh/_systemd-delta
+++ b/src/grp-system/grp-utils/systemd-delta/systemd-delta.completion.zsh
diff --git a/shell-completion/bash/systemd-run b/src/grp-system/grp-utils/systemd-run/systemd-run.completion.bash
index 8152b021e7..8152b021e7 100644
--- a/shell-completion/bash/systemd-run
+++ b/src/grp-system/grp-utils/systemd-run/systemd-run.completion.bash
diff --git a/shell-completion/zsh/_systemd-run b/src/grp-system/grp-utils/systemd-run/systemd-run.completion.zsh
index c425085cd8..c425085cd8 100644
--- a/shell-completion/zsh/_systemd-run
+++ b/src/grp-system/grp-utils/systemd-run/systemd-run.completion.zsh
diff --git a/system-preset/90-systemd.preset b/src/grp-system/system-preset/90-systemd.preset
index ee1b864bcf..ee1b864bcf 100644
--- a/system-preset/90-systemd.preset
+++ b/src/grp-system/system-preset/90-systemd.preset
diff --git a/xorg/50-systemd-user.sh b/src/grp-system/systemd/50-systemd-user.xorg
index 4d49767228..4d49767228 100755
--- a/xorg/50-systemd-user.sh
+++ b/src/grp-system/systemd/50-systemd-user.xorg
diff --git a/docs/var-log/.gitignore b/src/grp-system/sysvinit/.gitignore
index c3fea7424f..c3fea7424f 100644
--- a/docs/var-log/.gitignore
+++ b/src/grp-system/sysvinit/.gitignore
diff --git a/docs/sysvinit/README.in b/src/grp-system/sysvinit/README.in
index 996402d06b..996402d06b 100644
--- a/docs/sysvinit/README.in
+++ b/src/grp-system/sysvinit/README.in
diff --git a/shell-completion/bash/timedatectl b/src/grp-timedate/timedatectl/timedatectl.completion.bash
index a57fbd2546..a57fbd2546 100644
--- a/shell-completion/bash/timedatectl
+++ b/src/grp-timedate/timedatectl/timedatectl.completion.bash
diff --git a/shell-completion/zsh/_timedatectl b/src/grp-timedate/timedatectl/timedatectl.completion.zsh
index dfdcfebb3c..dfdcfebb3c 100644
--- a/shell-completion/zsh/_timedatectl
+++ b/src/grp-timedate/timedatectl/timedatectl.completion.zsh
diff --git a/hwdb/.gitignore b/src/grp-udev/hwdb/.gitignore
index 00b977a3b5..00b977a3b5 100644
--- a/hwdb/.gitignore
+++ b/src/grp-udev/hwdb/.gitignore
diff --git a/hwdb/20-OUI.hwdb b/src/grp-udev/hwdb/20-OUI.hwdb
index d852e7b8b3..d852e7b8b3 100644
--- a/hwdb/20-OUI.hwdb
+++ b/src/grp-udev/hwdb/20-OUI.hwdb
diff --git a/hwdb/20-acpi-vendor.hwdb b/src/grp-udev/hwdb/20-acpi-vendor.hwdb
index 9b3b0094d5..9b3b0094d5 100644
--- a/hwdb/20-acpi-vendor.hwdb
+++ b/src/grp-udev/hwdb/20-acpi-vendor.hwdb
diff --git a/hwdb/20-bluetooth-vendor-product.hwdb b/src/grp-udev/hwdb/20-bluetooth-vendor-product.hwdb
index 60b62b0b38..60b62b0b38 100644
--- a/hwdb/20-bluetooth-vendor-product.hwdb
+++ b/src/grp-udev/hwdb/20-bluetooth-vendor-product.hwdb
diff --git a/hwdb/20-net-ifname.hwdb b/src/grp-udev/hwdb/20-net-ifname.hwdb
index 2408dc172f..2408dc172f 100644
--- a/hwdb/20-net-ifname.hwdb
+++ b/src/grp-udev/hwdb/20-net-ifname.hwdb
diff --git a/hwdb/20-pci-classes.hwdb b/src/grp-udev/hwdb/20-pci-classes.hwdb
index 3c0c465e5f..3c0c465e5f 100644
--- a/hwdb/20-pci-classes.hwdb
+++ b/src/grp-udev/hwdb/20-pci-classes.hwdb
diff --git a/hwdb/20-pci-vendor-model.hwdb b/src/grp-udev/hwdb/20-pci-vendor-model.hwdb
index f068e53fbc..f068e53fbc 100644
--- a/hwdb/20-pci-vendor-model.hwdb
+++ b/src/grp-udev/hwdb/20-pci-vendor-model.hwdb
diff --git a/hwdb/20-sdio-classes.hwdb b/src/grp-udev/hwdb/20-sdio-classes.hwdb
index 72cce9d898..72cce9d898 100644
--- a/hwdb/20-sdio-classes.hwdb
+++ b/src/grp-udev/hwdb/20-sdio-classes.hwdb
diff --git a/hwdb/20-sdio-vendor-model.hwdb b/src/grp-udev/hwdb/20-sdio-vendor-model.hwdb
index 9cf34b2a39..9cf34b2a39 100644
--- a/hwdb/20-sdio-vendor-model.hwdb
+++ b/src/grp-udev/hwdb/20-sdio-vendor-model.hwdb
diff --git a/hwdb/20-usb-classes.hwdb b/src/grp-udev/hwdb/20-usb-classes.hwdb
index 418d39bb84..418d39bb84 100644
--- a/hwdb/20-usb-classes.hwdb
+++ b/src/grp-udev/hwdb/20-usb-classes.hwdb
diff --git a/hwdb/20-usb-vendor-model.hwdb b/src/grp-udev/hwdb/20-usb-vendor-model.hwdb
index cef2ade2e9..cef2ade2e9 100644
--- a/hwdb/20-usb-vendor-model.hwdb
+++ b/src/grp-udev/hwdb/20-usb-vendor-model.hwdb
diff --git a/hwdb/60-evdev.hwdb b/src/grp-udev/hwdb/60-evdev.hwdb
index 90acb44a1c..90acb44a1c 100644
--- a/hwdb/60-evdev.hwdb
+++ b/src/grp-udev/hwdb/60-evdev.hwdb
diff --git a/hwdb/60-keyboard.hwdb b/src/grp-udev/hwdb/60-keyboard.hwdb
index fd49b03493..fd49b03493 100644
--- a/hwdb/60-keyboard.hwdb
+++ b/src/grp-udev/hwdb/60-keyboard.hwdb
diff --git a/hwdb/70-mouse.hwdb b/src/grp-udev/hwdb/70-mouse.hwdb
index a5b39dc41e..a5b39dc41e 100644
--- a/hwdb/70-mouse.hwdb
+++ b/src/grp-udev/hwdb/70-mouse.hwdb
diff --git a/hwdb/70-pointingstick.hwdb b/src/grp-udev/hwdb/70-pointingstick.hwdb
index b2af467d5f..b2af467d5f 100644
--- a/hwdb/70-pointingstick.hwdb
+++ b/src/grp-udev/hwdb/70-pointingstick.hwdb
diff --git a/hwdb/Makefile b/src/grp-udev/hwdb/Makefile
index 3f89c1ed8f..3f89c1ed8f 100644
--- a/hwdb/Makefile
+++ b/src/grp-udev/hwdb/Makefile
diff --git a/hwdb/ids-update.pl b/src/grp-udev/hwdb/ids-update.pl
index 03dd00b38d..03dd00b38d 100755
--- a/hwdb/ids-update.pl
+++ b/src/grp-udev/hwdb/ids-update.pl
diff --git a/hwdb/sdio.ids b/src/grp-udev/hwdb/sdio.ids
index d61729744e..d61729744e 100644
--- a/hwdb/sdio.ids
+++ b/src/grp-udev/hwdb/sdio.ids
diff --git a/rules/.gitignore b/src/grp-udev/rules/.gitignore
index 93a50ddd80..93a50ddd80 100644
--- a/rules/.gitignore
+++ b/src/grp-udev/rules/.gitignore
diff --git a/rules/50-udev-default.rules b/src/grp-udev/rules/50-udev-default.rules
index e9eeb8518e..e9eeb8518e 100644
--- a/rules/50-udev-default.rules
+++ b/src/grp-udev/rules/50-udev-default.rules
diff --git a/rules/60-block.rules b/src/grp-udev/rules/60-block.rules
index c74caca49f..c74caca49f 100644
--- a/rules/60-block.rules
+++ b/src/grp-udev/rules/60-block.rules
diff --git a/rules/60-cdrom_id.rules b/src/grp-udev/rules/60-cdrom_id.rules
index 5c3b52ebb9..5c3b52ebb9 100644
--- a/rules/60-cdrom_id.rules
+++ b/src/grp-udev/rules/60-cdrom_id.rules
diff --git a/rules/60-drm.rules b/src/grp-udev/rules/60-drm.rules
index 1ed3e445f2..1ed3e445f2 100644
--- a/rules/60-drm.rules
+++ b/src/grp-udev/rules/60-drm.rules
diff --git a/rules/60-evdev.rules b/src/grp-udev/rules/60-evdev.rules
index ade7e7f646..ade7e7f646 100644
--- a/rules/60-evdev.rules
+++ b/src/grp-udev/rules/60-evdev.rules
diff --git a/rules/60-persistent-alsa.rules b/src/grp-udev/rules/60-persistent-alsa.rules
index 8154e2dbb5..8154e2dbb5 100644
--- a/rules/60-persistent-alsa.rules
+++ b/src/grp-udev/rules/60-persistent-alsa.rules
diff --git a/rules/60-persistent-input.rules b/src/grp-udev/rules/60-persistent-input.rules
index 0e33e68384..0e33e68384 100644
--- a/rules/60-persistent-input.rules
+++ b/src/grp-udev/rules/60-persistent-input.rules
diff --git a/rules/60-persistent-storage-tape.rules b/src/grp-udev/rules/60-persistent-storage-tape.rules
index f2eabd92a8..f2eabd92a8 100644
--- a/rules/60-persistent-storage-tape.rules
+++ b/src/grp-udev/rules/60-persistent-storage-tape.rules
diff --git a/rules/60-persistent-storage.rules b/src/grp-udev/rules/60-persistent-storage.rules
index 408733915c..408733915c 100644
--- a/rules/60-persistent-storage.rules
+++ b/src/grp-udev/rules/60-persistent-storage.rules
diff --git a/rules/60-persistent-v4l.rules b/src/grp-udev/rules/60-persistent-v4l.rules
index 93c5ee8c27..93c5ee8c27 100644
--- a/rules/60-persistent-v4l.rules
+++ b/src/grp-udev/rules/60-persistent-v4l.rules
diff --git a/rules/60-serial.rules b/src/grp-udev/rules/60-serial.rules
index f303e27fd5..f303e27fd5 100644
--- a/rules/60-serial.rules
+++ b/src/grp-udev/rules/60-serial.rules
diff --git a/rules/64-btrfs.rules b/src/grp-udev/rules/64-btrfs.rules
index fe0100131e..fe0100131e 100644
--- a/rules/64-btrfs.rules
+++ b/src/grp-udev/rules/64-btrfs.rules
diff --git a/rules/70-mouse.rules b/src/grp-udev/rules/70-mouse.rules
index 3ea743aff9..3ea743aff9 100644
--- a/rules/70-mouse.rules
+++ b/src/grp-udev/rules/70-mouse.rules
diff --git a/rules/75-net-description.rules b/src/grp-udev/rules/75-net-description.rules
index 7e62f8b26b..7e62f8b26b 100644
--- a/rules/75-net-description.rules
+++ b/src/grp-udev/rules/75-net-description.rules
diff --git a/rules/75-probe_mtd.rules b/src/grp-udev/rules/75-probe_mtd.rules
index 8848aeeaed..8848aeeaed 100644
--- a/rules/75-probe_mtd.rules
+++ b/src/grp-udev/rules/75-probe_mtd.rules
diff --git a/rules/78-sound-card.rules b/src/grp-udev/rules/78-sound-card.rules
index 04740e8b97..04740e8b97 100644
--- a/rules/78-sound-card.rules
+++ b/src/grp-udev/rules/78-sound-card.rules
diff --git a/rules/80-drivers.rules b/src/grp-udev/rules/80-drivers.rules
index 8551f47a4b..8551f47a4b 100644
--- a/rules/80-drivers.rules
+++ b/src/grp-udev/rules/80-drivers.rules
diff --git a/rules/80-net-setup-link.rules b/src/grp-udev/rules/80-net-setup-link.rules
index 6e411a91f0..6e411a91f0 100644
--- a/rules/80-net-setup-link.rules
+++ b/src/grp-udev/rules/80-net-setup-link.rules
diff --git a/rules/99-systemd.rules.in b/src/grp-udev/rules/99-systemd.rules.in
index fb4517606d..fb4517606d 100644
--- a/rules/99-systemd.rules.in
+++ b/src/grp-udev/rules/99-systemd.rules.in
diff --git a/shell-completion/bash/udevadm b/src/grp-udev/udevadm/udevadm.completion.bash
index b828b8dd7c..b828b8dd7c 100644
--- a/shell-completion/bash/udevadm
+++ b/src/grp-udev/udevadm/udevadm.completion.bash
diff --git a/shell-completion/zsh/_udevadm b/src/grp-udev/udevadm/udevadm.completion.zsh
index bb23e64d24..bb23e64d24 100644
--- a/shell-completion/zsh/_udevadm
+++ b/src/grp-udev/udevadm/udevadm.completion.zsh
diff --git a/shell-completion/bash/systemd-path b/src/grp-utils/systemd-path/systemd-path.completion.bash
index 2f0c5f5bd7..2f0c5f5bd7 100644
--- a/shell-completion/bash/systemd-path
+++ b/src/grp-utils/systemd-path/systemd-path.completion.bash
diff --git a/shell-completion/bash/systemd-cgls b/src/systemd-cgls/systemd-cgls.completion.bash
index 0570438660..0570438660 100644
--- a/shell-completion/bash/systemd-cgls
+++ b/src/systemd-cgls/systemd-cgls.completion.bash
diff --git a/shell-completion/bash/systemd-cgtop b/src/systemd-cgtop/systemd-cgtop.completion.bash
index f1ed22fd55..f1ed22fd55 100644
--- a/shell-completion/bash/systemd-cgtop
+++ b/src/systemd-cgtop/systemd-cgtop.completion.bash
diff --git a/shell-completion/bash/systemd-nspawn b/src/systemd-nspawn/systemd-nspawn.completion.bash
index 0cf249d8ce..0cf249d8ce 100644
--- a/shell-completion/bash/systemd-nspawn
+++ b/src/systemd-nspawn/systemd-nspawn.completion.bash
diff --git a/shell-completion/zsh/_systemd-nspawn b/src/systemd-nspawn/systemd-nspawn.completion.zsh
index 3e0f667909..3e0f667909 100644
--- a/shell-completion/zsh/_systemd-nspawn
+++ b/src/systemd-nspawn/systemd-nspawn.completion.zsh
diff --git a/sysusers.d/systemd.conf.m4 b/src/systemd-timesyncd/systemd-timesyncd.sysusers
index af97509c05..4d7af7b3ae 100644
--- a/sysusers.d/systemd.conf.m4
+++ b/src/systemd-timesyncd/systemd-timesyncd.sysusers
@@ -5,16 +5,4 @@
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
-g systemd-journal - -
-m4_ifdef(`ENABLE_NETWORKD',
-u systemd-network - "systemd Network Management"
-)m4_dnl
-m4_ifdef(`ENABLE_RESOLVED',
-u systemd-resolve - "systemd Resolver"
-)m4_dnl
-m4_ifdef(`ENABLE_TIMESYNCD',
u systemd-timesync - "systemd Time Synchronization"
-)m4_dnl
-m4_ifdef(`ENABLE_COREDUMP',
-u systemd-coredump - "systemd Core Dumper"
-)m4_dnl
diff --git a/sysctl.d/.gitignore b/sysctl.d/.gitignore
deleted file mode 100644
index e326c180c3..0000000000
--- a/sysctl.d/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/50-coredump.conf
diff --git a/sysusers.d/.gitignore b/sysusers.d/.gitignore
deleted file mode 100644
index c065034d29..0000000000
--- a/sysusers.d/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-/basic.conf
-/systemd.conf
-/systemd-remote.conf
diff --git a/find_includes b/tools/find_includes
index 6dfb406fa3..6dfb406fa3 100755
--- a/find_includes
+++ b/tools/find_includes
diff --git a/fixup.sh b/tools/fixup.sh
index 651feb6cf8..651feb6cf8 100755
--- a/fixup.sh
+++ b/tools/fixup.sh
diff --git a/fixup_includes b/tools/fixup_includes
index 957733cdc0..957733cdc0 100755
--- a/fixup_includes
+++ b/tools/fixup_includes
diff --git a/move.sh b/tools/move.sh
index 4b55c869ec..4b55c869ec 100755
--- a/move.sh
+++ b/tools/move.sh
diff --git a/reset.sh b/tools/reset.sh
index 66b629c217..66b629c217 100755
--- a/reset.sh
+++ b/tools/reset.sh
diff --git a/test-header.c b/tools/test-header.c
index 76e8197013..76e8197013 100644
--- a/test-header.c
+++ b/tools/test-header.c
diff --git a/test-header.sh b/tools/test-header.sh
index b11285af7d..b11285af7d 100755
--- a/test-header.sh
+++ b/tools/test-header.sh