add package/download target

git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4028 3c298f89-4303-0410-b956-a3cf2f4a3e73
master
Felix Fietkau 2006-06-20 23:40:02 +00:00
parent fcd89327c9
commit 01ddf4d523
2 changed files with 18 additions and 8 deletions

View File

@ -3,12 +3,16 @@ include $(TOPDIR)/rules.mk
include $(TOPDIR)/.config include $(TOPDIR)/.config
include $(TOPDIR)/.pkgdeps include $(TOPDIR)/.pkgdeps
SOURCE_PACKAGES:=$(patsubst %,%-source,$(package-y) $(package-m))
COMPILE_PACKAGES:=$(patsubst %,%-compile,$(package-y) $(package-m)) COMPILE_PACKAGES:=$(patsubst %,%-compile,$(package-y) $(package-m))
INSTALL_PACKAGES:=$(patsubst %,%-install,$(package-y)) INSTALL_PACKAGES:=$(patsubst %,%-install,$(package-y))
$(STAMP_DIR) $(TARGET_DIR): $(STAMP_DIR) $(TARGET_DIR):
mkdir -p $@ mkdir -p $@
%-source: $(STAMP_DIR) $(TARGET_DIR)
$(MAKE) -C $(patsubst %-source,%,$@) source MAKEFLAGS="$(BUILD_MAKEFLAGS)"
%-prepare: $(STAMP_DIR) $(TARGET_DIR) %-prepare: $(STAMP_DIR) $(TARGET_DIR)
$(MAKE) -C $(patsubst %-prepare,%,$@) prepare MAKEFLAGS="$(BUILD_MAKEFLAGS)" $(MAKE) -C $(patsubst %-prepare,%,$@) prepare MAKEFLAGS="$(BUILD_MAKEFLAGS)"
@ -29,6 +33,7 @@ $(TOPDIR)/.pkgdeps: $(TOPDIR)/.pkginfo
all: compile all: compile
clean: $(patsubst %,%-clean,$(package-) $(package-y) $(package-m)) clean: $(patsubst %,%-clean,$(package-) $(package-y) $(package-m))
download: $(SOURCE_PACKAGES)
compile-targets: $(COMPILE_PACKAGES) compile-targets: $(COMPILE_PACKAGES)
compile: compile:
$(MAKE) -j$(CONFIG_JLEVEL) compile-targets $(MAKE) -j$(CONFIG_JLEVEL) compile-targets

View File

@ -19,7 +19,8 @@ define Build/DefaultTargets
endif endif
endif endif
$(PKG_BUILD_DIR)/.prepared: $(DL_DIR)/$(PKG_SOURCE)
$(PKG_BUILD_DIR)/.prepared:
@-rm -rf $(PKG_BUILD_DIR) @-rm -rf $(PKG_BUILD_DIR)
@mkdir -p $(PKG_BUILD_DIR) @mkdir -p $(PKG_BUILD_DIR)
$(call Build/Prepare) $(call Build/Prepare)
@ -199,11 +200,6 @@ define BuildPackage
endef 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)),) ifneq ($(strip $(PKG_CAT)),)
define Build/Prepare/Default define Build/Prepare/Default
@if [ "$(PKG_CAT)" = "unzip" ]; then \ @if [ "$(PKG_CAT)" = "unzip" ]; then \
@ -273,11 +269,20 @@ ifneq ($(DUMP),)
dumpinfo: FORCE dumpinfo: FORCE
@$(DUMPINFO) @$(DUMPINFO)
else else
$(PACKAGE_DIR): $(PACKAGE_DIR):
mkdir -p $@ mkdir -p $@
ifneq ($(strip $(PKG_SOURCE)),)
source: $(DL_DIR)/$(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:
prepare: $(PKG_BUILD_DIR)/.prepared prepare: $(PKG_BUILD_DIR)/.prepared
configure: $(PKG_BUILD_DIR)/.configured configure: $(PKG_BUILD_DIR)/.configured