From 6726400e1ebc7fedb147e41c2f12410fe848aeb1 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 27 Jul 2016 13:02:24 -0400 Subject: fixity (and work around bug in GNU Make) The complexity around the install rules is to work around --- build-aux/Makefile.each.tail/20-systemd.mk | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'build-aux/Makefile.each.tail') diff --git a/build-aux/Makefile.each.tail/20-systemd.mk b/build-aux/Makefile.each.tail/20-systemd.mk index 8b84b52b63..dc322e642a 100644 --- a/build-aux/Makefile.each.tail/20-systemd.mk +++ b/build-aux/Makefile.each.tail/20-systemd.mk @@ -21,7 +21,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with systemd; If not, see . --include $(outdir)/$(DEPDIR)/*.P* +-include $(wildcard $(outdir)/$(DEPDIR)/*.P*) std.clean_files += *.o *.lo *.so .deps/ .libs/ std.clean_files += *-list.txt @@ -52,21 +52,19 @@ $(addprefix $(outdir)/,$(foreach d,$(am.bindirs),$($d_PROGRAMS))): $(outdir)/%: @if test $(words $^) = 0; then echo 'Cannot link executable with no dependencies: $@' >&2; exit 1; fi $(AM_V_CCLD)$(LINK) $(_systemd.link_files) -$(DESTDIR)$(bindir)/%: $(outdir)/% - $(LIBTOOL) $(ALL_LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $< $@ -$(DESTDIR)$(rootbindir)/%: $(outdir)/% - $(LIBTOOL) $(ALL_LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $< $@ -$(DESTDIR)$(libexecdir)/%: $(outdir)/% - $(LIBTOOL) $(ALL_LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $< $@ -$(DESTDIR)$(rootlibexecdir)/%: $(outdir)/% - $(LIBTOOL) $(ALL_LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $< $@ -$(DESTDIR)$(systemgeneratordir)/%: $(outdir)/% - $(LIBTOOL) $(ALL_LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $< $@ -$(DESTDIR)$(udevlibexecdir)/%: $(outdir)/% +_systemd.in_destdir = $(foreach f,$(std.sys_files),$(if $(filter $1,$(patsubst %/,%,$(dir $f))),$(DESTDIR)$f)) + +define install_bindir +$(call _systemd.in_destdir,$(bindir)): $(DESTDIR)$(bindir)/%: $(outdir)/% $(LIBTOOL) $(ALL_LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $< $@ +endef +$(foreach bindir,$(sort $(foreach d,$(am.bindirs),$($ddir))),$(eval $(value install_bindir))) -$(DESTDIR)$(libdir)/%.la: $(outdir)/%.la +define install_libdir +$(call _systemd.in_destdir,$(libdir)): $(DESTDIR)$(libdir)/%.la: $(outdir)/%.la $(LIBTOOL) $(ALL_LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $< $@ +endef +$(foreach libdir,$(sort $(foreach d,lib rootlib,$($ddir))),$(eval $(value install_libdir))) $(outdir)/%-from-name.gperf: $(outdir)/%-list.txt $(AM_V_at)$(MKDIR_P) $(dir $@) -- cgit v1.2.3-54-g00ecf