pkg-*targets.mk: factorize and fix $(PKG)_SRCDIR and $(PKG)_BUILDDIR declaration
authorSamuel Martin <s.martin49@gmail.com>
Sun, 22 Jul 2012 13:28:34 +0000 (15:28 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 22 Jul 2012 17:28:42 +0000 (19:28 +0200)
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/pkg-autotools.mk
package/pkg-cmake.mk
package/pkg-generic.mk

index e4540509d90a01b44b3b328b9d58a1620c9c729d..785daab0e121e102951034c7194929d30bb3e48b 100644 (file)
@@ -54,15 +54,6 @@ endef
 
 define inner-autotools-package
 
-# define package-specific variables to default values
-ifndef $(2)_SUBDIR
- ifdef $(3)_SUBDIR
-  $(2)_SUBDIR = $($(3)_SUBDIR)
- else
-  $(2)_SUBDIR ?=
- endif
-endif
-
 ifndef $(2)_LIBTOOL_PATCH
  ifdef $(3)_LIBTOOL_PATCH
   $(2)_LIBTOOL_PATCH = $($(3)_LIBTOOL_PATCH)
@@ -91,7 +82,6 @@ $(2)_CLEAN_OPT                        ?= clean
 $(2)_UNINSTALL_STAGING_OPT     ?= DESTDIR=$$(STAGING_DIR) uninstall
 $(2)_UNINSTALL_TARGET_OPT      ?= DESTDIR=$$(TARGET_DIR)  uninstall
 
-$(2)_SRCDIR                     = $$($(2)_DIR)/$$($(2)_SUBDIR)
 
 #
 # Configure step. Only define it if not already defined by the package
index f9a59341ada82fa2f4617119db6eac5f77e4c98d..626a0b00c27c2c5c31e58d2f387597a5293fca6a 100644 (file)
 
 define inner-cmake-package
 
-# define package-specific variables to default values
-ifndef $(2)_SUBDIR
- ifdef $(3)_SUBDIR
-  $(2)_SUBDIR = $($(3)_SUBDIR)
- else
-  $(2)_SUBDIR ?=
- endif
-endif
-
 $(2)_CONF_ENV                  ?=
 $(2)_CONF_OPT                  ?=
 $(2)_MAKE                      ?= $(MAKE)
index c01440e64c48d98564bc28b435e9b0b85a622d4a..8a730c0a0101f206096b95353742ab7b7a61e477 100644 (file)
@@ -204,6 +204,17 @@ $(2)_BASE_NAME     =  $(1)-$$($(2)_VERSION)
 $(2)_DL_DIR    =  $$(DL_DIR)/$$($(2)_BASE_NAME)
 $(2)_DIR       =  $$(BUILD_DIR)/$$($(2)_BASE_NAME)
 
+ifndef $(3)_SUBDIR
+ ifdef $(2)_SUBDIR
+  $(3)_SUBDIR = $$($(2)_SUBDIR)
+ else
+  $(3)_SUBDIR ?=
+ endif
+endif
+
+$(2)_SRCDIR                   = $$($(2)_DIR)/$$($(2)_SUBDIR)
+$(2)_BUILDDIR                 ?= $$($(2)_SRCDIR)
+
 ifneq ($$($(2)_OVERRIDE_SRCDIR),)
 $(2)_VERSION = custom
 endif