From 1d15ebd0d5e47ee00640314c8c357fef97ce1927 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Wed, 12 Aug 2015 12:18:01 +0000 Subject: Better xyzzyfication to abstract it from targets.mak --- Makefile | 15 +++++++++++++++ package/targets.mak | 14 +------------- 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 -- cgit v1.2.3