Commit 9e4aeb3c authored by Thomas Petazzoni's avatar Thomas Petazzoni Committed by Peter Korsgaard
Browse files

package: remove useless arguments from CMAKETARGETS



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: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: default avatarPeter Korsgaard <jacmet@sunsite.dk>
parent 300f9c9c
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -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
+2 −2
Original line number Diff line number Diff line
@@ -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))
+1 −1
Original line number Diff line number Diff line
@@ -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))
+1 −1
Original line number Diff line number Diff line
@@ -11,4 +11,4 @@ MUSEPACK_DEPENDENCIES = libcuefile libreplaygain
MUSEPACK_INSTALL_STAGING = YES
MUSEPACK_MAKE = $(MAKE1)

$(eval $(call CMAKETARGETS,package/multimedia,musepack))
$(eval $(call CMAKETARGETS))
+1 −1
Original line number Diff line number Diff line
@@ -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))
Loading