From 44af1866aa41cfbbad48583106cb82201ded4fcb Mon Sep 17 00:00:00 2001 From: nbd Date: Wed, 27 Sep 2006 14:06:46 +0000 Subject: [PATCH] move tools from toolchain/ to tools/ git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4866 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- Makefile | 7 ++- rules.mk | 5 +- toolchain/Makefile | 16 +++-- toolchain/binutils/Makefile | 2 +- toolchain/gcc/Makefile | 8 +-- toolchain/gdb/Makefile | 2 +- toolchain/kernel-headers/Makefile | 6 +- toolchain/libnotimpl/Makefile | 2 +- toolchain/uClibc/Makefile | 14 ++--- tools/Makefile | 61 +++++++++++++++++++ {toolchain => tools}/ext2fs/Makefile | 0 {toolchain => tools}/ipkg-utils/Makefile | 0 .../ipkg-utils/patches/100-build_clean.patch | 0 .../ipkg-utils/patches/110-buildpackage.patch | 0 .../ipkg-utils/patches/120-build_tar.patch | 0 .../patches/130-tar_wildcards.patch | 0 {toolchain => tools}/lzma/Makefile | 0 .../lzma/patches/100-lzma_zlib.patch | 0 {toolchain => tools}/mkimage/Makefile | 0 {toolchain => tools}/mkimage/src/crc32.c | 0 {toolchain => tools}/mkimage/src/image.h | 0 {toolchain => tools}/mkimage/src/mkimage.c | 0 {toolchain/jffs2 => tools/mtd-utils}/Makefile | 0 .../mtd-utils}/patches/100-gcc4_fix.patch | 0 {toolchain => tools}/sed/Makefile | 0 {toolchain => tools}/sed/sedcheck.sh | 0 {toolchain => tools}/squashfs/Makefile | 0 .../squashfs/patches/100-lzma.patch | 0 {toolchain => tools}/sstrip/Makefile | 0 {toolchain => tools}/sstrip/include/elf.h | 0 {toolchain => tools}/sstrip/src/sstrip.c | 0 31 files changed, 94 insertions(+), 29 deletions(-) create mode 100644 tools/Makefile rename {toolchain => tools}/ext2fs/Makefile (100%) rename {toolchain => tools}/ipkg-utils/Makefile (100%) rename {toolchain => tools}/ipkg-utils/patches/100-build_clean.patch (100%) rename {toolchain => tools}/ipkg-utils/patches/110-buildpackage.patch (100%) rename {toolchain => tools}/ipkg-utils/patches/120-build_tar.patch (100%) rename {toolchain => tools}/ipkg-utils/patches/130-tar_wildcards.patch (100%) rename {toolchain => tools}/lzma/Makefile (100%) rename {toolchain => tools}/lzma/patches/100-lzma_zlib.patch (100%) rename {toolchain => tools}/mkimage/Makefile (100%) rename {toolchain => tools}/mkimage/src/crc32.c (100%) rename {toolchain => tools}/mkimage/src/image.h (100%) rename {toolchain => tools}/mkimage/src/mkimage.c (100%) rename {toolchain/jffs2 => tools/mtd-utils}/Makefile (100%) rename {toolchain/jffs2 => tools/mtd-utils}/patches/100-gcc4_fix.patch (100%) rename {toolchain => tools}/sed/Makefile (100%) rename {toolchain => tools}/sed/sedcheck.sh (100%) rename {toolchain => tools}/squashfs/Makefile (100%) rename {toolchain => tools}/squashfs/patches/100-lzma.patch (100%) rename {toolchain => tools}/sstrip/Makefile (100%) rename {toolchain => tools}/sstrip/include/elf.h (100%) rename {toolchain => tools}/sstrip/src/sstrip.c (100%) diff --git a/Makefile b/Makefile index 88d4ae517..c2538c204 100644 --- a/Makefile +++ b/Makefile @@ -85,6 +85,9 @@ package/%: .pkginfo FORCE target/%: .pkginfo FORCE $(MAKE) -C target $(patsubst target/%,%,$@) +tools/%: FORCE + $(MAKE) -C tools $(patsubst tools/%,%,$@) + toolchain/%: FORCE $(MAKE) -C toolchain $(patsubst toolchain/%,%,$@) @@ -108,11 +111,13 @@ toolchain/%: FORCE prereq: .prereq-build .prereq-packages FORCE download: .config FORCE + $(MAKE) tools/download $(MAKE) toolchain/download $(MAKE) package/download $(MAKE) target/download world: .config FORCE + $(MAKE) tools/install $(MAKE) toolchain/install $(MAKE) target/compile $(MAKE) package/compile @@ -124,7 +129,7 @@ clean: FORCE rm -rf build_* bin dirclean: clean - rm -rf staging_dir_* toolchain_build_* + rm -rf staging_dir_* toolchain_build_* tool_build distclean: dirclean config-clean rm -rf dl .*config* .pkg* .prereq diff --git a/rules.mk b/rules.mk index 768b48055..f0d21a279 100644 --- a/rules.mk +++ b/rules.mk @@ -22,7 +22,8 @@ OPTIMIZE_FOR_CPU:=$(ARCH) DL_DIR:=$(TOPDIR)/dl INCLUDE_DIR:=$(TOPDIR)/include SCRIPT_DIR:=$(TOPDIR)/scripts -TOOL_BUILD_DIR:=$(TOPDIR)/toolchain_build_$(ARCH) +TOOL_BUILD_DIR:=$(TOPDIR)/tool_build +TOOLCHAIN_BUILD_DIR:=$(TOPDIR)/toolchain_build_$(ARCH) STAGING_DIR:=$(TOPDIR)/staging_dir_$(ARCH) BIN_DIR:=$(TOPDIR)/bin PACKAGE_DIR:=$(BIN_DIR)/packages @@ -47,7 +48,7 @@ TARGET_CFLAGS:=$(TARGET_OPTIMIZATION) export PATH:=$(TARGET_PATH) LINUX_DIR:=$(BUILD_DIR)/linux -LINUX_HEADERS_DIR:=$(TOOL_BUILD_DIR)/linux +LINUX_HEADERS_DIR:=$(TOOLCHAIN_BUILD_DIR)/linux # APPLICATIONS # HOSTCC:=gcc diff --git a/toolchain/Makefile b/toolchain/Makefile index 0b8b62860..d324325a6 100644 --- a/toolchain/Makefile +++ b/toolchain/Makefile @@ -7,13 +7,12 @@ # Main makefile for the toolchain # include $(TOPDIR)/rules.mk -TARGETS-y:=sed kernel-headers sstrip + +TARGETS-y:=kernel-headers libnotimpl +TARGETS-$(CONFIG_GDB) += gdb ifeq ($(CONFIG_NATIVE_TOOLCHAIN),) TARGETS-y+=binutils gcc uClibc endif -TARGETS-y+=ipkg-utils libnotimpl ext2fs squashfs jffs2 lzma mkimage - -TARGETS-$(CONFIG_GDB) += gdb TARGETS_DOWNLOAD:=$(patsubst %,%-download,$(TARGETS-y)) TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS-y)) @@ -24,15 +23,14 @@ download: $(TARGETS_DOWNLOAD) install: $(TARGETS_INSTALL) clean: $(TARGETS_CLEAN) -kernel-headers-prepare: sed-install -uClibc-prepare: kernel-headers-prepare sstrip-install +uClibc-prepare: kernel-headers-prepare ifeq ($(CONFIG_NATIVE_TOOLCHAIN),) binutils-prepare: uClibc-prepare gcc-prepare: binutils-install uClibc-compile: gcc-compile + libnotimpl-compile: gcc-install endif gcc-install: uClibc-install -squashfs-compile: lzma-install TOOLCHAIN_STAMP_DIR:=$(STAGING_DIR)/stampfiles @@ -45,13 +43,13 @@ $(STAGING_DIR): @mkdir -p $@/$(REAL_GNU_TARGET_NAME) @ln -sf ../lib $@/$(REAL_GNU_TARGET_NAME)/lib -$(TOOL_BUILD_DIR): +$(TOOLCHAIN_BUILD_DIR): @mkdir -p $@ %-download: FORCE $(MAKE) -C $(patsubst %-download,%,$@) download -%-prepare: $(TOOLCHAIN_STAMP_DIR) $(STAGING_DIR) $(TOOL_BUILD_DIR) FORCE +%-prepare: $(TOOLCHAIN_STAMP_DIR) $(STAGING_DIR) $(TOOLCHAIN_BUILD_DIR) FORCE @[ -f $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@ ] || { \ $(MAKE) -C $(patsubst %-prepare,%,$@) prepare; \ } diff --git a/toolchain/binutils/Makefile b/toolchain/binutils/Makefile index 4d7a22a03..e36758fe4 100644 --- a/toolchain/binutils/Makefile +++ b/toolchain/binutils/Makefile @@ -18,7 +18,7 @@ PKG_SOURCE_URL:=http://ftp.gnu.org/gnu/binutils/ \ PKG_SOURCE:=binutils-$(PKG_VERSION).tar.bz2 PKG_MD5SUM:=unknown -PKG_BUILD_DIR:=$(TOOL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_BUILD_DIR:=$(TOOLCHAIN_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) PKG_CAT:=bzcat include $(INCLUDE_DIR)/host-build.mk diff --git a/toolchain/gcc/Makefile b/toolchain/gcc/Makefile index 77f7645aa..8a2337593 100644 --- a/toolchain/gcc/Makefile +++ b/toolchain/gcc/Makefile @@ -30,7 +30,7 @@ PKG_SOURCE_URL:=ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-$(PKG_VER ftp://ftp.gnu.org/gnu/gcc/releases/gcc-$(PKG_VERSION) PKG_CAT:=bzcat -PKG_BUILD_DIR:=$(TOOL_BUILD_DIR)/gcc-$(PKG_VERSION) +PKG_BUILD_DIR:=$(TOOLCHAIN_BUILD_DIR)/gcc-$(PKG_VERSION) TARGET_LANGUAGES:=c ifeq ($(CONFIG_INSTALL_LIBSTDCPP),y) @@ -42,8 +42,8 @@ endif include $(INCLUDE_DIR)/host-build.mk -BUILD_DIR1:=$(TOOL_BUILD_DIR)/gcc-$(PKG_VERSION)-initial -BUILD_DIR2:=$(TOOL_BUILD_DIR)/gcc-$(PKG_VERSION)-final +BUILD_DIR1:=$(TOOLCHAIN_BUILD_DIR)/gcc-$(PKG_VERSION)-initial +BUILD_DIR2:=$(TOOLCHAIN_BUILD_DIR)/gcc-$(PKG_VERSION)-final define Stage1/Configure @@ -56,7 +56,7 @@ define Stage1/Configure --target=$(REAL_GNU_TARGET_NAME) \ --enable-languages=c \ --disable-shared \ - --with-sysroot=$(TOOL_BUILD_DIR)/uClibc_dev/ \ + --with-sysroot=$(TOOLCHAIN_BUILD_DIR)/uClibc_dev/ \ --disable-__cxa_atexit \ --enable-target-optspace \ --with-gnu-ld \ diff --git a/toolchain/gdb/Makefile b/toolchain/gdb/Makefile index f5c0bf372..63661ca2d 100644 --- a/toolchain/gdb/Makefile +++ b/toolchain/gdb/Makefile @@ -14,7 +14,7 @@ PKG_MD5SUM:=05b928f41fa5b482e49ca2c24762a0ae PKG_SOURCE_URL:=http://ftp.gnu.org/gnu/gdb PKG_CAT:=bzcat -PKG_BUILD_DIR:=$(TOOL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_BUILD_DIR:=$(TOOLCHAIN_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) include $(INCLUDE_DIR)/host-build.mk diff --git a/toolchain/kernel-headers/Makefile b/toolchain/kernel-headers/Makefile index 42791f1e1..7b5c06c78 100644 --- a/toolchain/kernel-headers/Makefile +++ b/toolchain/kernel-headers/Makefile @@ -17,7 +17,7 @@ PKG_SOURCE_URL= \ http://www.kernel.org/pub/linux/kernel/v2.4 PKG_MD5SUM:=38f4d0830e95a20f4bfed17622d5557c -PKG_BUILD_DIR:=$(TOOL_BUILD_DIR)/linux-$(PKG_VERSION) +PKG_BUILD_DIR:=$(TOOLCHAIN_BUILD_DIR)/linux-$(PKG_VERSION) include $(INCLUDE_DIR)/host-build.mk @@ -30,8 +30,8 @@ LINUX_KARCH:=$(shell echo $(ARCH) | sed -e 's/i[3-9]86/i386/' \ ) define Build/Prepare - mkdir -p $(TOOL_BUILD_DIR) - bzcat $(DL_DIR)/$(PKG_SOURCE) | tar --wildcards -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) - \ + mkdir -p $(TOOLCHAIN_BUILD_DIR) + bzcat $(DL_DIR)/$(PKG_SOURCE) | tar --wildcards -C $(TOOLCHAIN_BUILD_DIR) $(TAR_OPTIONS) - \ linux-$(PKG_VERSION)/include \ linux-$(PKG_VERSION)/Makefile \ linux-$(PKG_VERSION)/Rules.make \ diff --git a/toolchain/libnotimpl/Makefile b/toolchain/libnotimpl/Makefile index d55bf4e3f..85156723b 100644 --- a/toolchain/libnotimpl/Makefile +++ b/toolchain/libnotimpl/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libnotimpl -PKG_BUILD_DIR:=$(TOOL_BUILD_DIR)/libnotimpl +PKG_BUILD_DIR:=$(TOOLCHAIN_BUILD_DIR)/libnotimpl include $(INCLUDE_DIR)/host-build.mk diff --git a/toolchain/uClibc/Makefile b/toolchain/uClibc/Makefile index a99c734b9..732911215 100644 --- a/toolchain/uClibc/Makefile +++ b/toolchain/uClibc/Makefile @@ -15,7 +15,7 @@ PKG_SOURCE_URL:=http://www.uclibc.org/downloads PKG_MD5SUM:=1ada58d919a82561061e4741fb6abd29 PKG_CAT:=bzcat -PKG_BUILD_DIR:=$(TOOL_BUILD_DIR)/uClibc-$(PKG_VERSION) +PKG_BUILD_DIR:=$(TOOLCHAIN_BUILD_DIR)/uClibc-$(PKG_VERSION) include $(INCLUDE_DIR)/host-build.mk @@ -52,13 +52,13 @@ endif ifeq ($(CONFIG_SOFT_FLOAT),y) $(SED) 's,.*HAS_FPU.*,HAS_FPU=n\nUCLIBC_HAS_FLOATS=y\nUCLIBC_HAS_SOFT_FLOAT=y,g' $(PKG_BUILD_DIR)/.config endif - mkdir -p $(TOOL_BUILD_DIR)/uClibc_dev/usr/include - mkdir -p $(TOOL_BUILD_DIR)/uClibc_dev/usr/lib - mkdir -p $(TOOL_BUILD_DIR)/uClibc_dev/lib + mkdir -p $(TOOLCHAIN_BUILD_DIR)/uClibc_dev/usr/include + mkdir -p $(TOOLCHAIN_BUILD_DIR)/uClibc_dev/usr/lib + mkdir -p $(TOOLCHAIN_BUILD_DIR)/uClibc_dev/lib PATH=$(TARGET_PATH) $(MAKE) -C $(PKG_BUILD_DIR) \ - PREFIX=$(TOOL_BUILD_DIR)/uClibc_dev/ \ + PREFIX=$(TOOLCHAIN_BUILD_DIR)/uClibc_dev/ \ DEVEL_PREFIX=/usr/ \ - RUNTIME_PREFIX=$(TOOL_BUILD_DIR)/uClibc_dev/ \ + RUNTIME_PREFIX=$(TOOLCHAIN_BUILD_DIR)/uClibc_dev/ \ HOSTCC="$(HOSTCC)" \ CPU_CFLAGS="$(TARGET_CFLAGS)" \ pregen install_dev; @@ -92,7 +92,7 @@ define Build/Install endef define Build/Clean - rm -rf $(PKG_BUILD_DIR) $(TOOL_BUILD_DIR)/uClibc_dev + rm -rf $(PKG_BUILD_DIR) $(TOOLCHAIN_BUILD_DIR)/uClibc_dev endef $(eval $(call HostBuild)) diff --git a/tools/Makefile b/tools/Makefile new file mode 100644 index 000000000..21d6a94f9 --- /dev/null +++ b/tools/Makefile @@ -0,0 +1,61 @@ +# +# Copyright (C) 2006 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# Main makefile for the host tools +# +include $(TOPDIR)/rules.mk +TARGETS-y:=sed sstrip ipkg-utils ext2fs squashfs mtd-utils lzma mkimage + +TARGETS_DOWNLOAD:=$(patsubst %,%-download,$(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) + +squashfs-compile: lzma-install + +TOOL_STAMP_DIR:=$(STAGING_DIR)/stampfiles + +$(TOOL_STAMP_DIR): + mkdir -p $@ + +$(STAGING_DIR): + @mkdir -p $@/lib + @mkdir -p $@/include + @mkdir -p $@/$(REAL_GNU_TARGET_NAME) + @ln -sf ../lib $@/$(REAL_GNU_TARGET_NAME)/lib + +$(TOOL_BUILD_DIR): + @mkdir -p $@ + +%-download: FORCE + $(MAKE) -C $(patsubst %-download,%,$@) download + +%-prepare: $(TOOL_STAMP_DIR) $(STAGING_DIR) $(TOOL_BUILD_DIR) FORCE + @[ -f $(TOOL_STAMP_DIR)/.tool_$@ ] || { \ + $(MAKE) -C $(patsubst %-prepare,%,$@) prepare; \ + } + @touch $(TOOL_STAMP_DIR)/.tool_$@ + +%-compile: %-prepare + @[ -f $(TOOL_STAMP_DIR)/.tool_$@ ] || { \ + $(MAKE) -C $(patsubst %-compile,%,$@) compile; \ + } + @touch $(TOOL_STAMP_DIR)/.tool_$@ + +%-install: %-compile + @[ -f $(TOOL_STAMP_DIR)/.tool_$@ ] || { \ + $(MAKE) -C $(patsubst %-install,%,$@) install; \ + } + @touch $(TOOL_STAMP_DIR)/.tool_$@ + +%-clean: FORCE + @$(MAKE) -C $(patsubst %-clean,%,$@) clean + @rm -f $(TOOL_STAMP_DIR)/.tool_$(patsubst %-clean,%,$@)-* + diff --git a/toolchain/ext2fs/Makefile b/tools/ext2fs/Makefile similarity index 100% rename from toolchain/ext2fs/Makefile rename to tools/ext2fs/Makefile diff --git a/toolchain/ipkg-utils/Makefile b/tools/ipkg-utils/Makefile similarity index 100% rename from toolchain/ipkg-utils/Makefile rename to tools/ipkg-utils/Makefile diff --git a/toolchain/ipkg-utils/patches/100-build_clean.patch b/tools/ipkg-utils/patches/100-build_clean.patch similarity index 100% rename from toolchain/ipkg-utils/patches/100-build_clean.patch rename to tools/ipkg-utils/patches/100-build_clean.patch diff --git a/toolchain/ipkg-utils/patches/110-buildpackage.patch b/tools/ipkg-utils/patches/110-buildpackage.patch similarity index 100% rename from toolchain/ipkg-utils/patches/110-buildpackage.patch rename to tools/ipkg-utils/patches/110-buildpackage.patch diff --git a/toolchain/ipkg-utils/patches/120-build_tar.patch b/tools/ipkg-utils/patches/120-build_tar.patch similarity index 100% rename from toolchain/ipkg-utils/patches/120-build_tar.patch rename to tools/ipkg-utils/patches/120-build_tar.patch diff --git a/toolchain/ipkg-utils/patches/130-tar_wildcards.patch b/tools/ipkg-utils/patches/130-tar_wildcards.patch similarity index 100% rename from toolchain/ipkg-utils/patches/130-tar_wildcards.patch rename to tools/ipkg-utils/patches/130-tar_wildcards.patch diff --git a/toolchain/lzma/Makefile b/tools/lzma/Makefile similarity index 100% rename from toolchain/lzma/Makefile rename to tools/lzma/Makefile diff --git a/toolchain/lzma/patches/100-lzma_zlib.patch b/tools/lzma/patches/100-lzma_zlib.patch similarity index 100% rename from toolchain/lzma/patches/100-lzma_zlib.patch rename to tools/lzma/patches/100-lzma_zlib.patch diff --git a/toolchain/mkimage/Makefile b/tools/mkimage/Makefile similarity index 100% rename from toolchain/mkimage/Makefile rename to tools/mkimage/Makefile diff --git a/toolchain/mkimage/src/crc32.c b/tools/mkimage/src/crc32.c similarity index 100% rename from toolchain/mkimage/src/crc32.c rename to tools/mkimage/src/crc32.c diff --git a/toolchain/mkimage/src/image.h b/tools/mkimage/src/image.h similarity index 100% rename from toolchain/mkimage/src/image.h rename to tools/mkimage/src/image.h diff --git a/toolchain/mkimage/src/mkimage.c b/tools/mkimage/src/mkimage.c similarity index 100% rename from toolchain/mkimage/src/mkimage.c rename to tools/mkimage/src/mkimage.c diff --git a/toolchain/jffs2/Makefile b/tools/mtd-utils/Makefile similarity index 100% rename from toolchain/jffs2/Makefile rename to tools/mtd-utils/Makefile diff --git a/toolchain/jffs2/patches/100-gcc4_fix.patch b/tools/mtd-utils/patches/100-gcc4_fix.patch similarity index 100% rename from toolchain/jffs2/patches/100-gcc4_fix.patch rename to tools/mtd-utils/patches/100-gcc4_fix.patch diff --git a/toolchain/sed/Makefile b/tools/sed/Makefile similarity index 100% rename from toolchain/sed/Makefile rename to tools/sed/Makefile diff --git a/toolchain/sed/sedcheck.sh b/tools/sed/sedcheck.sh similarity index 100% rename from toolchain/sed/sedcheck.sh rename to tools/sed/sedcheck.sh diff --git a/toolchain/squashfs/Makefile b/tools/squashfs/Makefile similarity index 100% rename from toolchain/squashfs/Makefile rename to tools/squashfs/Makefile diff --git a/toolchain/squashfs/patches/100-lzma.patch b/tools/squashfs/patches/100-lzma.patch similarity index 100% rename from toolchain/squashfs/patches/100-lzma.patch rename to tools/squashfs/patches/100-lzma.patch diff --git a/toolchain/sstrip/Makefile b/tools/sstrip/Makefile similarity index 100% rename from toolchain/sstrip/Makefile rename to tools/sstrip/Makefile diff --git a/toolchain/sstrip/include/elf.h b/tools/sstrip/include/elf.h similarity index 100% rename from toolchain/sstrip/include/elf.h rename to tools/sstrip/include/elf.h diff --git a/toolchain/sstrip/src/sstrip.c b/tools/sstrip/src/sstrip.c similarity index 100% rename from toolchain/sstrip/src/sstrip.c rename to tools/sstrip/src/sstrip.c -- 2.20.1