summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2015-08-12 12:18:01 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2015-08-12 12:18:01 +0000
commit1d15ebd0d5e47ee00640314c8c357fef97ce1927 (patch)
treee56b43becf11dce3d051435221f1cc8a489de26c
parentd6517b38b23e016069be16d591cf3c6674bbff97 (diff)
downloadexecline-1d15ebd0d5e47ee00640314c8c357fef97ce1927.tar.xz
Better xyzzyfication to abstract it from targets.mak
-rw-r--r--Makefile15
-rw-r--r--package/targets.mak14
2 files changed, 16 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index c7b57a6..29a1875 100644
--- a/Makefile
+++ b/Makefile
@@ -18,9 +18,24 @@ STATIC_LIBS :=
SHARED_LIBS :=
INTERNAL_LIBS :=
EXTRA_TARGETS :=
+LIB_DEFS :=
-include config.mak
+
+define library_definition =
+LIB$(firstword $(subst =, ,$(1))) := lib$(lastword $(subst =, ,$(1))).$(if $(DO_ALLSTATIC),a,so).xyzzy
+ifdef DO_SHARED
+SHARED_LIBS += lib$(lastword $(subst =, ,$(1))).so.xyzzy
+endif
+ifdef DO_STATIC
+STATIC_LIBS += lib$(lastword $(subst =, ,$(1))).a.xyzzy
+endif
+endef
+
include package/targets.mak
+
+$(foreach var,$(LIB_DEFS),$(eval $(call library_definition,$(var))))
+
include package/deps.mak
version_m := $(basename $(version))
diff --git a/package/targets.mak b/package/targets.mak
index e2b36cf..b26ed04 100644
--- a/package/targets.mak
+++ b/package/targets.mak
@@ -47,16 +47,4 @@ wait
SBIN_TARGETS :=
LIBEXEC_TARGETS :=
-ifdef DO_ALLSTATIC
-LIBEXECLINE := libexecline.a.xyzzy
-else
-LIBEXECLINE := libexecline.so.xyzzy
-endif
-
-ifdef DO_SHARED
-SHARED_LIBS := libexecline.so.xyzzy
-endif
-
-ifdef DO_STATIC
-STATIC_LIBS := libexecline.a.xyzzy
-endif
+LIB_DEFS := EXECLINE=execline