summaryrefslogtreecommitdiff
path: root/build-aux
diff options
context:
space:
mode:
Diffstat (limited to 'build-aux')
-rw-r--r--build-aux/Makefile.each.tail/20-systemd.mk4
-rw-r--r--build-aux/Makefile.once.head/20-systemd.mk15
-rw-r--r--build-aux/Makefile.tail.mk2
3 files changed, 15 insertions, 6 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)))