From 9c9b5ae7cf7d79c83a62d6842f50b6b8a1ae1183 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 4 Jun 2016 17:06:17 -0400 Subject: stuff --- build-aux/Makefile.each.tail/20-systemd.mk | 4 ++++ build-aux/Makefile.once.head/20-systemd.mk | 15 ++++++++++----- build-aux/Makefile.tail.mk | 2 +- src/libshared/Makefile | 9 +++++---- src/libsystemd/libsystemd-journal-internal/Makefile | 2 +- src/systemd-nspawn/Makefile | 16 ++++++++-------- 6 files changed, 29 insertions(+), 19 deletions(-) diff --git a/build-aux/Makefile.each.tail/20-systemd.mk b/build-aux/Makefile.each.tail/20-systemd.mk index 523d22cb6b..e70a71ce90 100644 --- a/build-aux/Makefile.each.tail/20-systemd.mk +++ b/build-aux/Makefile.each.tail/20-systemd.mk @@ -42,7 +42,11 @@ _systemd.rpath = $(dir $(patsubst $(DESTDIR)%,%,$(filter %/$(@F),$(std.sys_files _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)): $(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) diff --git a/build-aux/Makefile.once.head/20-systemd.mk b/build-aux/Makefile.once.head/20-systemd.mk index e43276d004..4b4c1b6187 100644 --- a/build-aux/Makefile.once.head/20-systemd.mk +++ b/build-aux/Makefile.once.head/20-systemd.mk @@ -198,7 +198,7 @@ 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_libs = $($(automake_name)_LIBADD) $($(automake_name)_LDADD) define automake2autothing std.out_files += $(noinst_LTLIBRARIES) $(lib_LTLIBRARIES) @@ -218,8 +218,13 @@ $(foreach n,$(call automake_name,$(std.out_files)),\ $(eval $n_LDFLAGS ?=)\ $(eval $n_LIBADD ?=)) $(foreach t,$(filter %.la,$(std.out_files)),\ - $(eval $(outdir)/$t: $(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) )) + $(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),\ + $(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.tail.mk b/build-aux/Makefile.tail.mk index dfbad5ac16..b1c50457b7 100644 --- a/build-aux/Makefile.tail.mk +++ b/build-aux/Makefile.tail.mk @@ -18,7 +18,7 @@ include $(call _at.reverse,$(sort $(wildcard $(topsrcdir)/build-aux/Makefile.each.tail/*.mk))) at.subdirs := $(patsubst ./%,%,$(addprefix $(outdir)/,$(at.subdirs))) -at.depdirs := $(patsubst ./%,%,$(addprefix $(outdir)/,$(at.depdirs))) +at.depdirs := $(at.depdirs) # Move all of the dirlocal variables to their namespaced version $(foreach v,$(at.dirlocal),$(eval $v/$(outdir) := $$($v))) diff --git a/src/libshared/Makefile b/src/libshared/Makefile index 5a4c868193..4c1b794812 100644 --- a/src/libshared/Makefile +++ b/src/libshared/Makefile @@ -130,18 +130,19 @@ libshared_la_CFLAGS = \ $(SECCOMP_CFLAGS) libshared_la_LIBADD = \ - libsystemd-internal.la \ - libsystemd-journal-internal.la \ + $(topoutdir)/src/libsystemd/libsystemd-internal/libsystemd-internal.la \ + $(topoutdir)/src/libsystemd/libsystemd-journal-internal/libsystemd-journal-internal.la \ libudev-internal.la \ $(ACL_LIBS) \ $(LIBIDN_LIBS) \ $(SECCOMP_LIBS) $(eval $(value automake2autothing)) -at.depdirs += +at.depdirs += $(topoutdir)/src/libsystemd/libsystemd-internal +at.depdirs += $(topoutdir)/src/libsystemd/libsystemd-journal-internal AM_CPPFLAGS += $(libbasic.CPPFLAGS) +AM_CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-journal-internal AM_CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-internal/sd-bus -AM_CPPFLAGS += -I$(topsrcdir)/src/journal AM_CPPFLAGS += -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\" AM_CPPFLAGS += -DSYSTEM_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/system\" diff --git a/src/libsystemd/libsystemd-journal-internal/Makefile b/src/libsystemd/libsystemd-journal-internal/Makefile index 8edcf2873d..b502bc8e40 100644 --- a/src/libsystemd/libsystemd-journal-internal/Makefile +++ b/src/libsystemd/libsystemd-journal-internal/Makefile @@ -23,7 +23,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk include $(topsrcdir)/build-aux/Makefile.head.mk -audit_list_includes = -include linux/audit.h -include $(call at.path,$(topsrcdir)/src/libbasic/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 diff --git a/src/systemd-nspawn/Makefile b/src/systemd-nspawn/Makefile index cca337be90..49de89d302 100644 --- a/src/systemd-nspawn/Makefile +++ b/src/systemd-nspawn/Makefile @@ -58,24 +58,24 @@ systemd_nspawn_CFLAGS = \ $(SECCOMP_CFLAGS) systemd_nspawn_LDADD = \ - libshared.la \ + $(topoutdir)/libshared/libshared.la \ $(BLKID_LIBS) ifneq ($(HAVE_LIBIPTC),) systemd_nspawn_LDADD += \ - libfirewall.la + $(topoutdir)/libfirewall/libfirewall.la endif bin_PROGRAMS += systemd-nspawn $(eval $(value automake2autothing)) - +at.depdirs += $(topoutdir)/src/libshared $(if $(HAVE_LIBIPTC),$(topoutdir)/src/libfirewall) CPPFLAGS += $(libbasic.CPPFLAGS) CPPFLAGS += $(libshared.CPPFLAGS) CPPFLAGS += $(libsystemd.CPPFLAGS) -CPPFLAGS += $(libudev.CPPFLAGS) -CPPFLAGS += -I$(topsrcdir)/src/libsystemd/src/sd-netlink -CPPFLAGS += -I$(topsrcdir)/src/libsystemd/src/sd-bus -CPPFLAGS += -I$(topsrcdir)/src -CPPFLAGS += /udev -I$(topsrcdir)/src/libudev/src +CPPFLAGS += $(libfirewall.CPPFLAGS) +CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-internal/sd-netlink +CPPFLAGS += -I$(topsrcdir)/src/libsystemd/libsystemd-internal/sd-bus +CPPFLAGS += -I$(topsrcdir)/src/udev +CPPFLAGS += -I$(topsrcdir)/src/libudev/src include $(topsrcdir)/build-aux/Makefile.tail.mk -- cgit v1.2.3-54-g00ecf