summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Makefile48
-rw-r--r--autoconf.mk.in40
-rw-r--r--automake.mk.am0
-rw-r--r--build-aux/Makefile.README.txt164
-rw-r--r--build-aux/Makefile.each.head/00-dist.mk20
-rw-r--r--build-aux/Makefile.each.tail/10-std.mk46
-rw-r--r--build-aux/Makefile.each.tail/20-systemd.mk53
-rw-r--r--build-aux/Makefile.each.tail/30-module.mk4
-rw-r--r--build-aux/Makefile.head.mk63
-rw-r--r--build-aux/Makefile.once.head/00-dist.mk44
-rw-r--r--build-aux/Makefile.once.head/00-gnuconf.mk160
-rw-r--r--build-aux/Makefile.once.head/00-write-ifchanged.mk1
-rw-r--r--build-aux/Makefile.once.head/10-std.mk39
-rw-r--r--build-aux/Makefile.once.head/20-systemd.mk68
-rw-r--r--build-aux/Makefile.once.tail/00-dist.mk27
-rw-r--r--build-aux/Makefile.once.tail/20-systemd.mk20
-rw-r--r--build-aux/Makefile.tail.mk51
-rw-r--r--build-aux/no-builtin-variables.mk15
-rwxr-xr-xbuild-aux/write-ifchanged25
-rw-r--r--config.mk.in263
-rw-r--r--configure.ac28
-rw-r--r--gnustandards.mk.in138
-rw-r--r--src/Makefile36
-rw-r--r--src/busctl/Makefile5
-rw-r--r--src/grp-boot/Makefile28
-rw-r--r--src/grp-boot/bootctl/Makefile9
-rw-r--r--src/grp-boot/systemd-boot/Makefile108
-rwxr-xr-xsrc/grp-boot/systemd-boot/test-efi-create-disk.sh (renamed from test/test-efi-create-disk.sh)0
-rw-r--r--src/grp-coredump/Makefile28
-rw-r--r--src/grp-coredump/coredumpctl/Makefile7
-rw-r--r--src/grp-coredump/systemd-coredump/Makefile9
-rw-r--r--src/grp-machine/Makefile29
-rw-r--r--src/grp-machine/libmachine-core/Makefile9
-rw-r--r--src/grp-machine/nss-mymachines/Makefile9
-rw-r--r--src/libbasic/Makefile9
-rw-r--r--src/libcore/loopback-setup.c1
-rw-r--r--src/libfirewall/Makefile2
-rw-r--r--src/libshared/Makefile33
-rw-r--r--src/libshared/local-addresses.c1
-rw-r--r--src/libsystemd/Makefile12
-rw-r--r--src/libsystemd/libsystemd-internal/Makefile19
l---------src/libsystemd/libsystemd-internal/sd-bus/Makefile1
l---------src/libsystemd/libsystemd-internal/sd-daemon/Makefile1
l---------src/libsystemd/libsystemd-internal/sd-device/Makefile1
l---------src/libsystemd/libsystemd-internal/sd-event/Makefile1
l---------src/libsystemd/libsystemd-internal/sd-hwdb/Makefile1
l---------src/libsystemd/libsystemd-internal/sd-id128/Makefile1
l---------src/libsystemd/libsystemd-internal/sd-login/Makefile1
l---------src/libsystemd/libsystemd-internal/sd-netlink/Makefile1
l---------src/libsystemd/libsystemd-internal/sd-network/Makefile1
l---------src/libsystemd/libsystemd-internal/sd-path/Makefile1
l---------src/libsystemd/libsystemd-internal/sd-resolve/Makefile1
l---------src/libsystemd/libsystemd-internal/sd-utf8/Makefile1
-rw-r--r--src/libsystemd/libsystemd-internal/subdir.mk10
-rw-r--r--src/libsystemd/libsystemd-journal-internal/Makefile11
-rw-r--r--src/libudev/Makefile28
-rw-r--r--src/libudev/src/Makefile19
-rw-r--r--src/systemd-nspawn/Makefile13
l---------src/systemd-nspawn/loopback-setup.c1
l---------src/systemd-nspawn/loopback-setup.h1
l---------src/systemd-nspawn/mount-setup.c1
l---------src/systemd-nspawn/mount-setup.h1
-rw-r--r--src/systemd-nspawn/nspawn-expose-ports.c1
-rw-r--r--src/systemd-nspawn/nspawn-network.c1
-rw-r--r--src/systemd-nspawn/nspawn-register.c2
-rw-r--r--src/systemd-nspawn/nspawn.c1
67 files changed, 1613 insertions, 161 deletions
diff --git a/.gitignore b/.gitignore
index 44de23ace7..8135516151 100644
--- a/.gitignore
+++ b/.gitignore
@@ -29,6 +29,7 @@
/build-aux/*
!/build-aux/Makefile*
!/build-aux/write-ifchanged
+!/build-aux/no-builtin-variables.mk
/busctl
/cdrom_id
/collect
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000000..a15804417a
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,48 @@
+# -*- Mode: makefile; indent-tabs-mode: t -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2010-2012 Lennart Poettering
+# Copyright 2010-2012 Kay Sievers
+# Copyright 2013 Zbigniew Jędrzejewski-Szmek
+# Copyright 2013 David Strauss
+# Copyright 2016 Luke Shumaker
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+#
+# systemd is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with systemd; If not, see <http://www.gnu.org/licenses/>.
+include $(dir $(lastword $(MAKEFILE_LIST)))/config.mk
+include $(topsrcdir)/build-aux/Makefile.head.mk
+
+at.subdirs += src
+
+# intltoolize
+std.gen_files += m4/intltool.m4
+std.gen_files += po/Makefile.in.in
+# autoreconf
+std.gen_files += aclocal.m4
+std.gen_files += automake.mk.in
+std.gen_files += build-aux/compile
+std.gen_files += build-aux/config.guess
+std.gen_files += build-aux/config.sub
+std.gen_files += build-aux/install-sh
+std.gen_files += build-aux/ltmain.sh
+std.gen_files += build-aux/missing
+std.gen_files += m4/libtool.m4
+std.gen_files += m4/ltoptions.m4
+std.gen_files += m4/ltsugar.m4
+std.gen_files += m4/ltversion.m4
+std.gen_files += m4/lt~obsolete.m4
+std.gen_files += config.h.in
+std.gen_files += configure
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/autoconf.mk.in b/autoconf.mk.in
new file mode 100644
index 0000000000..94dfca0b54
--- /dev/null
+++ b/autoconf.mk.in
@@ -0,0 +1,40 @@
+top_builddir = $(topoutdir)
+
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_URL = @PACKAGE_URL@
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+FGREP = @FGREP@# Requires AC_PROG_FGREP
+GPERF = @GPERF@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LIBTOOL = @LIBTOOL@
+M4 = @M4@
+M4_DEFINES = @M4_DEFINES@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@# Requires AC_PROG_MKDIR_P
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJCOPY = @OBJCOPY@
+OBJDUMP = @OBJDUMP@
+STRINGS = @STRINGS@
+STRIP = @STRIP@
+XGETTEXT = @XGETTEXT@
+
+INSTALL_SCRIPT = @INSTALL_SCRIPT@# Requires AC_PROG_INSTALL
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
diff --git a/automake.mk.am b/automake.mk.am
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/automake.mk.am
diff --git a/build-aux/Makefile.README.txt b/build-aux/Makefile.README.txt
new file mode 100644
index 0000000000..e06ba523d4
--- /dev/null
+++ b/build-aux/Makefile.README.txt
@@ -0,0 +1,164 @@
+Luke's AutoMake
+===============
+
+Yo, this document is incomplete. It describes the magical
+automake.{head,tail}.mk Makefiles and how to use them, kinda.
+
+I wrote a "clone" of automake. I say clone, because it works
+differently. Yeah, I need a new name for it.
+
+High-level overview
+-------------------
+
+Now, what this does for you is:
+
+It makes it _easy_ to write non-recursive Makefiles--and ones that are
+similar to plain recursive Makefiles, at that! (search for the paper
+"Recursive Make Considered Harmful") As harmful as recursive make is,
+it's historically been difficult to to write non-recursive Makefiles.
+This makes it easy.
+
+It also makes it easy to follow the GNU standards for your makefiles:
+it takes care of this entire table of .PHONY targets for you:
+
+| this | and this | are aliases for this |
+|------+------------------+--------------------------------------------------------|
+| all | build | $(outdir)/build |
+| | install | $(outdir)/install |
+| | uninstall | $(outdir)/uninstall |
+| | mostlyclean | $(outdir)/mostlyclean |
+| | clean | $(outdir)/clean |
+| | distclean | $(outdir)/distclean |
+| | maintainer-clean | $(outdir)/maintainer-clean |
+| | check | $(outdir)/check (not implemented for you) |
+| | dist | $(topoutdir)/$(PACKAGE)-$(VERSION).tar.gz (not .PHONY) |
+
+(You are still responsible for implementing the `$(outdir)/check`
+target in each of your Makefiles.)
+
+What you have to do is:
+
+In each source directory, you write a `Makefile`, very similarly to if
+you were writing for plain GNU Make, with
+
+ topoutdir ?= ...
+ topsrcdir ?= ...
+ include $(topsrcdir)/build-aux/Makefile.head.mk
+
+ # your makefile
+
+ include $(topsrcdir)/build-aux/Makefile.tail.mk
+
+And in the top-level source directory, Write your own helper makefiles
+that get included:
+ - `common.once.head.mk`: before parsing any of your Makefiles
+ - `common.each.head.mk`: before parsing each of your Makefiles
+ - `common.each.tail.mk`: after parsing each of your Makefiles
+ - `common.each.tail.mk`: after parsing all of your Makefiles
+
+The `common.*.mk` makefiles are nice for including generic pattern
+rules and variables that aren't specific to a directory.
+
+You're probably thinking that this sounds too good to be true!
+Unfortunately, there are two major deviations from writing a plain
+recursive Makefile:
+
+ 1. all targets and prerequisites (including .PHONY targets!) need to
+ be prefixed with
+ `$(srcdir)`/`$(outdir)`/`$(topsrcdir)`/`$(topoutdir)`.
+ * sub-gotcha: this means that if a pattern rule has a
+ prerequisite that may be in srcdir or outdir, then it must be
+ specified twice, once for each case.
+ 2. if a prerequisite is in a directory "owned" by another Makefile,
+ you must filter the pathname through `am_path`:
+ `$(call am_path,YOUR_PATH)`. Further, that path must NOT contain
+ a `..` segment; if you need to refer to a sibling directory, do it
+ relative to `$(topoutdir)` or `$(topsrcdir)`.
+
+Telling automake about your program
+-----------------------------------
+
+You tell automake what to do for you by setting some variables. They
+are all prefixed with `am_`; this prefix may be changed by editing the
+`_am` variable at the top of `automake.head.mk`.
+
+The exception to this is the `am_path` variable, which is a macro that
+is used to make a list of filenames relative to the appropriate
+directory, because unlike normal GNU (Auto)Make, `$(outdir)` isn't
+nescessarily equal to `.`. See above.
+
+There are several commands that generate files; simply record the list
+of files that each command generates as the following variable
+variables:
+
+| Variable | Create Command | Delete Command | Description | Relative to |
+|--------------+----------------+-----------------------------+-----------------------------------+-------------|
+| am_src_files | emacs | rm -rf . | Files that the developer writes | srcdir |
+| am_gen_files | ??? | make maintainer-clean | Files the developer compiles | srcdir |
+| am_cfg_files | ./configure | make distclean | Users' compile-time configuration | outdir |
+| am_out_files | make all | make mostlyclean/make clean | Files the user compiles | outdir |
+| am_sys_files | make install | make uninstall | Files the user installs | DESTDIR |
+
+In addition, there are two more variables that control not how files
+are created, but how they are deleted:
+
+| Variable | Affected command | Description | Relative to |
+|----------------+------------------+------------------------------------------------+-------------|
+| am_clean_files | make clean | A list of things to `rm` in addition to the | outdir |
+| | | files in `$(am_out_files)`. (Example: `*.o`) | |
+|----------------+------------------+------------------------------------------------+-------------|
+| am_slow_files | make mostlyclean | A list of things that (as an exception) should | outdir |
+| | | _not_ be deleted. (otherwise, `mostlyclean` | |
+| | | is the same as `clean`) | |
+
+Finally, there are two variables that express the relationships
+between directories:
+
+| Variable | Description |
+|------------+---------------------------------------------------------|
+| am_subdirs | A list of other directories (containing Makefiles) that |
+| | may be considered "children" of this |
+| | directory/Makefile; building a phony target in this |
+| | directory should also build it in the subdirectory. |
+| | They are not necesarily actually subdirectories of this |
+| | directory in the filesystem. |
+|------------+---------------------------------------------------------|
+| am_depdirs | A list of other directories (containing Makefiles) that |
+| | contain or generate files that are dependencies of |
+| | targets in this directory. They are not necesarily |
+| | actually subdirectories of this directory in the |
+| | filesystem. Except for files that are dependencies of |
+| | files in this directory, things in the dependency |
+| | directory will not be built. |
+
+Tips, notes
+-----------
+
+I like to have the first (non-comment) line in a Makefile be:
+
+ include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
+
+(adjusting the number of `../` sequences as nescessary). Then, my
+(user-editable) `config.mk` is of the form:
+
+ ifeq ($(topsrcdir),)
+ topoutdir := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
+ topsrcdir := $(topoutdir)
+
+ # your configuration
+
+ endif
+
+If the package has a `./configure` script, then I have it modifiy
+topsrcdir as necessary, as well as modifying whatever other parts of
+the configuration. All of the configuration lives in `config.mk`;
+`./configure` doesn't modify any `Makefile`s, it just generates
+`config.mk`, and copies (or (sym?)link?) every `$(srcdir)/Makefile` to
+`$(outdir)/Makefile`.
+
+----
+Copyright (C) 2016 Luke Shumaker
+
+This documentation file is placed into the public domain. If that is
+not possible in your legal system, I grant you permission to use it in
+absolutely every way that I can legally grant to you.
diff --git a/build-aux/Makefile.each.head/00-dist.mk b/build-aux/Makefile.each.head/00-dist.mk
new file mode 100644
index 0000000000..a0943059ba
--- /dev/null
+++ b/build-aux/Makefile.each.head/00-dist.mk
@@ -0,0 +1,20 @@
+# 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/>.
+
+ifeq ($(outdir),$(topoutdir))
+std.clean_files += $(addprefix $(dist.pkgname)-*,$(dist.exts) .tar /)
+endif
+
+$(outdir)/dist: $(addprefix $(topoutdir)/$(dist.pkgname)-$(dist.version),$(dist.exts))
diff --git a/build-aux/Makefile.each.tail/10-std.mk b/build-aux/Makefile.each.tail/10-std.mk
new file mode 100644
index 0000000000..5150a71a72
--- /dev/null
+++ b/build-aux/Makefile.each.tail/10-std.mk
@@ -0,0 +1,46 @@
+# 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 := $(patsubst ./%,%,$(addprefix $(srcdir)/,$(std.src_files)))
+std.gen_files := $(patsubst ./%,%,$(addprefix $(srcdir)/,$(std.gen_files)))
+std.cfg_files := $(patsubst ./%,%,$(addprefix $(outdir)/,$(std.cfg_files)))
+std.out_files := $(patsubst ./%,%,$(addprefix $(outdir)/,$(std.out_files)))
+std.sys_files := $(addprefix $(DESTDIR),$(std.sys_files))
+std.clean_files := $(patsubst ./%,%,$(addprefix $(outdir)/,$(std.clean_files)))
+std.slow_files := $(patsubst ./%,%,$(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
index 298e8343b5..0d05832fc3 100644
--- a/build-aux/Makefile.each.tail/20-systemd.mk
+++ b/build-aux/Makefile.each.tail/20-systemd.mk
@@ -20,31 +20,54 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
-include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
-include $(topsrcdir)/build-aux/Makefile.head.mk
-%-from-name.gperf: %-list.txt
+-include $(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
+
+$(outdir)/%.o: $(srcdir)/%.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)/.deps:
+ $(AM_V_at)$(MKDIR_P) $@
+
+_systemd.rpath = $(dir $(patsubst $(DESTDIR)%,%,$(filter %/$(@F),$(std.sys_files/$(@D)))))
+_systemd.patsubst-all = $(if $1,$(call _systemd.patsubst-all,$(wordlist 2,$(words $1),$1),$2,$(patsubst $(firstword $1),$2,$3)),$3)
+_systemd.link_files = $(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)/,$(bin_PROGRAMS) $(libexec_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)
+
+$(DESTDIR)$(libdir)/%.la: $(outdir)/%.la
+ $(LIBTOOL) $(ALL_LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $< $(@D)
+
+$(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 }' <$< >$@
-%-from-name.h: %-from-name.gperf
+$(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 <$< >$@
-$(outdir)/%: sysctl.d/%.in
+$(addprefix $(outdir)/,$(systemd.sed_files)): $(outdir)/%: $(srcdir)/%.in
$(SED_PROCESS)
-%.sh: %.sh.in
- $(SED_PROCESS)
- $(AM_V_GEN)chmod +x $@
+#$(outdir)/%.sh: $(srcdir)/%.sh.in
+# $(SED_PROCESS)
+# $(AM_V_GEN)chmod +x $@
-$(outdir)/%.c: src/%.gperf
- $(AM_V_at)$(MKDIR_P) $(dir $@)
+$(outdir)/%.c: $(srcdir)/%.gperf
$(AM_V_GPERF)$(GPERF) < $< > $@
-$(outdir)/%: src/%.m4 $(top_builddir)/config.status
- $(AM_V_at)$(MKDIR_P) $(dir $@)
+$(outdir)/%: $(srcdir)/%.m4 $(top_builddir)/config.status
$(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
-
-$(eval $(value automake2autothing))
-include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/build-aux/Makefile.each.tail/30-module.mk b/build-aux/Makefile.each.tail/30-module.mk
new file mode 100644
index 0000000000..10ebc4c1de
--- /dev/null
+++ b/build-aux/Makefile.each.tail/30-module.mk
@@ -0,0 +1,4 @@
+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),'$v' '$($v/$(@D))') | sort | column -s= -o= -t
+.PHONY: $(outdir)/module-info
diff --git a/build-aux/Makefile.head.mk b/build-aux/Makefile.head.mk
new file mode 100644
index 0000000000..63a34624f9
--- /dev/null
+++ b/build-aux/Makefile.head.mk
@@ -0,0 +1,63 @@
+# 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/>.
+
+# This bit only gets evaluated once, at the very beginning
+ifeq ($(_at.NO_ONCE),)
+
+ifeq ($(topsrcdir),)
+$(error topsrcdir must be set before including Makefile.head.mk)
+endif
+ifeq ($(topoutdir),)
+$(error topoutdir must be set before including Makefile.head.mk)
+endif
+
+_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)
+
+define at.nl
+
+
+endef
+
+_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
+
+include $(sort $(wildcard $(topsrcdir)/build-aux/Makefile.once.head/*.mk))
+
+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)))
+
+_at.included_makefiles := $(_at.included_makefiles) $(call at.path,$(outdir)/Makefile)
+
+$(foreach v,$(at.dirlocal),$(eval $v=))
+
+include $(sort $(wildcard $(topsrcdir)/build-aux/Makefile.each.head/*.mk))
diff --git a/build-aux/Makefile.once.head/00-dist.mk b/build-aux/Makefile.once.head/00-dist.mk
new file mode 100644
index 0000000000..4326cde72a
--- /dev/null
+++ b/build-aux/Makefile.once.head/00-dist.mk
@@ -0,0 +1,44 @@
+# 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/>.
+
+# Developer configuration
+
+dist.exts ?= .tar.gz
+dist.pkgname ?= $(firstword $(PACKAGE_TARNAME) $(PACKAGE) $(PACKAGE_NAME))
+dist.version ?= $(firstword $(PACKAGE_VERSION) $(VERSION))
+
+ifeq ($(dist.pkgname),)
+$(error dist.pkgname must be set)
+endif
+ifeq ($(dist.version),)
+$(error dist.version must be set)
+endif
+
+# User configuration
+
+CP ?= cp
+GZIP ?= gzip
+MKDIR ?= mkdir
+MKDIR_P ?= mkdir -p
+MV ?= mv
+RM ?= rm -f
+TAR ?= tar
+
+GZIPFLAGS ?= $(GZIP_ENV)
+GZIP_ENV ?= --best
+
+# Implementation
+
+at.phony += dist
diff --git a/build-aux/Makefile.once.head/00-gnuconf.mk b/build-aux/Makefile.once.head/00-gnuconf.mk
new file mode 100644
index 0000000000..83cb110c59
--- /dev/null
+++ b/build-aux/Makefile.once.head/00-gnuconf.mk
@@ -0,0 +1,160 @@
+# 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/>.
+
+# This file is based on §7.2 "Makefile Conventions" of the release of
+# the GNU Coding Standards dated April 13, 2016.
+
+gnuconf.pkgname ?= $(firstword $(PACKAGE_TARNAME) $(PACKAGE) $(PACKAGE_NAME))
+ifeq ($(gnuconf.pkgname),)
+$(error gnuconf.pkgname must be set)
+endif
+
+# 7.2.2: Utilities in Makefiles
+# -----------------------------
+
+# It's ok to hard-code these commands in rules, but who wants to
+# memorize the list of what's ok?
+AWK ?= awk
+CAT ?= cat
+CMP ?= cmp
+CP ?= cp
+DIFF ?= diff
+ECHO ?= echo
+EGREP ?= egrep
+EXPR ?= expr
+FALSE ?= false
+GREP ?= grep
+INSTALL_INFO ?= install-info
+LN ?= ln
+LS ?= ls
+MKDIR ?= mkdir
+MV ?= mv
+PRINTF ?= printf
+PWD ?= pwd
+RM ?= rm
+RMDIR ?= rmdir
+SED ?= sed
+SLEEP ?= sleep
+SORT ?= sort
+TAR ?= tar
+TEST ?= test
+TOUCH ?= touch
+TR ?= tr
+TRUE ?= true
+
+# These must be user-configurable
+AR ?= ar
+ARFLAGS ?=
+BISON ?= bison
+BISONFLAGS ?=
+CC ?= cc
+CCFLAGS ?= $(CFLAGS)
+FLEX ?= flex
+FLEXFLAGS ?=
+INSTALL ?= install
+#INSTALLFLAGS ?=
+LD ?= ld
+LDFLAGS ?=
+LDCONFIG ?= ldconfig #TODO
+LDCONFIGFLAGS ?=
+LEX ?= lex
+LEXFLAGS ?= $(LFLAGS)
+#MAKE
+MAKEINFO ?= makeinfo
+MAKEINFOFLAGS ?=
+RANLIB ?= ranlib #TODO
+RANLIBFLAGS ?=
+TEXI2DVI ?= texi2dvi
+TEXI2DVIFLAGS ?=
+YACC ?= yacc
+YACCFLAGS ?= $(YFLAGS)
+
+CFLAGS ?=
+LFLAGS ?=
+YFLAGS ?=
+
+LN_S ?= ln -s #TODO
+
+CHGRP ?= chgrp
+CHMOD ?= chmod
+CHOWN ?= chown
+MKNOD ?= mknod
+
+# 7.2.3: Variables for Specifying Commands
+# ----------------------------------------
+
+INSTALL_PROGRAM ?= $(INSTALL)
+INSTALL_DATA ?= ${INSTALL} -m 644
+
+# 7.2.5: Variables for Installation Directories
+# ---------------------------------------------
+
+# Root for the installation
+prefix ?= /usr/local
+exec_prefix ?= $(prefix)
+# Executable programs
+bindir ?= $(exec_prefix)/bin
+sbindir ?= $(exec_prefix)/sbin
+libexecdir ?= $(exec_prefix)/libexec
+# Data files
+datarootdir ?= $(prefix)/share
+datadir ?= $(datarootdir)
+sysconfdir ?= $(prefix)/etc
+sharedstatedir ?= $(prefix)/com
+localstatedir ?= $(prefix)/var
+runstatedir ?= $(localstatedir)/run
+# Specific types of files
+includedir ?= $(prefix)/include
+oldincludedir ?= /usr/include
+docdir ?= $(datarootdir)/doc/$(gnuconf.pkgname)
+infodir ?= $(datarootdir)/info
+htmldir ?= $(docdir)
+dvidir ?= $(docdir)
+pdfdir ?= $(docdir)
+psdir ?= $(docdir)
+libdir ?= $(exec_prefix)/lib
+lispdir ?= $(datarootdir)/emacs/site-lisp
+localedir ?= $(datarootdir)/locale
+
+mandir ?= $(datarootdir)/man
+man1dir ?= $(mandir)/man1
+man2dir ?= $(mandir)/man2
+man3dir ?= $(mandir)/man3
+man4dir ?= $(mandir)/man4
+man5dir ?= $(mandir)/man5
+man6dir ?= $(mandir)/man6
+man7dir ?= $(mandir)/man7
+man8dir ?= $(mandir)/man8
+
+manext ?= .1
+man1ext ?= .1
+man2ext ?= .2
+man3ext ?= .3
+man4ext ?= .4
+man5ext ?= .5
+man6ext ?= .6
+man7ext ?= .7
+man8ext ?= .8
+
+# 7.2.7: Install Command Categories
+# ---------------------------------
+
+PRE_INSTALL ?=
+POST_INSTALL ?=
+NORMAL_INSTALL ?=
+
+PRE_UNINSTALL ?=
+POST_UNINSTALL ?=
+NORMAL_UNINSTALL ?=
diff --git a/build-aux/Makefile.once.head/00-write-ifchanged.mk b/build-aux/Makefile.once.head/00-write-ifchanged.mk
new file mode 100644
index 0000000000..79ef1c419c
--- /dev/null
+++ b/build-aux/Makefile.once.head/00-write-ifchanged.mk
@@ -0,0 +1 @@
+WRITE_IFCHANGED = $(topsrcdir)/build-aux/write-ifchanged
diff --git a/build-aux/Makefile.once.head/10-std.mk b/build-aux/Makefile.once.head/10-std.mk
new file mode 100644
index 0000000000..3e058eca57
--- /dev/null
+++ b/build-aux/Makefile.once.head/10-std.mk
@@ -0,0 +1,39 @@
+# 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/>.
+
+# Declare the default target
+all: build
+.PHONY: all noop
+
+# Standard creative PHONY targets
+at.phony += build install installdirs
+# 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
+
+# User configuration
+
+DESTDIR ?=
+
+RM ?= rm -f
+RMDIR_P ?= rmdir -p
+TRUE ?= true
diff --git a/build-aux/Makefile.once.head/20-systemd.mk b/build-aux/Makefile.once.head/20-systemd.mk
index bde09f8d51..61484c2954 100644
--- a/build-aux/Makefile.once.head/20-systemd.mk
+++ b/build-aux/Makefile.once.head/20-systemd.mk
@@ -20,17 +20,27 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
-include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
-include $(topsrcdir)/build-aux/Makefile.head.mk
-ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-AM_MAKEFLAGS = --no-print-directory
-AUTOMAKE_OPTIONS = color-tests parallel-tests
+SHELL = bash -o pipefail
-GCC_COLORS ?= 'ooh, shiny!'
-export GCC_COLORS
+OUR_CPPFLAGS += -MT $@ -MD -MP -MF $(@D)/$(DEPDIR)/$(basename $(@F)).P$(patsubst .%,%,$(suffix $(@F)))
+OUR_CPPFLAGS += -include $(topoutdir)/config.h
+OUR_CPPFLAGS += $(if $(<D),-I$(<D)) -I$(@D)
-SUBDIRS = . po
+at.dirlocal += AM_CFLAGS AM_CPPFLAGS AM_LDFLAGS AM_LIBTOOLFLAGS
+ALL_CFLAGS = $(OUR_CFLAGS) $(AM_CFLAGS/$(@D)) $(CFLAGS)
+ALL_CPPFLAGS = $(OUR_CPPFLAGS) $(AM_CPPFLAGS/$(@D)) $(CPPFLAGS)
+ALL_LDFLAGS = $(OUR_LDFLAGS) $(AM_LDFLAGS/$(@D)) $(LDFLAGS)
+ALL_LIBTOOLFLAGS = $(OUR_LIBTOOLFLAGS) $(AM_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 $@
+
+SED_PROCESS = \
+ $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
+ $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
+ < $< > $@
# remove targets if the command fails
.DELETE_ON_ERROR:
@@ -181,5 +191,43 @@ define generate-sym-test
$(AM_V_at)printf 'return 0; }\n' >> $@
endef
-$(eval $(value automake2autothing))
-include $(topsrcdir)/build-aux/Makefile.tail.mk
+at.dirlocal += systemd.sed_files
+
+at.dirlocal += noinst_LTLIBRARIES lib_LTLIBRARIES
+at.dirlocal += bin_PROGRAMS libexec_PROGRAMS
+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_libs = $($(automake_name)_LIBADD) $($(automake_name)_LDADD)
+
+define automake2autothing
+std.out_files += $(noinst_LTLIBRARIES) $(lib_LTLIBRARIES)
+std.sys_files += $(addprefix $(libdir)/,$(lib_LTLIBRARIES))
+
+std.out_files += $(bin_PROGRAMS) $(libexec_PROGRAMS)
+std.sys_files += $(addprefix $(bindir)/,$(bin_PROGRAMS))
+std.sys_files += $(addprefix $(libexecdir)/,$(libexec_PROGRAMS))
+
+std.out_files += $(notdir $(pkgconfiglib_DATA))
+std.sys_files += $(addprefix $(pkgconfiglibdir)/,$(notdir $(lib_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 ?=))
+$(foreach t,$(filter %.la,$(std.out_files)),\
+ $(eval $(outdir)/$t: $(call at.path,$(call automake_lo,$t) $(call automake_libs,$t)) )\
+ $(eval AM_CFLAGS += $($(call automake_name,$t)_CFLAGS) )\
+ $(eval AM_CPPFLAGS += $($(call automake_name,$t)_CPPFLAGS) )\
+ $(eval AM_LDFLAGS += $($(call automake_name,$t)_LDFLAGS) ))
+$(foreach t,$(bin_PROGRAMS) $(libexec_PROGRAMS),\
+ $(eval $(outdir)/$t: $(call at.path,$(call automake_o,$t) $(call automake_libs,$t)) )\
+ $(eval AM_CFLAGS += $($(call automake_name,$t)_CFLAGS) )\
+ $(eval AM_CPPFLAGS += $($(call automake_name,$t)_CPPFLAGS) )\
+ $(eval AM_LDFLAGS += $($(call automake_name,$t)_LDFLAGS) ))
+endef
diff --git a/build-aux/Makefile.once.tail/00-dist.mk b/build-aux/Makefile.once.tail/00-dist.mk
new file mode 100644
index 0000000000..b8b7733319
--- /dev/null
+++ b/build-aux/Makefile.once.tail/00-dist.mk
@@ -0,0 +1,27 @@
+# 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/>.
+
+_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)
+
+$(topoutdir)/$(dist.pkgname)-$(dist.version).tar: $(topoutdir)/$(dist.pkgname)-$(dist.version)
+ $(TAR) cf $@ -C $(<D) $(<F)
+$(topoutdir)/$(dist.pkgname)-$(dist.version).tar.gz: $(topoutdir)/$(dist.pkgname)-$(dist.version).tar
+ $(GZIP) $(GZIPFLAGS) < $< > $@
diff --git a/build-aux/Makefile.once.tail/20-systemd.mk b/build-aux/Makefile.once.tail/20-systemd.mk
index 5fecb7fc4e..5aa2703256 100644
--- a/build-aux/Makefile.once.tail/20-systemd.mk
+++ b/build-aux/Makefile.once.tail/20-systemd.mk
@@ -20,8 +20,22 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
-include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
-include $(topsrcdir)/build-aux/Makefile.head.mk
+
+$(topsrcdir)/configure: $(topsrcdir)/configure.ac
+ cd $(topsrcdir) && ./autogen.sh
+
+config_files = config.mk automake.mk autoconf.mk gnustandards.mk po/Makefile.in
+config_headers = config.h
+config_commands = depfiles libtool po/stamp-it
+$(topoutdir)/config.status: $(topsrcdir)/configure
+ cd $(topoutdir) && ./config.status --recheck
+$(addprefix $(topoutdir)/,$(config_files)): $(topoutdir)/%: $(topoutdir)/config.status $(topsrcdir)/%.in
+ cd $(topoutdir) && ./config.status --file=$*
+$(addprefix $(topoutdir)/,$(config_headers)): $(topoutdir)/%: $(topoutdir)/%.stamp
+$(foreach f,$(config_headers),$(topoutdir)/$f.stamp): $(topoutdir)/%.stamp: $(topoutdir)/config.status $(topsrcdir)/%.in
+ cd $(topoutdir) && ./config.status --header=$*
+ test -f $(topoutdir)/$*
+ touch $@
# Let's run all tests of the test suite, but under valgrind. Let's
# exclude perl/python/shell scripts we have in there
@@ -94,5 +108,3 @@ list-keys:
add-key:
gpg --verbose --no-options --no-default-keyring --no-auto-key-locate --batch --trust-model=always --keyring=$(srcdir)/src/import/import-pubring.gpg --import -
-$(eval $(value automake2autothing))
-include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/build-aux/Makefile.tail.mk b/build-aux/Makefile.tail.mk
new file mode 100644
index 0000000000..b1c50457b7
--- /dev/null
+++ b/build-aux/Makefile.tail.mk
@@ -0,0 +1,51 @@
+# 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/>.
+
+# This bit gets evaluated for each Makefile processed
+
+include $(call _at.reverse,$(sort $(wildcard $(topsrcdir)/build-aux/Makefile.each.tail/*.mk)))
+
+at.subdirs := $(patsubst ./%,%,$(addprefix $(outdir)/,$(at.subdirs)))
+at.depdirs := $(at.depdirs)
+
+# 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))
+
+# 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
+$(foreach _at.NO_ONCE,y,\
+ $(foreach makefile,$(call at.path,$(addsuffix /Makefile,$(at.subdirs/$(outdir)) $(at.depdirs/$(outdir)))),\
+ $(eval include $(filter-out $(_at.included_makefiles),$(makefile)))))
+
+# This bit only gets evaluated once, after all of the other Makefiles are read
+ifeq ($(_at.NO_ONCE),)
+
+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
new file mode 100644
index 0000000000..c3aef5874f
--- /dev/null
+++ b/build-aux/no-builtin-variables.mk
@@ -0,0 +1,15 @@
+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/build-aux/write-ifchanged b/build-aux/write-ifchanged
new file mode 100755
index 0000000000..185ceb0039
--- /dev/null
+++ b/build-aux/write-ifchanged
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+# Copyright (C) 2015 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/>.
+
+outfile=$1
+tmpfile="$(dirname "$outfile")/.tmp${outfile##*/}"
+
+cat > "$tmpfile" || exit $?
+if cmp -s "$tmpfile" "$outfile"; then
+ rm -f "$tmpfile" || :
+else
+ mv -f "$tmpfile" "$outfile"
+fi
diff --git a/config.mk.in b/config.mk.in
index 25c742498c..498745c9d0 100644
--- a/config.mk.in
+++ b/config.mk.in
@@ -20,8 +20,30 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
-include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
-include $(topsrcdir)/build-aux/Makefile.head.mk
+
+ifeq ($(topsrcdir),)
+
+topoutdir := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
+abs_topsrcdir := @abs_top_srcdir@
+topsrcdir = $(if $(value am_path),$(call am_path,$(abs_topsrcdir)),$(abs_topsrcdir))
+
+MAKEFLAGS += --warn-undefined-variables
+include $(topsrcdir)/build-aux/no-builtin-variables.mk
+.LIBPATTERNS = lib%.so lib%.a
+
+include $(topoutdir)/gnustandards.mk
+include $(topoutdir)/autoconf.mk
+
+CCLD = $(CC)
+
+OUR_CPPFLAGS = @OUR_CPPFLAGS@
+OUR_CFLAGS = @OUR_CFLAGS@
+OUR_LDFLAGS = @OUR_LDFLAGS@
+OUR_LIBTOOLFLAGS =
+
+EFI_CPPFLAGS =
+EFI_CFLAGS =
+EFI_LDFLAGS =
# Dirs of external packages
dbuspolicydir=@dbuspolicydir@
@@ -74,5 +96,238 @@ prefix=@prefix@
bindir=$(prefix)/bin
libexecdir=$(prefix)/lib/systemd
-$(eval $(value automake2autothing))
-include $(topsrcdir)/build-aux/Makefile.tail.mk
+# Libraries we depend on
+libbasic.CPPFLAGS = -I$(topsrcdir)/src/libbasic -I$(topoutdir)/src/libbasic
+libbasic.DEPENDS = $(topoutdir)/src/libbasic/libbasic.la
+libshared.CPPFLAGS = -I$(topsrcdir)/src/libshared -I$(topoutdir)/src/libshared
+libshared.DEPENDS = $(topoutdir)/src/libshared/libshared.la
+libfirewall.CPPFLAGS = -I$(topsrcdir)/src/libfirewall -I$(topoutdir)/src/libfirewall
+libfirewall.DEPENDS = $(topoutdir)/src/libfirewall/libfirewall.la
+libsystemd.CPPFLAGS = -I$(topsrcdir)/src/libsystemd/include
+libsystemd.DEPENDS = $(topoutdir)/src/libsystemd/libsystemd/libsystemd.la
+libsystemd-internal.CPPFLAGS = -I$(topsrcdir)/src/libsystemd/libsystemd-internal/include
+libsystemd-internal.DEPENDS = $(topoutdir)/src/libsystemd/libsystemd-internal/libsystemd-internal.la
+libsystemd-journal.CPPFLAGS = -I$(topsrcdir)/src/libsystemd/libsystemd-journal/include
+libsystemd-journal.DEPENDS = $(topoutdir)/src/libsystemd/libsystemd-journal/libsystemd-journal.la
+
+HAVE_ACL = @HAVE_ACL_TRUE@1
+ ACL_CFLAGS = #XXX
+ ACL_LIBS = @ACL_LIBS@
+HAVE_APPARMOR = @HAVE_APPARMOR_TRUE@1
+ APPARMOR_CFLAGS = @APPARMOR_CFLAGS@
+ APPARMOR_LIBS = @APPARMOR_LIBS@
+HAVE_AUDIT = @HAVE_AUDIT_TRUE@1
+ AUDIT_CFLAGS = #XXX
+ AUDIT_LIBS = @AUDIT_LIBS@
+HAVE_BLKID = @HAVE_BLKID_TRUE@1
+ BLKID_CFLAGS = @BLKID_CFLAGS@
+ BLKID_LIBS = @BLKID_LIBS@
+HAVE_BZIP2 = @HAVE_BZIP2_TRUE@1
+ BZIP2_CFLAGS = #XXX
+ BZIP2_LIBS = -lbz2 #XXX
+HAVE_CAP = 1 #XXX
+ CAP_CFLAGS = #XXX
+ CAP_LIBS = @CAP_LIBS@
+HAVE_DBUS = @HAVE_DBUS_TRUE@1
+ DBUS_CFLAGS = @DBUS_CFLAGS@
+ DBUS_LIBS = @DBUS_LIBS@
+HAVE_ELFUTILS = @HAVE_ELFUTILS_TRUE@1
+ ELFUTILS_CFLAGS = #XXX
+ ELFUTILS_LIBS = @ELFUTILS_LIBS@
+HAVE_GCRYPT = @HAVE_GCRYPT_TRUE@1
+ GCRYPT_CFLAGS = @GCRYPT_CFLAGS@
+ GCRYPT_LIBS = @GCRYPT_LIBS@
+HAVE_GNUTLS = @HAVE_GNUTLS_TRUE@1
+ GNUTLS_CFLAGS = @GNUTLS_CFLAGS@
+ GNUTLS_LIBS = @GNUTLS_LIBS@
+HAVE_GPG_ERROR = 1 #XXX
+ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@
+ GPG_ERROR_LIBS = @GPG_ERROR_LIBS@
+HAVE_GPG_ERROR_MT = 1 #XXX
+ GPG_ERROR_MT_CFLAGS = @GPG_ERROR_MT_CFLAGS@
+ GPG_ERROR_MT_LIBS = @GPG_ERROR_MT_LIBS@
+HAVE_KMOD = @HAVE_KMOD_TRUE@1
+ KMOD_CFLAGS = @KMOD_CFLAGS@
+ KMOD_LIBS = @KMOD_LIBS@
+HAVE_LIBCRYPTSETUP = @HAVE_LIBCRYPTSETUP_TRUE@1
+ LIBCRYPTSETUP_CFLAGS = @LIBCRYPTSETUP_CFLAGS@
+ LIBCRYPTSETUP_LIBS = @LIBCRYPTSETUP_LIBS@
+HAVE_LIBCURL = @HAVE_LIBCURL_TRUE@1
+ LIBCURL_CFLAGS = @LIBCURL_CFLAGS@
+ LIBCURL_LIBS = @LIBCURL_LIBS@
+HAVE_LIBGCRYPT = 1 #XXX
+ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@
+ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@
+HAVE_LIBIDN = @HAVE_LIBIDN_TRUE@1
+ LIBIDN_CFLAGS = @LIBIDN_CFLAGS@
+ LIBIDN_LIBS = @LIBIDN_LIBS@
+HAVE_LIBIPTC = @HAVE_LIBIPTC_TRUE@1
+ LIBIPTC_CFLAGS = @LIBIPTC_CFLAGS@
+ LIBIPTC_LIBS = @LIBIPTC_LIBS@
+HAVE_LZ4 = @HAVE_LZ4_TRUE@1
+ LZ4_CFLAGS = @LZ4_CFLAGS@
+ LZ4_LIBS = @LZ4_LIBS@
+HAVE_MICROHTTPD = @HAVE_MICROHTTPD_TRUE@1
+ MICROHTTPD_CFLAGS = @MICROHTTPD_CFLAGS@
+ MICROHTTPD_LIBS = @MICROHTTPD_LIBS@
+HAVE_MOUNT = 1 #XXX
+ MOUNT_CFLAGS = @MOUNT_CFLAGS@
+ MOUNT_LIBS = @MOUNT_LIBS@
+HAVE_PAM = @HAVE_PAM_TRUE@1
+ PAM_CFLAGS = #XXX
+ PAM_LIBS = @PAM_LIBS@
+HAVE_QRENCODE = @HAVE_QRENCODE_TRUE@1
+ QRENCODE_CFLAGS = @QRENCODE_CFLAGS@
+ QRENCODE_LIBS = @QRENCODE_LIBS@
+HAVE_SECCOMP = @HAVE_SECCOMP_TRUE@1
+ SECCOMP_CFLAGS = @SECCOMP_CFLAGS@
+ SECCOMP_LIBS = @SECCOMP_LIBS@
+HAVE_SELINUX = @HAVE_SELINUX_TRUE@1
+ SELINUX_CFLAGS = @SELINUX_CFLAGS@
+ SELINUX_LIBS = @SELINUX_LIBS@
+HAVE_XKBCOMMON = @HAVE_XKBCOMMON_TRUE@1
+ XKBCOMMON_CFLAGS = @XKBCOMMON_CFLAGS@
+ XKBCOMMON_LIBS = @XKBCOMMON_LIBS@
+HAVE_XZ = @HAVE_XZ_TRUE@1
+ XZ_CFLAGS = @XZ_CFLAGS@
+ XZ_LIBS = @XZ_LIBS@
+HAVE_ZLIB = @HAVE_ZLIB_TRUE@1
+ ZLIB_CFLAGS = @ZLIB_CFLAGS@
+ ZLIB_LIBS = @ZLIB_LIBS@
+
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+
+ARCH_AARCH64 = @ARCH_AARCH64_TRUE@1
+ARCH_IA32 = @ARCH_IA32_TRUE@1
+ARCH_X86_64 = @ARCH_X86_64_TRUE@1
+
+ENABLE_BACKLIGHT = @ENABLE_BACKLIGHT_TRUE@1
+ENABLE_BASH_COMPLETION = @ENABLE_BASH_COMPLETION_TRUE@1
+ENABLE_BINFMT = @ENABLE_BINFMT_TRUE@1
+ENABLE_BOOTCHART = @ENABLE_BOOTCHART_TRUE@1
+ENABLE_COMPAT_LIBS = @ENABLE_COMPAT_LIBS_TRUE@1
+ENABLE_COREDUMP = @ENABLE_COREDUMP_TRUE@1
+ENABLE_COVERAGE = @ENABLE_COVERAGE_TRUE@1
+ENABLE_EFI = @ENABLE_EFI_TRUE@1
+ENABLE_FIRSTBOOT = @ENABLE_FIRSTBOOT_TRUE@1
+ENABLE_HIBERNATE = @ENABLE_HIBERNATE_TRUE@1
+ENABLE_HOSTNAMED = @ENABLE_HOSTNAMED_TRUE@1
+ENABLE_HWDB = @ENABLE_HWDB_TRUE@1
+ENABLE_IMPORTD = @ENABLE_IMPORTD_TRUE@1
+ENABLE_LDCONFIG = @ENABLE_LDCONFIG_TRUE@1
+ENABLE_LOCALED = @ENABLE_LOCALED_TRUE@1
+ENABLE_LOGIND = @ENABLE_LOGIND_TRUE@1
+ENABLE_MACHINED = @ENABLE_MACHINED_TRUE@1
+ENABLE_MANPAGES = @ENABLE_MANPAGES_TRUE@1
+ENABLE_NETWORKD = @ENABLE_NETWORKD_TRUE@1
+ENABLE_POLKIT = @ENABLE_POLKIT_TRUE@1
+ENABLE_QUOTACHECK = @ENABLE_QUOTACHECK_TRUE@1
+ENABLE_RANDOMSEED = @ENABLE_RANDOMSEED_TRUE@1
+ENABLE_RESOLVED = @ENABLE_RESOLVED_TRUE@1
+ENABLE_RFKILL = @ENABLE_RFKILL_TRUE@1
+ENABLE_SPLIT_USR = @ENABLE_SPLIT_USR_TRUE@1
+ENABLE_SYSUSERS = @ENABLE_SYSUSERS_TRUE@1
+ENABLE_TESTS = @ENABLE_TESTS_TRUE@1
+ENABLE_TIMEDATED = @ENABLE_TIMEDATED_TRUE@1
+ENABLE_TIMESYNCD = @ENABLE_TIMESYNCD_TRUE@1
+ENABLE_TMPFILES = @ENABLE_TMPFILES_TRUE@1
+ENABLE_VCONSOLE = @ENABLE_VCONSOLE_TRUE@1
+ENABLE_ZSH_COMPLETION = @ENABLE_ZSH_COMPLETION_TRUE@1
+
+HAVE_COMPRESSION = @HAVE_COMPRESSION_TRUE@1
+HAVE_GNUEFI = @HAVE_GNUEFI_TRUE@1
+HAVE_MYHOSTNAME = @HAVE_MYHOSTNAME_TRUE@1
+HAVE_PYTHON = @HAVE_PYTHON_TRUE@1
+HAVE_REMOTE = @HAVE_REMOTE_TRUE@1
+HAVE_SMACK = @HAVE_SMACK_TRUE@1
+HAVE_SYSV_COMPAT = @HAVE_SYSV_COMPAT_TRUE@1
+HAVE_UTMP = @HAVE_UTMP_TRUE@1
+
+LIBTOOLFLAGS =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+
+INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
+INTLTOOL_MERGE = @INTLTOOL_MERGE@
+INTLTOOL_PERL = @INTLTOOL_PERL@
+INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
+GMSGFMT = @GMSGFMT@
+KBD_LOADKEYS = @KBD_LOADKEYS@
+KBD_SETFONT = @KBD_SETFONT@
+KEXEC = @KEXEC@
+KILL = @KILL@
+KMOD = @KMOD@
+LD = @LD@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+PKG_CONFIG = @PKG_CONFIG@
+PYTHON = @PYTHON@
+QEMU = @QEMU@
+QUOTACHECK = @QUOTACHECK@
+QUOTAON = @QUOTAON@
+SETCAP = @SETCAP@
+SULOGIN = @SULOGIN@
+SUSHELL = @SUSHELL@
+UMOUNT_PATH = @UMOUNT_PATH@
+XSLTPROC = @XSLTPROC@
+MOUNT_PATH = @MOUNT_PATH@
+
+AMTAR = @AMTAR@
+CCDEPMODE = @CCDEPMODE@
+CERTIFICATEROOT = @CERTIFICATEROOT@
+DEBUGTTY = @DEBUGTTY@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DNS_SERVERS = @DNS_SERVERS@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+EFI_ARCH = @EFI_ARCH@
+EFI_CC = @EFI_CC@
+EFI_INC_DIR = @EFI_INC_DIR@
+EFI_LDS_DIR = @EFI_LDS_DIR@
+EFI_LIB_DIR = @EFI_LIB_DIR@
+EFI_MACHINE_TYPE_NAME = @EFI_MACHINE_TYPE_NAME@
+EXEEXT = @EXEEXT@
+GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAINT = @MAINT@
+NMEDIT = @NMEDIT@
+NTP_SERVERS = @NTP_SERVERS@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PATH_SEPARATOR = :
+PKG_CONFIG_LIBDIR =
+PKG_CONFIG_PATH = /home/luke/.prefix/lib/pkgconfig
+PYTHON_EXEC_PREFIX = ${exec_prefix}
+PYTHON_PLATFORM = linux
+PYTHON_PREFIX = ${prefix}
+PYTHON_VERSION = 3.5
+QEMU_BIOS =
+RC_LOCAL_SCRIPT_PATH_START = /etc/rc.local
+RC_LOCAL_SCRIPT_PATH_STOP = /usr/sbin/halt.local
+SET_MAKE =
+SYSTEM_GID_MAX = 999
+SYSTEM_SYSVINIT_PATH =
+SYSTEM_SYSVRCND_PATH =
+SYSTEM_UID_MAX = 999
+TELINIT = /lib/sysvinit/telinit
+TTY_GID = 5
+USE_NLS = yes
+
+build = x86_64-unknown-linux-gnu
+build_alias =
+build_cpu = x86_64
+build_os = linux-gnu
+build_vendor = unknown
+
+endif
diff --git a/configure.ac b/configure.ac
index 5fd73c59f1..0d0c55a0d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,7 +25,7 @@ AC_INIT([systemd],
[systemd],
[http://www.freedesktop.org/wiki/Software/systemd])
-AC_CONFIG_SRCDIR([src/core/main.c])
+AC_CONFIG_SRCDIR([src/grp-system/systemd/main.c])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([build-aux])
@@ -86,11 +86,16 @@ GETTEXT_PACKAGE=systemd
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [systemd])
+AC_PROG_AWK
+AC_PROG_GREP
+AC_PROG_EGREP
+AC_PROG_FGREP
+AC_PROG_INSTALL
AC_PROG_MKDIR_P
+AC_PROG_LEX
AC_PROG_LN_S
AC_PROG_SED
-AC_PROG_GREP
-AC_PROG_AWK
+AC_PROG_YACC
AC_PATH_PROG([M4], [m4])
@@ -1503,11 +1508,24 @@ AC_SUBST([rootprefix], [$with_rootprefix])
AC_SUBST([rootlibdir], [$with_rootlibdir])
AC_CONFIG_FILES([
- Makefile
+ config.mk
+ automake.mk
+ autoconf.mk
+ gnustandards.mk
po/Makefile.in
])
-AC_OUTPUT
+AC_OUTPUT([], [], [
+if test "$srcdir" != .; then
+ {
+ find "$srcdir" -name Makefile -printf '%P\n'
+ find "$srcdir" -name subdir.mk -printf '%P\n'
+ } | while read -r filename; do
+ mkdir -p "\$(dirname "\$filename")"
+ ln -srfT "$srcdir/\$filename" "\$filename"
+ done
+fi
+])
AC_MSG_RESULT([
$PACKAGE_NAME $VERSION
diff --git a/gnustandards.mk.in b/gnustandards.mk.in
new file mode 100644
index 0000000000..9c0dced485
--- /dev/null
+++ b/gnustandards.mk.in
@@ -0,0 +1,138 @@
+# 7.2.2: Utilities in Makefiles
+# -----------------------------
+
+# It's ok to hard-code these commands in rules, but who wants to
+# memorize the list of what's ok?
+AWK = @AWK@# Requires AC_PROG_AWK
+CAT = cat
+CMP = cmp
+CP = cp
+DIFF = diff
+ECHO = echo
+EGREP = @EGREP@# Requires AC_PROG_EGREP
+EXPR = expr
+FALSE = false
+GREP = @GREP@# Requires AC_PROG_GREP
+INSTALL_INFO = install-info
+LN = ln
+LS = ls
+MKDIR = mkdir
+MV = mv
+PRINTF = printf
+PWD = pwd
+RM = rm -f
+RMDIR = rmdir
+SED = sed
+SLEEP = sleep
+SORT = sort
+TAR = tar
+TEST = test
+TOUCH = touch
+TR = tr
+TRUE = true
+
+# These must be user-configurable
+AR = @AR@
+ARFLAGS =
+BISON = bison
+BISONFLAGS =
+CC = @CC@
+CCFLAGS = $(CFLAGS)
+FLEX = flex
+FLEXFLAGS =
+INSTALL = @INSTALL@# Requires AC_PROG_INSTALL
+#INSTALLFLAGS =
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LDCONFIG = ldconfig
+LDCONFIGFLAGS =
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEXFLAGS = $(LFLAGS)
+#MAKE
+MAKEINFO = @MAKEINFO@
+MAKEINFOFLAGS =
+RANLIB = @RANLIB@
+RANLIBFLAGS =
+TEXI2DVI = texi2dvi
+TEXI2DVIFLAGS =
+YACC = @YACC@
+YACCFLAGS = $(YFLAGS)
+
+CFLAGS = @CFLAGS@
+LFLAGS =
+YFLAGS = @YFLAGS@
+
+LN_S = @LN_S@
+
+CHGRP = chgrp
+CHMOD = chmod
+CHOWN = chown
+MKNOD = mknod
+
+# 7.2.3 Variables for Specifying Commands
+# ---------------------------------------
+
+INSTALL_PROGRAM = @INSTALL_PROGRAM@# Requires AC_PROG_INSTALL
+INSTALL_DATA = @INSTALL_DATA@# Requires AC_PROG_INSTALL
+
+# 7.2.5 Variables for Installation Directories
+# --------------------------------------------
+
+# Root for the installation
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+# Executable programs
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+# Data files
+datarootdir = @datarootdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+runstatedir = $(localstatedir)/run# Requires Autoconf 2.70+
+# Specific types of files
+includedir = @includedir@
+oldincludedir = @oldincludedir@
+docdir = @docdir@
+infodir = @infodir@
+htmldir = @htmldir@
+dvidir = @dvidir@
+pdfdir = @pdfdir@
+psdir = @psdir@
+libdir = @libdir@
+lispdir = $(datarootdir)/emacs/site-lisp# Requires manual configure.ac support
+localedir = @localedir@
+
+mandir = @mandir@
+man1dir = $(mandir)/man1
+man2dir = $(mandir)/man2
+man3dir = $(mandir)/man3
+man4dir = $(mandir)/man4
+man5dir = $(mandir)/man5
+man6dir = $(mandir)/man6
+man7dir = $(mandir)/man7
+man8dir = $(mandir)/man8
+
+manext = .1
+man1ext = .1
+man2ext = .2
+man3ext = .3
+man4ext = .4
+man5ext = .5
+man6ext = .6
+man7ext = .7
+man8ext = .8
+
+# 7.2.7: Install Command Categories
+# ---------------------------------
+
+PRE_INSTALL =
+POST_INSTALL =
+NORMAL_INSTALL =
+
+PRE_UNINSTALL =
+POST_UNINSTALL =
+NORMAL_UNINSTALL =
diff --git a/src/Makefile b/src/Makefile
new file mode 100644
index 0000000000..aed2496c29
--- /dev/null
+++ b/src/Makefile
@@ -0,0 +1,36 @@
+# -*- Mode: makefile; indent-tabs-mode: t -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2010-2012 Lennart Poettering
+# Copyright 2010-2012 Kay Sievers
+# Copyright 2013 Zbigniew Jędrzejewski-Szmek
+# Copyright 2013 David Strauss
+# Copyright 2016 Luke Shumaker
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+#
+# systemd is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with systemd; If not, see <http://www.gnu.org/licenses/>.
+include $(dir $(lastword $(MAKEFILE_LIST)))/../config.mk
+include $(topsrcdir)/build-aux/Makefile.head.mk
+
+at.subdirs += busctl
+at.subdirs += grp-boot
+at.subdirs += grp-coredump
+at.subdirs += libbasic
+at.subdirs += libfirewall
+at.subdirs += libshared
+at.subdirs += libsystemd
+at.subdirs += libudev
+at.subdirs += systemd-nspawn
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/busctl/Makefile b/src/busctl/Makefile
index d09dd022a6..261486555d 100644
--- a/src/busctl/Makefile
+++ b/src/busctl/Makefile
@@ -32,7 +32,10 @@ busctl_SOURCES = \
src/libsystemd/sd-bus/busctl-introspect.h
busctl_LDADD = \
- libshared.la
+ $(topoutdir)/src/libshared/libshared.la
$(eval $(value automake2autothing))
+AM_CPPFLAGS += $(libshared.CPPFLAGS)
+AM_CPPFLAGS += $(libbasic.CPPFLAGS)
+AM_CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-internal/sd-bus
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-boot/Makefile b/src/grp-boot/Makefile
new file mode 100644
index 0000000000..922d8a32d3
--- /dev/null
+++ b/src/grp-boot/Makefile
@@ -0,0 +1,28 @@
+# -*- Mode: makefile; indent-tabs-mode: t -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2010-2012 Lennart Poettering
+# Copyright 2010-2012 Kay Sievers
+# Copyright 2013 Zbigniew Jędrzejewski-Szmek
+# Copyright 2013 David Strauss
+# Copyright 2016 Luke Shumaker
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+#
+# systemd is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with systemd; If not, see <http://www.gnu.org/licenses/>.
+include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
+include $(topsrcdir)/build-aux/Makefile.head.mk
+
+at.subdirs += bootctl systemd-boot
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-boot/bootctl/Makefile b/src/grp-boot/bootctl/Makefile
index cc886b6cc4..39a4af1442 100644
--- a/src/grp-boot/bootctl/Makefile
+++ b/src/grp-boot/bootctl/Makefile
@@ -20,7 +20,7 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
-include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
+include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
ifneq ($(ENABLE_EFI),)
@@ -38,7 +38,7 @@ bootctl_CFLAGS = \
$(BLKID_CFLAGS)
bootctl_LDADD = \
- libshared.la \
+ $(topoutdir)/src/libshared/libshared.la \
$(BLKID_LIBS)
bin_PROGRAMS += \
@@ -51,5 +51,10 @@ dist_zshcompletion_data += \
shell-completion/zsh/_bootctl
endif # HAVE_BLKID
endif # ENABLE_EFI
+
$(eval $(value automake2autothing))
+at.depdirs += $(topoutdir)/src/libshared
+AM_CPPFLAGS += $(libshared.CPPFLAGS)
+AM_CPPFLAGS += $(libbasic.CPPFLAGS)
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-boot/systemd-boot/Makefile b/src/grp-boot/systemd-boot/Makefile
index 8caa8cef84..a1e4b6088a 100644
--- a/src/grp-boot/systemd-boot/Makefile
+++ b/src/grp-boot/systemd-boot/Makefile
@@ -20,11 +20,12 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
-include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
+include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
ifneq ($(ENABLE_EFI),)
ifneq ($(HAVE_GNUEFI),)
+# ------------------------------------------------------------------------------
efi_cppflags = \
$(EFI_CPPFLAGS) \
-I$(top_builddir) -include config.h \
@@ -81,17 +82,19 @@ EFI_FORMAT = -O binary
else
EFI_FORMAT = --target=efi-app-$(EFI_ARCH)
endif # ARCH_AARCH64
-endif # HAVE_GNUEFI
-endif # ENABLE_EFI
-# ------------------------------------------------------------------------------
-systemd_boot_headers = \
- src/boot/efi/util.h \
- src/boot/efi/console.h \
- src/boot/efi/graphics.h \
- src/boot/efi/pefile.h \
- src/boot/efi/disk.h
+$(outdir)/%.o: $(srcdir)/%.c
+ $(AM_V_CC)$(EFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@
+$(outdir)/%.so:
+ @if test $(words $^) = 0; then echo 'Cannot link EFI library with no dependencies: $@' >&2; exit 1; fi
+ $(AM_V_CCLD)$(LD) $(efi_ldflags) $^ -o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name)
+ $(AM_V_at)! { nm -D -u $@ | grep ' U '; }
+
+# These next 2 are the same rule
+$(outdir)/%$(EFI_MACHINE_TYPE_NAME).efi : $(outdir)/%.so; $(AM_V_GEN)$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel -j .rela -j .reloc $(EFI_FORMAT) $< $@
+$(outdir)/%$(EFI_MACHINE_TYPE_NAME).efi.stub: $(outdir)/%.so; $(AM_V_GEN)$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel -j .rela -j .reloc $(EFI_FORMAT) $< $@
+# ------------------------------------------------------------------------------
systemd_boot_sources = \
src/boot/efi/util.c \
src/boot/efi/console.c \
@@ -100,42 +103,11 @@ systemd_boot_sources = \
src/boot/efi/disk.c \
src/boot/efi/boot.c
-EXTRA_DIST += $(systemd_boot_sources) $(systemd_boot_headers)
-
-systemd_boot_objects = $(addprefix $(top_builddir)/,$(systemd_boot_sources:.c=.o))
-systemd_boot_solib = $(top_builddir)/src/boot/efi/systemd_boot.so
systemd_boot = systemd-boot$(EFI_MACHINE_TYPE_NAME).efi
-
-ifneq ($(ENABLE_EFI),)
-ifneq ($(HAVE_GNUEFI),)
-bootlib_DATA = $(systemd_boot)
-
-$(outdir)/%.o: $(top_srcdir)/src/boot/efi/%.c $(addprefix $(top_srcdir)/,$(systemd_boot_headers))
- @$(MKDIR_P) $(top_builddir)/src/boot/efi/
- $(AM_V_CC)$(EFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@
-
-$(systemd_boot_solib): $(systemd_boot_objects)
- $(AM_V_CCLD)$(LD) $(efi_ldflags) $(systemd_boot_objects) \
- -o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name); \
- nm -D -u $@ | grep ' U ' && exit 1 || :
-
-$(systemd_boot): $(systemd_boot_solib)
- $(AM_V_GEN)$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \
- -j .dynsym -j .rel -j .rela -j .reloc $(EFI_FORMAT) $< $@
-endif # HAVE_GNUEFI
-endif # ENABLE_EFI
-
-CLEANFILES += $(systemd_boot_objects) $(systemd_boot_solib) $(systemd_boot)
-
+std.out_files += $(systemd_boot)
+std.sys_files += $(bootlibdir)/$(systemd_boot)
+$(outdir)/systemd-boot.so: $(addprefix $(outdir)/,$(notdir $(systemd_boot_sources:.c=.o)))
# ------------------------------------------------------------------------------
-stub_headers = \
- src/boot/efi/util.h \
- src/boot/efi/pefile.h \
- src/boot/efi/disk.h \
- src/boot/efi/graphics.h \
- src/boot/efi/splash.h \
- src/boot/efi/linux.h
-
stub_sources = \
src/boot/efi/util.c \
src/boot/efi/pefile.c \
@@ -145,47 +117,19 @@ stub_sources = \
src/boot/efi/linux.c \
src/boot/efi/stub.c
-EXTRA_DIST += \
- $(stub_sources) \
- $(stub_headers) \
- test/splash.bmp
-
-stub_objects = $(addprefix $(top_builddir)/,$(stub_sources:.c=.o))
-stub_solib = $(top_builddir)/src/boot/efi/stub.so
stub = linux$(EFI_MACHINE_TYPE_NAME).efi.stub
-
-ifneq ($(ENABLE_EFI),)
-ifneq ($(HAVE_GNUEFI),)
-bootlib_DATA += $(stub)
-
-$(outdir)/%.o: $(top_srcdir)/src/boot/efi/%.c $(addprefix $(top_srcdir)/,$(stub_headers))
- @$(MKDIR_P) $(top_builddir)/src/boot/efi/
- $(AM_V_CC)$(EFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@
-
-$(stub_solib): $(stub_objects)
- $(AM_V_CCLD)$(LD) $(efi_ldflags) $(stub_objects) \
- -o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name); \
- nm -D -u $@ | grep ' U ' && exit 1 || :
-
-$(stub): $(stub_solib)
- $(AM_V_GEN)$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \
- -j .dynsym -j .rel -j .rela -j .reloc $(EFI_FORMAT) $< $@
-endif # HAVE_GNUEFI
-endif # ENABLE_EFI
-
-CLEANFILES += $(stub_objects) $(stub_solib) $(stub)
-
-
+std.out_files += $(stub)
+std.sys_files += $(bootlibdir)/$(stub)
+$(outdir)/linux.so: $(addprefix $(outdir)/,$(notdir $(stub_sources:.c=.o)))
# ------------------------------------------------------------------------------
-CLEANFILES += test-efi-disk.img
-
-test-efi-disk.img: $(systemd_boot) $(stub) test/test-efi-create-disk.sh
- $(AM_V_GEN)test/test-efi-create-disk.sh
+$(outdir)/test-efi-disk.img: $(outdir)/$(systemd_boot) $(outdir)/$(stub) $(srcdir)/test-efi-create-disk.sh
+ $(AM_V_GEN)$(@D)/test-efi-create-disk.sh
-test-efi: test-efi-disk.img
+test-efi: $(outdir)/test-efi-disk.img
$(QEMU) -machine accel=kvm -m 1024 -bios $(QEMU_BIOS) -snapshot test-efi-disk.img
-EXTRA_DIST += test/test-efi-create-disk.sh
-
-$(eval $(value automake2autothing))
+std.clean_files += test-efi-disk.img
+# ------------------------------------------------------------------------------
+endif # HAVE_GNUEFI
+endif # ENABLE_EFI
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/test/test-efi-create-disk.sh b/src/grp-boot/systemd-boot/test-efi-create-disk.sh
index 56dd09abd7..56dd09abd7 100755
--- a/test/test-efi-create-disk.sh
+++ b/src/grp-boot/systemd-boot/test-efi-create-disk.sh
diff --git a/src/grp-coredump/Makefile b/src/grp-coredump/Makefile
new file mode 100644
index 0000000000..2e604d7b86
--- /dev/null
+++ b/src/grp-coredump/Makefile
@@ -0,0 +1,28 @@
+# -*- Mode: makefile; indent-tabs-mode: t -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2010-2012 Lennart Poettering
+# Copyright 2010-2012 Kay Sievers
+# Copyright 2013 Zbigniew Jędrzejewski-Szmek
+# Copyright 2013 David Strauss
+# Copyright 2016 Luke Shumaker
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+#
+# systemd is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with systemd; If not, see <http://www.gnu.org/licenses/>.
+include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
+include $(topsrcdir)/build-aux/Makefile.head.mk
+
+at.subdirs += coredumpctl systemd-coredump
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-coredump/coredumpctl/Makefile b/src/grp-coredump/coredumpctl/Makefile
index c300710492..ca992c9850 100644
--- a/src/grp-coredump/coredumpctl/Makefile
+++ b/src/grp-coredump/coredumpctl/Makefile
@@ -20,14 +20,14 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
-include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
+include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
coredumpctl_SOURCES = \
src/coredump/coredumpctl.c
coredumpctl_LDADD = \
- libshared.la
+ $(topoutdir)/src/libshared/libshared.la
bin_PROGRAMS += \
coredumpctl
@@ -39,4 +39,7 @@ dist_zshcompletion_data += \
shell-completion/zsh/_coredumpctl
$(eval $(value automake2autothing))
+AM_CPPFLAGS += $(libbasic.CPPFLAGS)
+AM_CPPFLAGS += $(libshared.CPPFLAGS)
+AM_CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-journal-internal
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-coredump/systemd-coredump/Makefile b/src/grp-coredump/systemd-coredump/Makefile
index 23f2747683..9d7d931a46 100644
--- a/src/grp-coredump/systemd-coredump/Makefile
+++ b/src/grp-coredump/systemd-coredump/Makefile
@@ -20,7 +20,7 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
-include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
+include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
ifneq ($(ENABLE_COREDUMP),)
@@ -30,7 +30,7 @@ systemd_coredump_SOURCES = \
src/coredump/coredump-vacuum.h
systemd_coredump_LDADD = \
- libshared.la
+ $(topoutdir)/src/libshared/libshared.la
ifneq ($(HAVE_ELFUTILS),)
systemd_coredump_SOURCES += \
@@ -79,4 +79,9 @@ EXTRA_DIST += \
units/systemd-coredump@.service.in
$(eval $(value automake2autothing))
+AM_CPPFLAGS += $(libbasic.CPPFLAGS)
+AM_CPPFLAGS += $(libshared.CPPFLAGS)
+AM_CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-journal-internal
+AM_CPPFLAGS += -I$(topsrcdir)/src/journal
+AM_CPPFLAGS += -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\"
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-machine/Makefile b/src/grp-machine/Makefile
new file mode 100644
index 0000000000..7412341233
--- /dev/null
+++ b/src/grp-machine/Makefile
@@ -0,0 +1,29 @@
+# -*- Mode: makefile; indent-tabs-mode: t -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2010-2012 Lennart Poettering
+# Copyright 2010-2012 Kay Sievers
+# Copyright 2013 Zbigniew Jędrzejewski-Szmek
+# Copyright 2013 David Strauss
+# Copyright 2016 Luke Shumaker
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+#
+# systemd is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with systemd; If not, see <http://www.gnu.org/licenses/>.
+include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
+include $(topsrcdir)/build-aux/Makefile.head.mk
+
+at.subdirs += machinectl systemd-machined
+at.subdirs += nss-mymachines
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-machine/libmachine-core/Makefile b/src/grp-machine/libmachine-core/Makefile
index 7dc9d419b6..b41a1d77e8 100644
--- a/src/grp-machine/libmachine-core/Makefile
+++ b/src/grp-machine/libmachine-core/Makefile
@@ -20,7 +20,7 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
-include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
+include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
libmachine_core_la_SOURCES = \
@@ -33,7 +33,7 @@ libmachine_core_la_SOURCES = \
src/machine/image-dbus.h
libmachine_core_la_LIBADD = \
- libshared.la
+ $(topoutdir)/src/libshared/libshared.la
noinst_LTLIBRARIES += \
libmachine-core.la
@@ -48,4 +48,9 @@ tests += \
test-machine-tables
$(eval $(value automake2autothing))
+at.depdirs += $(topoutdir)/src/libsystemd/libsystemd-internal
+AM_CPPFLAGS += $(libshared.CPPFLAGS)
+AM_CPPFLAGS += $(libbasic.CPPFLAGS)
+AM_CPPFLAGS += $(libsystemd.CPPFLAGS)
+AM_CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-internal/sd-bus
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-machine/nss-mymachines/Makefile b/src/grp-machine/nss-mymachines/Makefile
index 2d0248a0a3..9e06a5e767 100644
--- a/src/grp-machine/nss-mymachines/Makefile
+++ b/src/grp-machine/nss-mymachines/Makefile
@@ -20,7 +20,7 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
-include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
+include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
@@ -35,13 +35,16 @@ libnss_mymachines_la_LDFLAGS = \
-avoid-version \
-shared \
-shrext .so.2 \
- -Wl,--version-script=$(top_srcdir)/src/nss-mymachines/nss-mymachines.sym
+ -Wl,--version-script=$(srcdir)/nss-mymachines.sym
libnss_mymachines_la_LIBADD = \
- libsystemd-internal.la
+ $(topoutdir)/src/libsystemd/libsystemd-internal/libsystemd-internal.la
lib_LTLIBRARIES += \
libnss_mymachines.la
$(eval $(value automake2autothing))
+at.depdirs += $(topoutdir)/src/libsystemd/libsystemd-internal
+AM_CPPFLAGS += $(libbasic.CPPFLAGS)
+AM_CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-internal/sd-bus
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libbasic/Makefile b/src/libbasic/Makefile
index 744ccd6801..79ec1b26cc 100644
--- a/src/libbasic/Makefile
+++ b/src/libbasic/Makefile
@@ -265,8 +265,8 @@ $(outdir)/arphrd-from-name.gperf: $(outdir)/arphrd-list.txt
$(AM_V_GEN)$(AWK) 'BEGIN{ print "struct arphrd_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, ARPHRD_%s\n", $$1, $$1 }' <$< >$@
-$(outdir)/cap-list.txt:
- $(AM_V_GEN)$(CPP) $(ALL_CPPFLAGS) -dM -include linux/capability.h -include missing.h - </dev/null | $(AWK) '/^#define[ \t]+CAP_[A-Z_]+[ \t]+/ { print $$2; }' | grep -v CAP_LAST_CAP >$@
+$(outdir)/cap-list.txt: $(srcdir)/missing.h
+ $(AM_V_GEN)$(CPP) $(ALL_CPPFLAGS) -dM -include linux/capability.h -include $< - </dev/null | $(AWK) '/^#define[ \t]+CAP_[A-Z_]+[ \t]+/ { print $$2; }' | grep -v CAP_LAST_CAP >$@
$(outdir)/cap-to-name.h: $(outdir)/cap-list.txt
$(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const capability_names[] = { "} { printf "[%s] = \"%s\",\n", $$1, tolower($$1) } END{print "};"}' <$< >$@
@@ -278,4 +278,9 @@ $(outdir)/cap-from-name.h: $(outdir)/cap-from-name.gperf
$(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_capability -H hash_capability_name -p -C <$< >$@
$(eval $(value automake2autothing))
+$(outdir)/af-list.lo: $(outdir)/af-from-name.h $(outdir)/af-to-name.h
+$(outdir)/arphrd-list.lo: $(outdir)/arphrd-from-name.h $(outdir)/arphrd-to-name.h
+$(outdir)/cap-list.lo: $(outdir)/cap-from-name.h $(outdir)/cap-to-name.h
+$(outdir)/errno-list.lo: $(outdir)/errno-from-name.h $(outdir)/errno-to-name.h
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libcore/loopback-setup.c b/src/libcore/loopback-setup.c
index d56bbfa6fc..1a8ec6166e 100644
--- a/src/libcore/loopback-setup.c
+++ b/src/libcore/loopback-setup.c
@@ -24,7 +24,6 @@
#include "loopback-setup.h"
#include "missing.h"
-#include "netlink-util.h"
static int start_loopback(sd_netlink *rtnl) {
_cleanup_(sd_netlink_message_unrefp) sd_netlink_message *req = NULL;
diff --git a/src/libfirewall/Makefile b/src/libfirewall/Makefile
index 99a428fcd9..7ddfc7d288 100644
--- a/src/libfirewall/Makefile
+++ b/src/libfirewall/Makefile
@@ -40,4 +40,6 @@ libfirewall_la_LIBADD = \
endif # HAVE_LIBIPTC
$(eval $(value automake2autothing))
+AM_CPPFLAGS += $(libbasic.CPPFLAGS)
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libshared/Makefile b/src/libshared/Makefile
index e58f999e2b..4e05381339 100644
--- a/src/libshared/Makefile
+++ b/src/libshared/Makefile
@@ -27,6 +27,8 @@ noinst_LTLIBRARIES += \
libshared.la
libshared_la_SOURCES = \
+ src/libsystemd/sd-netlink/local-addresses.h \
+ src/libsystemd/sd-netlink/local-addresses.c \
src/shared/output-mode.h \
src/shared/gpt.h \
src/shared/udev-util.h \
@@ -130,9 +132,9 @@ libshared_la_CFLAGS = \
$(SECCOMP_CFLAGS)
libshared_la_LIBADD = \
- libsystemd-internal.la \
- libsystemd-journal-internal.la \
- libudev-internal.la \
+ $(topoutdir)/src/libsystemd/libsystemd-internal/libsystemd-internal.la \
+ $(topoutdir)/src/libsystemd/libsystemd-journal-internal/libsystemd-journal-internal.la \
+ $(topoutdir)/src/libudev/src/libudev.la \
$(ACL_LIBS) \
$(LIBIDN_LIBS) \
$(SECCOMP_LIBS)
@@ -144,4 +146,29 @@ test_local_addresses_LDADD = \
libshared.la
$(eval $(value automake2autothing))
+at.depdirs += $(topoutdir)/src/libsystemd/libsystemd-internal
+at.depdirs += $(topoutdir)/src/libsystemd/libsystemd-journal-internal
+at.depdirs += $(topoutdir)/src/libudev/src
+AM_CPPFLAGS += $(libbasic.CPPFLAGS)
+AM_CPPFLAGS += $(libsystemd.CPPFLAGS)
+AM_CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-journal-internal
+AM_CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-internal/sd-bus
+
+AM_CPPFLAGS += -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\"
+AM_CPPFLAGS += -DSYSTEM_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/system\"
+AM_CPPFLAGS += -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\"
+AM_CPPFLAGS += -DSYSTEM_SYSVINIT_PATH=\"$(SYSTEM_SYSVINIT_PATH)\"
+AM_CPPFLAGS += -DSYSTEM_SYSVRCND_PATH=\"$(SYSTEM_SYSVRCND_PATH)\"
+AM_CPPFLAGS += -DUSER_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/user\"
+AM_CPPFLAGS += -DUSER_DATA_UNIT_PATH=\"$(userunitdir)\"
+
+AM_CPPFLAGS += -DSYSTEMD_FSCK_PATH=\"$(rootlibexecdir)/systemd-fsck\"
+
+AM_CPPFLAGS += -DSYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH=\"$(rootbindir)/systemd-tty-ask-password-agent\"
+
+AM_CPPFLAGS += -DSYSTEM_GENERATOR_PATH=\"$(systemgeneratordir)\"
+AM_CPPFLAGS += -DUSER_GENERATOR_PATH=\"$(usergeneratordir)\"
+
+AM_CPPFLAGS += -DPOLKIT_AGENT_BINARY_PATH=\"$(bindir)/pkttyagent\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libshared/local-addresses.c b/src/libshared/local-addresses.c
index e6feb859cd..fafc208eca 100644
--- a/src/libshared/local-addresses.c
+++ b/src/libshared/local-addresses.c
@@ -23,7 +23,6 @@
#include "alloc-util.h"
#include "local-addresses.h"
#include "macro.h"
-#include "netlink-util.h"
static int address_compare(const void *_a, const void *_b) {
const struct local_address *a = _a, *b = _b;
diff --git a/src/libsystemd/Makefile b/src/libsystemd/Makefile
index 43d06ad24f..47db55a00d 100644
--- a/src/libsystemd/Makefile
+++ b/src/libsystemd/Makefile
@@ -50,11 +50,11 @@ EXTRA_DIST += \
src/libsystemd/sd-bus/DIFFERENCES \
src/libsystemd/sd-bus/GVARIANT-SERIALIZATION
-libsystemd_la_SOURCES = \
+_libsystemd_la_SOURCES = \
$(libsystemd_internal_la_SOURCES) \
$(libsystemd_journal_internal_la_SOURCES)
-nodist_libsystemd_la_SOURCES = \
+_nodist_libsystemd_la_SOURCES = \
$(nodist_libsystemd_internal_la_SOURCES)
libsystemd_la_CFLAGS = \
@@ -64,7 +64,7 @@ libsystemd_la_CFLAGS = \
libsystemd_la_LDFLAGS = \
$(AM_LDFLAGS) \
-version-info $(LIBSYSTEMD_CURRENT):$(LIBSYSTEMD_REVISION):$(LIBSYSTEMD_AGE) \
- -Wl,--version-script=$(top_srcdir)/src/libsystemd/libsystemd.sym
+ -Wl,--version-script=$(srcdir)/libsystemd.sym
libsystemd_la_LIBADD = \
$(libsystemd_internal_la_LIBADD) \
@@ -127,4 +127,10 @@ test_libsystemd_sym_LDADD = \
libsystemd.la
$(eval $(value automake2autothing))
+$(outdir)/libsystemd.la: $(srcdir)/libsystemd.sym
+$(outdir)/libsystemd.la: $(outdir)/libsystemd-internal/libsystemd-internal.la
+$(outdir)/libsystemd.la: $(outdir)/libsystemd-journal-internal/libsystemd-journal-internal.la
+at.subdirs += libsystemd-internal libsystemd-journal-internal
+systemd.sed_files += libsystemd.pc
+#at.subdirs += compat-libs
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libsystemd/libsystemd-internal/Makefile b/src/libsystemd/libsystemd-internal/Makefile
index 23090bd7be..76818c80cf 100644
--- a/src/libsystemd/libsystemd-internal/Makefile
+++ b/src/libsystemd/libsystemd-internal/Makefile
@@ -20,7 +20,7 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
-include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
+include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
libsystemd_internal_la_SOURCES = \
@@ -92,8 +92,6 @@ libsystemd_internal_la_SOURCES = \
src/libsystemd/sd-netlink/netlink-types.c \
src/libsystemd/sd-netlink/netlink-util.h \
src/libsystemd/sd-netlink/netlink-util.c \
- src/libsystemd/sd-netlink/local-addresses.h \
- src/libsystemd/sd-netlink/local-addresses.c \
src/libsystemd/sd-id128/sd-id128.c \
src/libsystemd/sd-daemon/sd-daemon.c \
src/libsystemd/sd-login/sd-login.c \
@@ -114,7 +112,7 @@ libsystemd_internal_la_SOURCES = \
src/libsystemd/sd-resolve/sd-resolve.c
libsystemd_internal_la_LIBADD = \
- libbasic.la \
+ $(topoutdir)/src/libbasic/libbasic.la \
-lresolv
noinst_LTLIBRARIES += \
@@ -250,5 +248,18 @@ test_resolve_SOURCES = \
test_resolve_LDADD = \
libshared.la
+automake_sources = $(patsubst src/libsystemd/%,$(outdir)/%,$(filter %.c,$($(automake_name)_SOURCES) $(nodist_$(automake_name)_SOURCES)))
$(eval $(value automake2autothing))
+_subdirs := $(notdir $(patsubst %/,%,$(dir $(call automake_sources,libsystemd-internal.la))))
+automake_sources = $(addprefix $(outdir)/,$(notdir $($(automake_name)_SOURCES) $(nodist_$(automake_name)_SOURCES)))
+
+at.subdirs += $(_subdirs)
+at.depdirs += $(topoutdir)/src/libbasic
+
+AM_CPPFLAGS += $(libsystemd.CPPFLAGS)
+AM_CPPFLAGS += $(libbasic.CPPFLAGS)
+AM_CPPFLAGS += $(libshared.CPPFLAGS)
+AM_CPPFLAGS += -DLIBDIR=\"$(libdir)\"
+AM_CPPFLAGS += -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libsystemd/libsystemd-internal/sd-bus/Makefile b/src/libsystemd/libsystemd-internal/sd-bus/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/libsystemd-internal/sd-bus/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/libsystemd-internal/sd-daemon/Makefile b/src/libsystemd/libsystemd-internal/sd-daemon/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/libsystemd-internal/sd-daemon/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/libsystemd-internal/sd-device/Makefile b/src/libsystemd/libsystemd-internal/sd-device/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/libsystemd-internal/sd-device/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/libsystemd-internal/sd-event/Makefile b/src/libsystemd/libsystemd-internal/sd-event/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/libsystemd-internal/sd-event/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/libsystemd-internal/sd-hwdb/Makefile b/src/libsystemd/libsystemd-internal/sd-hwdb/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/libsystemd-internal/sd-hwdb/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/libsystemd-internal/sd-id128/Makefile b/src/libsystemd/libsystemd-internal/sd-id128/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/libsystemd-internal/sd-id128/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/libsystemd-internal/sd-login/Makefile b/src/libsystemd/libsystemd-internal/sd-login/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/libsystemd-internal/sd-login/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/libsystemd-internal/sd-netlink/Makefile b/src/libsystemd/libsystemd-internal/sd-netlink/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/libsystemd-internal/sd-netlink/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/libsystemd-internal/sd-network/Makefile b/src/libsystemd/libsystemd-internal/sd-network/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/libsystemd-internal/sd-network/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/libsystemd-internal/sd-path/Makefile b/src/libsystemd/libsystemd-internal/sd-path/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/libsystemd-internal/sd-path/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/libsystemd-internal/sd-resolve/Makefile b/src/libsystemd/libsystemd-internal/sd-resolve/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/libsystemd-internal/sd-resolve/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/libsystemd-internal/sd-utf8/Makefile b/src/libsystemd/libsystemd-internal/sd-utf8/Makefile
new file mode 120000
index 0000000000..71a1159ce0
--- /dev/null
+++ b/src/libsystemd/libsystemd-internal/sd-utf8/Makefile
@@ -0,0 +1 @@
+../subdir.mk \ No newline at end of file
diff --git a/src/libsystemd/libsystemd-internal/subdir.mk b/src/libsystemd/libsystemd-internal/subdir.mk
new file mode 100644
index 0000000000..96b7145434
--- /dev/null
+++ b/src/libsystemd/libsystemd-internal/subdir.mk
@@ -0,0 +1,10 @@
+include $(dir $(lastword $(MAKEFILE_LIST)))/../../../../config.mk
+include $(topsrcdir)/build-aux/Makefile.head.mk
+
+AM_CPPFLAGS += $(libsystemd.CPPFLAGS)
+AM_CPPFLAGS += $(libbasic.CPPFLAGS)
+AM_CPPFLAGS += $(libshared.CPPFLAGS)
+AM_CPPFLAGS += -DLIBDIR=\"$(libdir)\"
+AM_CPPFLAGS += -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\"
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libsystemd/libsystemd-journal-internal/Makefile b/src/libsystemd/libsystemd-journal-internal/Makefile
index dffb4176ee..6d0be9edff 100644
--- a/src/libsystemd/libsystemd-journal-internal/Makefile
+++ b/src/libsystemd/libsystemd-journal-internal/Makefile
@@ -20,15 +20,15 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
-include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
+include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
-audit_list_includes = -include linux/audit.h -include missing.h
+audit_list_includes = -include linux/audit.h -include $(topsrcdir)/src/libbasic/missing.h
ifneq ($(HAVE_AUDIT),)
audit_list_includes += -include libaudit.h
endif # HAVE_AUDIT
-$(outdir)/audit_type-list.txt:
+$(outdir)/audit_type-list.txt: $(call at.path,$(topsrcdir)/src/libbasic/missing.h)
$(AM_V_GEN)$(CPP) $(ALL_CPPFLAGS) -dM $(audit_list_includes) - </dev/null | grep -vE 'AUDIT_.*(FIRST|LAST)_' | $(SED) -r -n 's/^#define\s+AUDIT_(\w+)\s+([0-9]{4})\s*$$/\1\t\2/p' | sort -k2 >$@
$(outdir)/audit_type-to-name.h: $(outdir)/audit_type-list.txt
@@ -108,5 +108,10 @@ endif # HAVE_GCRYPT
noinst_LTLIBRARIES += \
libsystemd-journal-internal.la
+
$(eval $(value automake2autothing))
+AM_CPPFLAGS += $(libbasic.CPPFLAGS)
+AM_CPPFLAGS += -DCATALOG_DATABASE=\"$(catalogstatedir)/database\"
+$(outdir)/audit-type.lo: $(outdir)/audit_type-to-name.h
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libudev/Makefile b/src/libudev/Makefile
new file mode 100644
index 0000000000..8d9fecb1fb
--- /dev/null
+++ b/src/libudev/Makefile
@@ -0,0 +1,28 @@
+# -*- Mode: makefile; indent-tabs-mode: t -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2010-2012 Lennart Poettering
+# Copyright 2010-2012 Kay Sievers
+# Copyright 2013 Zbigniew Jędrzejewski-Szmek
+# Copyright 2013 David Strauss
+# Copyright 2016 Luke Shumaker
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+#
+# systemd is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with systemd; If not, see <http://www.gnu.org/licenses/>.
+include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
+include $(topsrcdir)/build-aux/Makefile.head.mk
+
+at.subdirs += src
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/libudev/src/Makefile b/src/libudev/src/Makefile
index 1dd575021c..d36fa93e0e 100644
--- a/src/libudev/src/Makefile
+++ b/src/libudev/src/Makefile
@@ -20,7 +20,7 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
-include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
+include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
LIBUDEV_CURRENT=7
@@ -50,10 +50,10 @@ libudev_la_SOURCES =\
libudev_la_LDFLAGS = \
$(AM_LDFLAGS) \
-version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE) \
- -Wl,--version-script=$(top_srcdir)/src/libudev/libudev.sym
+ -Wl,--version-script=$(srcdir)/libudev.sym
libudev_la_LIBADD = \
- libsystemd-internal.la
+ $(topoutdir)/src/libsystemd/libsystemd-internal/libsystemd-internal.la
pkgconfiglib_DATA += \
src/libudev/libudev.pc
@@ -61,9 +61,9 @@ pkgconfiglib_DATA += \
EXTRA_DIST += \
src/libudev/libudev.pc.in
-test-libudev-sym.c: \
- src/libudev/libudev.sym \
- src/udev/udev.h
+$(outdir)/test-libudev-sym.c: \
+ $(srcdir)/libudev.sym \
+ $(srcdir)/udev.h
$(generate-sym-test)
nodist_test_libudev_sym_SOURCES = \
@@ -75,4 +75,11 @@ test_libudev_sym_LDADD = \
libudev.la
$(eval $(value automake2autothing))
+systemd.sed_files += libudev.pc
+AM_CPPFLAGS += $(libbasic.CPPFLAGS)
+AM_CPPFLAGS += $(libsystemd.CPPFLAGS)
+AM_CPPFLAGS += $(libsystemd.CPPFLAGS)
+AM_CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-internal/sd-device
+AM_CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-internal/sd-hwdb
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-nspawn/Makefile b/src/systemd-nspawn/Makefile
index 5ec68fb205..4c7606494f 100644
--- a/src/systemd-nspawn/Makefile
+++ b/src/systemd-nspawn/Makefile
@@ -58,13 +58,22 @@ systemd_nspawn_CFLAGS = \
$(SECCOMP_CFLAGS)
systemd_nspawn_LDADD = \
- libshared.la \
+ $(topoutdir)/src/libshared/libshared.la \
$(BLKID_LIBS)
ifneq ($(HAVE_LIBIPTC),)
systemd_nspawn_LDADD += \
- libfirewall.la
+ $(topoutdir)/src/libfirewall/libfirewall.la
endif # HAVE_LIBIPTC
+bin_PROGRAMS += systemd-nspawn
$(eval $(value automake2autothing))
+at.depdirs += $(topoutdir)/src/libshared $(if $(HAVE_LIBIPTC),$(topoutdir)/src/libfirewall)
+AM_CPPFLAGS += $(libshared.CPPFLAGS) $(if $(HAVE_LIBIPTC),$(libfirewall.CPPFLAGS))
+
+AM_CPPFLAGS += $(libbasic.CPPFLAGS)
+AM_CPPFLAGS += $(libsystemd.CPPFLAGS)
+AM_CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-internal/sd-bus
+AM_CPPFLAGS += -I$(topsrcdir)/src/libudev/src
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/systemd-nspawn/loopback-setup.c b/src/systemd-nspawn/loopback-setup.c
new file mode 120000
index 0000000000..1078ace0bf
--- /dev/null
+++ b/src/systemd-nspawn/loopback-setup.c
@@ -0,0 +1 @@
+../libcore/loopback-setup.c \ No newline at end of file
diff --git a/src/systemd-nspawn/loopback-setup.h b/src/systemd-nspawn/loopback-setup.h
new file mode 120000
index 0000000000..18fc7663a2
--- /dev/null
+++ b/src/systemd-nspawn/loopback-setup.h
@@ -0,0 +1 @@
+../libcore/loopback-setup.h \ No newline at end of file
diff --git a/src/systemd-nspawn/mount-setup.c b/src/systemd-nspawn/mount-setup.c
new file mode 120000
index 0000000000..a4ab487157
--- /dev/null
+++ b/src/systemd-nspawn/mount-setup.c
@@ -0,0 +1 @@
+../libcore/mount-setup.c \ No newline at end of file
diff --git a/src/systemd-nspawn/mount-setup.h b/src/systemd-nspawn/mount-setup.h
new file mode 120000
index 0000000000..1f984851f8
--- /dev/null
+++ b/src/systemd-nspawn/mount-setup.h
@@ -0,0 +1 @@
+../libcore/mount-setup.h \ No newline at end of file
diff --git a/src/systemd-nspawn/nspawn-expose-ports.c b/src/systemd-nspawn/nspawn-expose-ports.c
index 8122a14f7b..71eb88873c 100644
--- a/src/systemd-nspawn/nspawn-expose-ports.c
+++ b/src/systemd-nspawn/nspawn-expose-ports.c
@@ -24,7 +24,6 @@
#include "firewall-util.h"
#include "in-addr-util.h"
#include "local-addresses.h"
-#include "netlink-util.h"
#include "nspawn-expose-ports.h"
#include "parse-util.h"
#include "socket-util.h"
diff --git a/src/systemd-nspawn/nspawn-network.c b/src/systemd-nspawn/nspawn-network.c
index d03fd001a7..58d6035ddb 100644
--- a/src/systemd-nspawn/nspawn-network.c
+++ b/src/systemd-nspawn/nspawn-network.c
@@ -26,7 +26,6 @@
#include "alloc-util.h"
#include "ether-addr-util.h"
-#include "netlink-util.h"
#include "nspawn-network.h"
#include "siphash24.h"
#include "string-util.h"
diff --git a/src/systemd-nspawn/nspawn-register.c b/src/systemd-nspawn/nspawn-register.c
index 3b0d778f43..de1433a5e2 100644
--- a/src/systemd-nspawn/nspawn-register.c
+++ b/src/systemd-nspawn/nspawn-register.c
@@ -19,7 +19,7 @@
#include <systemd/sd-bus.h>
-#include "bus-error.h"
+#include "bus-error.h" /* for bus_error_message */
#include "bus-util.h"
#include "nspawn-register.h"
#include "stat-util.h"
diff --git a/src/systemd-nspawn/nspawn.c b/src/systemd-nspawn/nspawn.c
index add66be183..1de527b57b 100644
--- a/src/systemd-nspawn/nspawn.c
+++ b/src/systemd-nspawn/nspawn.c
@@ -69,7 +69,6 @@
#include "missing.h"
#include "mkdir.h"
#include "mount-util.h"
-#include "netlink-util.h"
#include "nspawn-cgroup.h"
#include "nspawn-expose-ports.h"
#include "nspawn-mount.h"