package: remove useless arguments from CMAKETARGETS
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Thu, 29 Sep 2011 19:57:44 +0000 (21:57 +0200)
committerPeter Korsgaard <jacmet@sunsite.dk>
Thu, 29 Sep 2011 21:14:34 +0000 (23:14 +0200)
Thanks to the pkgparentdir and pkgname functions, we can rewrite the
GENTARGETS macro in a way that avoids the need for each package to
repeat its name and the directory in which it is present.

[Peter: pkgdir->pkgparentdir]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
package/Makefile.cmake.in
package/cdrkit/cdrkit.mk
package/multimedia/libcuefile/libcuefile.mk
package/multimedia/musepack/musepack.mk
package/multimedia/taglib/taglib.mk
package/yajl/yajl.mk

index 1263eb993a51b66094006681c083fa87c55ae451..38e459b80cdae79b4641a80c3ca316e6b705f508 100644 (file)
@@ -183,15 +183,13 @@ endef
 ################################################################################
 # CMAKETARGETS -- the target generator macro for CMake packages
 #
-# Argument 1 is the package directory prefix [mandatory]
-# Argument 2 is the lowercase package name   [mandatory]
-# Argument 3 is "target" or "host"           [optional, default: "target"]
+# Argument 1 is "target" or "host"           [optional, default: "target"]
 ################################################################################
 
 define CMAKETARGETS
-ifeq ($(3),host)
-$(call CMAKETARGETS_INNER,$(3)-$(2),$(call UPPERCASE,$(3)-$(2)),$(call UPPERCASE,$(2)),$(1),host)
+ifeq ($(1),host)
+$(call CMAKETARGETS_INNER,$(1)-$(call pkgname),$(call UPPERCASE,$(1)-$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call pkgparentdir),host)
 else
-$(call CMAKETARGETS_INNER,$(2),$(call UPPERCASE,$(2)),$(call UPPERCASE,$(2)),$(1),target)
+$(call CMAKETARGETS_INNER,$(call pkgname),$(call UPPERCASE,$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call pkgparentdir),target)
 endif
 endef
index a57a8fd1129b189eb50ac5dac3ec0e5a7e9e2351..9eebe6e075f1fcac8e21af080e9fcc49fde7b42f 100644 (file)
@@ -20,5 +20,5 @@ CDRKIT_CONF_OPT += -DCMAKE_EXE_LINKER_FLAGS="$(TARGET_LDFLAGS)"
 HOST_CDRKIT_CONF_OPT += -DCMAKE_C_FLAGS="-I$(HOST_DIR)/usr/include"
 HOST_CDRKIT_CONF_OPT += -DCMAKE_EXE_LINKER_FLAGS="$(HOST_LDFLAGS)"
 
-$(eval $(call CMAKETARGETS,package,cdrkit))
-$(eval $(call CMAKETARGETS,package,cdrkit,host))
+$(eval $(call CMAKETARGETS))
+$(eval $(call CMAKETARGETS,host))
index 765c5a2e3123c4736c290e8bf8e5e4deba0b0e02..7e1c8430ed1a575dc19dec71d4f9c4498b588b96 100644 (file)
@@ -20,4 +20,4 @@ endef
 LIBCUEFILE_POST_INSTALL_STAGING_HOOKS += LIBCUEFILE_INSTALL_STAGING_INCLUDES
 LIBCUEFILE_POST_INSTALL_TARGET_HOOKS += LIBCUEFILE_INSTALL_TARGET_INCLUDES
 
-$(eval $(call CMAKETARGETS,package/multimedia,libcuefile))
+$(eval $(call CMAKETARGETS))
index 1e5ebcfe841176529a33c722ba8f3b8601f80825..ac3660f6f4964a0029d1cb5bbe7d5f4fde5f718b 100644 (file)
@@ -11,4 +11,4 @@ MUSEPACK_DEPENDENCIES = libcuefile libreplaygain
 MUSEPACK_INSTALL_STAGING = YES
 MUSEPACK_MAKE = $(MAKE1)
 
-$(eval $(call CMAKETARGETS,package/multimedia,musepack))
+$(eval $(call CMAKETARGETS))
index b48e3d242393f2fc546025f4368d14303fb35f90..ce6adeb90faaf6a47c4cade528266039aba485b8 100644 (file)
@@ -24,4 +24,4 @@ ifneq ($(BR2_HAVE_DEVFILES),y)
 TAGLIB_POST_INSTALL_TARGET_HOOKS += TAGLIB_REMOVE_DEVFILE
 endif
 
-$(eval $(call CMAKETARGETS,package/multimedia,taglib))
+$(eval $(call CMAKETARGETS))
index e67a7dadfe9d6926e44a617b485199a2bba5d1ab..723cce4a9883ed50ba8a2ef47a09b169d19d9fe3 100644 (file)
@@ -8,4 +8,4 @@ YAJL_VERSION = 2.0.2
 YAJL_SITE = git://github.com/lloyd/yajl.git
 YAJL_INSTALL_STAGING = YES
 
-$(eval $(call CMAKETARGETS,package,yajl))
+$(eval $(call CMAKETARGETS))