Makefile.autotools.in: fix source handling
authorPeter Korsgaard <jacmet@sunsite.dk>
Wed, 2 Jul 2008 08:58:18 +0000 (08:58 -0000)
committerPeter Korsgaard <jacmet@sunsite.dk>
Wed, 2 Jul 2008 08:58:18 +0000 (08:58 -0000)
Handling source/source-check/external-deps together doesn't work, as
wget will then download the sources every time make source is called
even if it's available in DL_DIR

Instead detect source-check/external-deps from MAKELEVEL.

Support downloadable package patches in source-check/external-deps
while we're at it.

package/Makefile.autotools.in

index ae48654e265f3916f6080d139938ce5f34eb0654..16fc371927aa6d8c95ee1025893ca6ad67ce36aa 100644 (file)
@@ -130,9 +130,10 @@ TAR ?= tar
 
 # Retrieve and unpack the archive
 $(BUILD_DIR)/%/.stamp_downloaded:
-# support make source/source-check/external-deps
-ifneq ($(filter source,$(MAKECMDGOALS)),)
+# support make source-check/external-deps
+ifeq ($(MAKELEVEL),1)
        $(WGET) -P $(DL_DIR) $($(PKG)_SITE)/$($(PKG)_SOURCE)
+       $(if $($(PKG)_PATCH),$(WGET) -P $(DL_DIR) $($(PKG)_SITE)/$($(PKG)_PATCH))
 else
        $(call MESSAGE,"Downloading")
 ifneq ($(strip $(subst ",,$(BR2_PRIMARY_SITE))),)