add package/download target
authorFelix Fietkau <nbd@openwrt.org>
Tue, 20 Jun 2006 23:40:02 +0000 (23:40 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 20 Jun 2006 23:40:02 +0000 (23:40 +0000)
SVN-Revision: 4028

openwrt/package/Makefile
openwrt/package/rules.mk

index 7548e069a7162d065494f1ccf697b89aa56d4736..2b7f0db7647de638b9f944d9b7d6a13430125b32 100644 (file)
@@ -3,12 +3,16 @@ include $(TOPDIR)/rules.mk
 include $(TOPDIR)/.config
 include $(TOPDIR)/.pkgdeps
 
+SOURCE_PACKAGES:=$(patsubst %,%-source,$(package-y) $(package-m))
 COMPILE_PACKAGES:=$(patsubst %,%-compile,$(package-y) $(package-m))
 INSTALL_PACKAGES:=$(patsubst %,%-install,$(package-y))
 
 $(STAMP_DIR) $(TARGET_DIR):
        mkdir -p $@
 
+%-source: $(STAMP_DIR) $(TARGET_DIR)
+       $(MAKE) -C $(patsubst %-source,%,$@) source MAKEFLAGS="$(BUILD_MAKEFLAGS)"
+
 %-prepare: $(STAMP_DIR) $(TARGET_DIR)
        $(MAKE) -C $(patsubst %-prepare,%,$@) prepare MAKEFLAGS="$(BUILD_MAKEFLAGS)"
 
@@ -29,6 +33,7 @@ $(TOPDIR)/.pkgdeps: $(TOPDIR)/.pkginfo
 
 all: compile
 clean: $(patsubst %,%-clean,$(package-) $(package-y) $(package-m))
+download: $(SOURCE_PACKAGES)
 compile-targets: $(COMPILE_PACKAGES)
 compile:
        $(MAKE) -j$(CONFIG_JLEVEL) compile-targets
index 40e07f839fe2a72a821c60f1ced2b4a43ff96784..82298b02498677b08c81a001b24f01f414e8d803 100644 (file)
@@ -19,7 +19,8 @@ define Build/DefaultTargets
     endif
   endif
 
-  $(PKG_BUILD_DIR)/.prepared: $(DL_DIR)/$(PKG_SOURCE)
+
+  $(PKG_BUILD_DIR)/.prepared:
        @-rm -rf $(PKG_BUILD_DIR)
        @mkdir -p $(PKG_BUILD_DIR)
        $(call Build/Prepare)
@@ -199,11 +200,6 @@ define BuildPackage
 
 endef
 
-ifneq ($(strip $(PKG_SOURCE)),)
-  $(DL_DIR)/$(PKG_SOURCE):
-       $(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(PKG_SOURCE)" "$(PKG_MD5SUM)" $(PKG_SOURCE_URL)
-endif
-
 ifneq ($(strip $(PKG_CAT)),)
   define Build/Prepare/Default
        @if [ "$(PKG_CAT)" = "unzip" ]; then \
@@ -273,11 +269,20 @@ ifneq ($(DUMP),)
   dumpinfo: FORCE
        @$(DUMPINFO)
 else
-               
   $(PACKAGE_DIR):
        mkdir -p $@
+               
+  ifneq ($(strip $(PKG_SOURCE)),)
+    source: $(DL_DIR)/$(PKG_SOURCE)
+
+    $(DL_DIR)/$(PKG_SOURCE):
+               mkdir -p $(DL_DIR)
+               $(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(PKG_SOURCE)" "$(PKG_MD5SUM)" $(PKG_SOURCE_URL)
+
+    $(PKG_BUILD_DIR)/.prepared: $(DL_DIR)/$(PKG_SOURCE)
+  endif
 
-  source: $(DL_DIR)/$(PKG_SOURCE)
+  source:
   prepare: $(PKG_BUILD_DIR)/.prepared
   configure: $(PKG_BUILD_DIR)/.configured