summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2006-06-20 23:49:23 +0000
committerFelix Fietkau <nbd@openwrt.org>2006-06-20 23:49:23 +0000
commit96930ce1ee4e0743700f57151e997e379134777c (patch)
tree3a29a73608c80dd39fb800ebb5875dac519905a3
parentc1f706433081c5341c3526551f3a485149c44336 (diff)
downloadmtk-20170518-96930ce1ee4e0743700f57151e997e379134777c.zip
mtk-20170518-96930ce1ee4e0743700f57151e997e379134777c.tar.gz
mtk-20170518-96930ce1ee4e0743700f57151e997e379134777c.tar.bz2
add toolchain/download target
SVN-Revision: 4029
-rw-r--r--openwrt/toolchain/Makefile7
-rw-r--r--openwrt/toolchain/sed/Makefile8
-rwxr-xr-xopenwrt/toolchain/sed/sedcheck.sh19
-rw-r--r--openwrt/toolchain/utils/Makefile1
4 files changed, 27 insertions, 8 deletions
diff --git a/openwrt/toolchain/Makefile b/openwrt/toolchain/Makefile
index 8e26db5..fac0468 100644
--- a/openwrt/toolchain/Makefile
+++ b/openwrt/toolchain/Makefile
@@ -1,12 +1,14 @@
# Main makefile for the toolchain
include $(TOPDIR)/rules.mk
-TARGETS-y:=sed utils binutils gcc uClibc ipkg-utils libnotimpl
+TARGETS-y:=sed kernel-headers utils binutils gcc uClibc ipkg-utils libnotimpl
TARGETS-$(CONFIG_GDB) += gdb
+TARGETS_DOWNLOAD:=$(patsubst %,%-source,$(TARGETS-y))
TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS-y))
TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS-y))
all: install
+download: $(TARGETS_DOWNLOAD)
install: $(TARGETS_INSTALL)
clean: $(TARGETS_CLEAN)
@@ -30,6 +32,9 @@ $(STAGING_DIR):
$(TOOL_BUILD_DIR):
@mkdir -p $@
+%-source: FORCE
+ $(MAKE) -C $(patsubst %-source,%,$@) source
+
%-prepare: $(TOOLCHAIN_STAMP_DIR) $(STAGING_DIR) $(TOOL_BUILD_DIR) FORCE
@[ -f $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@ ] || { \
$(MAKE) -C $(patsubst %-prepare,%,$@) prepare; \
diff --git a/openwrt/toolchain/sed/Makefile b/openwrt/toolchain/sed/Makefile
index e14aadd..bbf8502 100644
--- a/openwrt/toolchain/sed/Makefile
+++ b/openwrt/toolchain/sed/Makefile
@@ -13,14 +13,16 @@ SED_DIR1:=$(TOOL_BUILD_DIR)/sed-$(SED_VER)
SED_DIR2:=$(BUILD_DIR)/sed-$(SED_VER)
SED_BINARY:=sed/sed
SED_TARGET_BINARY:=bin/sed
+SED_MD5SUM:=928f0e06422f414091917401f1a834d0
ifeq ($(strip $(BUILD_WITH_LARGEFILE)),true)
SED_CPPFLAGS=-D_FILE_OFFSET_BITS=64
endif
HOST_SED_TARGET=$(shell ./sedcheck.sh)
+DOWNLOAD_TARGET=$(shell ./sedcheck.sh)
$(DL_DIR)/$(SED_SOURCE):
mkdir -p $(DL_DIR)
- $(SCRIPT_DIR)/download.pl $(DL_DIR) $(SED_SOURCE) x $(SED_SITE)
+ $(SCRIPT_DIR)/download.pl $(DL_DIR) $(SED_SOURCE) $(SED_MD5SUM) $(SED_SITE)
#############################################################
#
@@ -65,7 +67,9 @@ use-sed-host-binary: FORCE
rm -f $(STAGING_DIR)/$(SED_TARGET_BINARY); \
ln -s $$SED $(STAGING_DIR)/$(SED_TARGET_BINARY)
-source:
+download-sed-binary: sed-$(SED_VER).tar.gz
+
+source: $(DOWNLOAD_TARGET)
prepare:
compile:
install: $(HOST_SED_TARGET)
diff --git a/openwrt/toolchain/sed/sedcheck.sh b/openwrt/toolchain/sed/sedcheck.sh
index 4d645b6..5af1d88 100755
--- a/openwrt/toolchain/sed/sedcheck.sh
+++ b/openwrt/toolchain/sed/sedcheck.sh
@@ -11,11 +11,20 @@ fi;
echo "HELLO" > .sedtest
$SED -i -e "s/HELLO/GOODBYE/" .sedtest >/dev/null 2>&1
-if [ $? != 0 ] ; then
- echo build-sed-host-binary
-else
- echo use-sed-host-binary
-fi;
+case "$1" in
+ download)
+ if [ $? != 0 ] ; then
+ echo download-sed-binary
+ fi;
+ ;;
+ *)
+ if [ $? != 0 ] ; then
+ echo build-sed-host-binary
+ else
+ echo use-sed-host-binary
+ fi;
+ ;;
+esac
rm -f .sedtest
diff --git a/openwrt/toolchain/utils/Makefile b/openwrt/toolchain/utils/Makefile
index 65e488f..f79ed89 100644
--- a/openwrt/toolchain/utils/Makefile
+++ b/openwrt/toolchain/utils/Makefile
@@ -8,6 +8,7 @@ ifeq ($(OS),Darwin)
CFLAGS += -I./include
endif
+source:
prepare: $(UTILS_BUILD_DIR)
compile: prepare $(patsubst %,$(UTILS_BUILD_DIR)/%,$(TARGETS))
install: compile