summaryrefslogtreecommitdiff
path: root/build-aux/Makefile.once.head/10-lt.mk
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-08-07 21:03:44 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-08-07 21:03:44 -0400
commit8a5ecbb4fcaf0d9864074666a45d9263b73f31b8 (patch)
tree49e95e6d4d1c2745c16778ebd5016e32ec2419e5 /build-aux/Makefile.once.head/10-lt.mk
parenta13198f6ea2547d69159be7a2f2a1b1c0119c6f9 (diff)
(systemd) stuff
Diffstat (limited to 'build-aux/Makefile.once.head/10-lt.mk')
-rw-r--r--build-aux/Makefile.once.head/10-lt.mk12
1 files changed, 12 insertions, 0 deletions
diff --git a/build-aux/Makefile.once.head/10-lt.mk b/build-aux/Makefile.once.head/10-lt.mk
new file mode 100644
index 0000000..c8410d4
--- /dev/null
+++ b/build-aux/Makefile.once.head/10-lt.mk
@@ -0,0 +1,12 @@
+mod.lt.description = Easy handling of libtool dependencies
+mod.lt.deps += files
+
+_lt.dups = $(sort $(foreach l,$1,$(if $(filter-out 1,$(words $(filter $l,$1))),$l)))
+_lt.patsubst-all = $(if $1,$(call _sd.patsubst-all,$(wordlist 2,$(words $1),$1),$2,$(patsubst $(firstword $1),$2,$3)),$3)
+_lt.unLIBPATTERNS = $(foreach _lt.tmp,$1,$(if $(filter $(.LIBPATTERNS),$(_lt.tmp)),$(call _lt.patsubst-all,$(.LIBPATTERNS),-l%,$(_lt.tmp)),$(_lt.tmp)))
+
+# The semantics for the de-dup bit are a bit weird. My head hurts thinking
+# about them. TODO: clarify/simplify/something
+lt.rpath = $(dir $(patsubst $(DESTDIR)%,%,$(filter %/$(@F),$(files.sys))))
+_lt.link_files = $(filter %.o %.lo %.la -l%,$(call _lt.unLIBPATTERNS$,$^))
+lt.link_files = $(filter-out $(call _lt.dups,$(_lt.link_files)),$(_lt.link_files))