summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--README6
-rw-r--r--mk/build.mk42
-rw-r--r--mk/host.mk2
-rw-r--r--mk/image.mk12
-rw-r--r--mk/kernel-vars.mk2
-rw-r--r--mk/package.mk2
-rw-r--r--mk/pkg-bottom.mk6
-rw-r--r--mk/vars.mk40
-rw-r--r--package/base-files/Makefile2
-rw-r--r--package/gcc/Makefile6
-rw-r--r--rules.mk1
-rwxr-xr-xscripts/create.sh5
-rw-r--r--scripts/scan-tools.sh36
-rw-r--r--target/config/Config.in23
-rw-r--r--target/config/Config.in.tools40
-rw-r--r--target/linux/config/Config.in.kernel8
-rw-r--r--target/microblaze/Makefile9
-rw-r--r--target/mips/Makefile14
-rw-r--r--target/tools/addpattern/Makefile4
-rw-r--r--target/tools/mkfimage/Makefile4
-rw-r--r--target/tools/rules.mk7
-rw-r--r--target/tools/srec2bin/Makefile4
-rw-r--r--target/tools/trx/Makefile4
-rw-r--r--toolchain/gcc/Makefile4
-rw-r--r--tools/Makefile30
-rw-r--r--tools/addpattern/Makefile4
-rw-r--r--tools/addpattern/addpattern.c (renamed from target/tools/addpattern/addpattern.c)0
-rw-r--r--tools/adk/Makefile8
-rw-r--r--tools/bc/Makefile6
-rw-r--r--tools/cdrtools/Makefile6
-rw-r--r--tools/cpio/Makefile4
-rw-r--r--tools/genext2fs/Makefile6
-rw-r--r--tools/gperf/Makefile6
-rw-r--r--tools/lzma-loader/.svn/entries (renamed from target/tools/lzma-loader/.svn/entries)0
-rw-r--r--tools/lzma-loader/.svn/text-base/LzmaDecode.c.svn-base (renamed from target/tools/lzma-loader/.svn/text-base/LzmaDecode.c.svn-base)0
-rw-r--r--tools/lzma-loader/.svn/text-base/LzmaDecode.h.svn-base (renamed from target/tools/lzma-loader/.svn/text-base/LzmaDecode.h.svn-base)0
-rw-r--r--tools/lzma-loader/.svn/text-base/Makefile.svn-base (renamed from target/tools/lzma-loader/.svn/text-base/Makefile.svn-base)0
-rw-r--r--tools/lzma-loader/.svn/text-base/README.svn-base (renamed from target/tools/lzma-loader/.svn/text-base/README.svn-base)0
-rw-r--r--tools/lzma-loader/.svn/text-base/decompress.c.svn-base (renamed from target/tools/lzma-loader/.svn/text-base/decompress.c.svn-base)0
-rw-r--r--tools/lzma-loader/.svn/text-base/decompress.lds.in.svn-base (renamed from target/tools/lzma-loader/.svn/text-base/decompress.lds.in.svn-base)0
-rw-r--r--tools/lzma-loader/.svn/text-base/head.S.svn-base (renamed from target/tools/lzma-loader/.svn/text-base/head.S.svn-base)0
-rw-r--r--tools/lzma-loader/.svn/text-base/loader.lds.in.svn-base (renamed from target/tools/lzma-loader/.svn/text-base/loader.lds.in.svn-base)0
-rw-r--r--tools/lzma-loader/Makefile (renamed from target/tools/lzma-loader/Makefile)0
-rw-r--r--tools/lzma-loader/src/LzmaDecode.c (renamed from target/tools/lzma-loader/src/LzmaDecode.c)0
-rw-r--r--tools/lzma-loader/src/LzmaDecode.h (renamed from target/tools/lzma-loader/src/LzmaDecode.h)0
-rw-r--r--tools/lzma-loader/src/LzmaDecode.o (renamed from target/tools/lzma-loader/src/LzmaDecode.o)bin6248 -> 6248 bytes
-rw-r--r--tools/lzma-loader/src/Makefile (renamed from target/tools/lzma-loader/src/Makefile)0
-rw-r--r--tools/lzma-loader/src/README (renamed from target/tools/lzma-loader/src/README)0
-rw-r--r--tools/lzma-loader/src/data.lds (renamed from target/tools/lzma-loader/src/data.lds)0
-rw-r--r--tools/lzma-loader/src/data.o (renamed from target/tools/lzma-loader/src/data.o)bin3996 -> 3996 bytes
-rwxr-xr-xtools/lzma-loader/src/decompress (renamed from target/tools/lzma-loader/src/decompress)bin71097 -> 71097 bytes
-rw-r--r--tools/lzma-loader/src/decompress.c (renamed from target/tools/lzma-loader/src/decompress.c)0
-rwxr-xr-xtools/lzma-loader/src/decompress.image (renamed from target/tools/lzma-loader/src/decompress.image)bin3484 -> 3484 bytes
-rw-r--r--tools/lzma-loader/src/decompress.lds (renamed from target/tools/lzma-loader/src/decompress.lds)0
-rw-r--r--tools/lzma-loader/src/decompress.lds.in (renamed from target/tools/lzma-loader/src/decompress.lds.in)0
-rw-r--r--tools/lzma-loader/src/decompress.o (renamed from target/tools/lzma-loader/src/decompress.o)bin2680 -> 2680 bytes
-rw-r--r--tools/lzma-loader/src/head.S (renamed from target/tools/lzma-loader/src/head.S)0
-rw-r--r--tools/lzma-loader/src/head.o (renamed from target/tools/lzma-loader/src/head.o)bin1204 -> 1204 bytes
-rwxr-xr-xtools/lzma-loader/src/loader (renamed from target/tools/lzma-loader/src/loader)bin3804 -> 3804 bytes
-rwxr-xr-xtools/lzma-loader/src/loader.elf (renamed from target/tools/lzma-loader/src/loader.elf)bin8486 -> 8486 bytes
-rw-r--r--tools/lzma-loader/src/loader.gz (renamed from target/tools/lzma-loader/src/loader.gz)bin2374 -> 2374 bytes
-rw-r--r--tools/lzma-loader/src/loader.lds (renamed from target/tools/lzma-loader/src/loader.lds)0
-rw-r--r--tools/lzma-loader/src/loader.lds.in (renamed from target/tools/lzma-loader/src/loader.lds.in)0
-rwxr-xr-xtools/lzma-loader/src/loader.o (renamed from target/tools/lzma-loader/src/loader.o)bin8486 -> 8486 bytes
-rw-r--r--tools/lzma/Makefile (renamed from target/tools/lzma/Makefile)7
-rw-r--r--tools/lzma/patches/001-large_files.patch (renamed from target/tools/lzma/patches/001-large_files.patch)0
-rw-r--r--tools/lzma/patches/002-lzmp.patch (renamed from target/tools/lzma/patches/002-lzmp.patch)0
-rw-r--r--tools/lzma/patches/003-compile_fixes.patch (renamed from target/tools/lzma/patches/003-compile_fixes.patch)0
-rw-r--r--tools/lzma/patches/100-static_library.patch (renamed from target/tools/lzma/patches/100-static_library.patch)0
-rw-r--r--tools/mkcrypt/Makefile4
-rw-r--r--tools/mkfimage/Makefile4
-rw-r--r--tools/mkfimage/mkfimage.c (renamed from target/tools/mkfimage/mkfimage.c)0
-rw-r--r--tools/mkimage/Makefile4
-rw-r--r--tools/mtd-utils/Makefile (renamed from target/tools/mtd-utils/Makefile)6
-rw-r--r--tools/mtd-utils/patches/lzo.patch (renamed from target/tools/mtd-utils/patches/lzo.patch)0
-rw-r--r--tools/squashfs/Makefile (renamed from target/tools/squashfs/Makefile)8
-rw-r--r--tools/squashfs/patches/cppflags.patch (renamed from target/tools/squashfs/patches/cppflags.patch)0
-rw-r--r--tools/srec2bin/Makefile4
-rw-r--r--tools/srec2bin/srec2bin.c (renamed from target/tools/srec2bin/srec2bin.c)0
-rw-r--r--tools/syslinux/Makefile13
-rw-r--r--tools/trx/Makefile4
-rw-r--r--tools/trx/trx.c (renamed from target/tools/trx/trx.c)0
-rw-r--r--tools/xz/Makefile (renamed from target/tools/xz/Makefile)8
84 files changed, 224 insertions, 192 deletions
diff --git a/.gitignore b/.gitignore
index a4d67734a..fc81d7882 100644
--- a/.gitignore
+++ b/.gitignore
@@ -30,7 +30,6 @@
/host_*/
/pkg_*/
/root_*/
-/bin/
/firmware/
/build_*/
/config/*.o
diff --git a/README b/README
index 820cc95c9..3e280c165 100644
--- a/README
+++ b/README
@@ -8,16 +8,11 @@ Before you can start you need to install some tools:
- gcc
- binutils
- GNU make
-- GNU m4
- GNU awk
- GNU sed
- tar
- patch
- gzip
-- bzip2
-- lzop
-- lzma
-- xz
- wget
- libc headers
- ncurses5 headers
@@ -39,3 +34,4 @@ To switch to another target configuration, simply run "make switch". This will
backup your existing configuration and will start with an empty one.
Sunshine!
+ Waldemar Brodkorb <wbx@openadk.org>
diff --git a/mk/build.mk b/mk/build.mk
index eadccdcb3..d6fd9b20c 100644
--- a/mk/build.mk
+++ b/mk/build.mk
@@ -91,7 +91,7 @@ POSTCONFIG= -@\
if [ -f .adkinit ];then rm .adkinit;\
else \
if [ -f .config.old ];then \
- $(TOPDIR)/bin/pkgrebuild;\
+ $(TOPDIR)/host_$(GNU_HOST_NAME)/usr/bin/pkgrebuild;\
rebuild=0; \
if [ "$$(grep ^BUSYBOX .config|md5sum)" != "$$(grep ^BUSYBOX .config.old|md5sum)" ];then \
touch .rebuild.busybox;\
@@ -138,7 +138,7 @@ include $(TOPDIR)/rules.mk
all: world
${TOPDIR}/package/Depends.mk: ${TOPDIR}/.config $(wildcard ${TOPDIR}/package/*/Makefile)
- $(BIN_DIR)/depmaker > ${TOPDIR}/package/Depends.mk
+ $(STAGING_HOST_DIR)/usr/bin/depmaker > ${TOPDIR}/package/Depends.mk
.NOTPARALLEL:
.PHONY: all world clean cleantarget cleandir distclean image_clean
@@ -155,12 +155,12 @@ ifeq ($(ADK_NATIVE),y)
else
ifeq ($(ADK_TOOLCHAIN),y)
ifeq ($(ADK_TOOLCHAIN_ONLY),y)
- $(MAKE) -f mk/build.mk toolchain/fixup tools/install package/compile
+ $(MAKE) -f mk/build.mk tools/install toolchain/fixup package/compile
else
- $(MAKE) -f mk/build.mk toolchain/fixup tools/install package/compile root_clean package/install
+ $(MAKE) -f mk/build.mk tools/install toolchain/fixup package/compile root_clean package/install
endif
else
- $(MAKE) -f mk/build.mk toolchain/fixup tools/install target/config-prepare target/compile package/compile root_clean package/install target/install package_index
+ $(MAKE) -f mk/build.mk tools/install toolchain/fixup target/config-prepare target/compile package/compile root_clean package/install target/install package_index
endif
endif
@@ -250,13 +250,13 @@ root_clean:
clean:
@$(TRACE) clean
$(MAKE) -C $(CONFIG) clean
- for d in ${STAGING_PKG_DIR}; do \
- for f in $$(ls $$d/[a-z]* 2>/dev/null |grep -v [A-Z] 2>/dev/null); do \
- while read file ; do \
- rm ${STAGING_DIR}/$$file 2>/dev/null;\
- done < $$f ; \
- rm $$f ; \
- done \
+ for f in $$(ls ${STAGING_PKG_DIR}/ 2>/dev/null |grep -v [A-Z]|grep -v stamps 2>/dev/null); do \
+ while read file ; do \
+ echo ${STAGING_DIR}/$$file ;\
+ rm ${STAGING_DIR}/$$file 2>/dev/null;\
+ done < $$f ; \
+ echo ${STAGING_PKG_DIR}/$$f ;\
+ rm ${STAGING_PKG_DIR}/$$f ; \
done
rm -rf $(BUILD_DIR) $(FW_DIR) $(TARGET_DIR) \
${TOPDIR}/package/pkglist.d
@@ -619,24 +619,24 @@ bulkallmod:
if [ -f .exit ];then echo "Bulk build failed!"; cat .exit;rm .exit; exit 1;fi \
done
-${TOPDIR}/bin/pkgmaker: $(TOPDIR)/tools/adk/pkgmaker.c $(TOPDIR)/tools/adk/sortfile.c $(TOPDIR)/tools/adk/strmap.c
- @mkdir -p ${TOPDIR}/bin
+$(TOPDIR)/host_$(GNU_HOST_NAME)/usr/bin/pkgmaker: $(TOPDIR)/tools/adk/pkgmaker.c $(TOPDIR)/tools/adk/sortfile.c $(TOPDIR)/tools/adk/strmap.c
+ @mkdir -p host_$(GNU_HOST_NAME)/usr/bin
@$(CC_FOR_BUILD) -g -o $@ tools/adk/pkgmaker.c tools/adk/sortfile.c tools/adk/strmap.c
-${TOPDIR}/bin/pkgrebuild: $(TOPDIR)/tools/adk/pkgrebuild.c $(TOPDIR)/tools/adk/strmap.c
+$(TOPDIR)/host_$(GNU_HOST_NAME)/usr/bin/pkgrebuild: $(TOPDIR)/tools/adk/pkgrebuild.c $(TOPDIR)/tools/adk/strmap.c
@$(CC_FOR_BUILD) -g -o $@ tools/adk/pkgrebuild.c tools/adk/strmap.c
-package/Config.in.auto menu .menu: $(wildcard ${TOPDIR}/package/*/Makefile) ${TOPDIR}/bin/pkgmaker ${TOPDIR}/bin/pkgrebuild
+package/Config.in.auto menu .menu: $(wildcard ${TOPDIR}/package/*/Makefile) $(TOPDIR)/host_$(GNU_HOST_NAME)/usr/bin/pkgmaker $(TOPDIR)/host_$(GNU_HOST_NAME)/usr/bin/pkgrebuild
@echo "Generating menu structure ..."
- @$(TOPDIR)/bin/pkgmaker
+ @$(TOPDIR)/host_$(GNU_HOST_NAME)/usr/bin/pkgmaker
@:>.menu
-${TOPDIR}/bin/depmaker: $(TOPDIR)/tools/adk/depmaker.c
- $(CC_FOR_BUILD) -g -o $(TOPDIR)/bin/depmaker $(TOPDIR)/tools/adk/depmaker.c
+$(TOPDIR)/host_$(GNU_HOST_NAME)/usr/bin/depmaker: $(TOPDIR)/tools/adk/depmaker.c
+ $(CC_FOR_BUILD) -g -o $@ $(TOPDIR)/tools/adk/depmaker.c
-dep: $(TOPDIR)/bin/depmaker
+dep: $(TOPDIR)/host_$(GNU_HOST_NAME)/usr/bin/depmaker
@echo "Generating dependencies ..."
- @$(TOPDIR)/bin/depmaker > ${TOPDIR}/package/Depends.mk
+ @$(TOPDIR)/host_$(GNU_HOST_NAME)/usr/bin/depmaker > ${TOPDIR}/package/Depends.mk
.PHONY: menu dep
diff --git a/mk/host.mk b/mk/host.mk
index 3fcca0664..aa88bab44 100644
--- a/mk/host.mk
+++ b/mk/host.mk
@@ -37,7 +37,7 @@ _HOST_PATCH_COOKIE= ${WRKDIST}/.prepared
_HOST_CONFIGURE_COOKIE= ${WRKDIR}/.host_configure_done
_HOST_BUILD_COOKIE= ${WRKDIR}/.host_build_done
_HOST_FAKE_COOKIE= ${HOST_WRKINST}/.host_fake_done
-_HOST_COOKIE= ${STAGING_PKG_DIR}/${PKG_NAME}${PKG_VERSION}-${PKG_RELEASE}-host
+_HOST_COOKIE= ${STAGING_PKG_DIR}/stamps/${PKG_NAME}${PKG_VERSION}-${PKG_RELEASE}-host
hostextract: ${_HOST_EXTRACT_COOKIE}
hostpatch: ${_HOST_PATCH_COOKIE}
diff --git a/mk/image.mk b/mk/image.mk
index 9b60c2400..571752eaf 100644
--- a/mk/image.mk
+++ b/mk/image.mk
@@ -136,15 +136,15 @@ endif
${FW_DIR}/${ROOTFSTARBALL}: ${TARGET_DIR} kernel-package
cd ${TARGET_DIR}; find . | sed -n '/^\.\//s///p' | \
sed "s#\(.*\)#:0:0::::::\1#" | sort | \
- ${BIN_DIR}/cpio -o -Hustar -P | gzip -n9 >$@
+ ${STAGING_HOST_DIR}/usr/bin/cpio -o -Hustar -P | gzip -n9 >$@
${FW_DIR}/${ROOTFSUSERTARBALL}: ${TARGET_DIR}
cd ${TARGET_DIR}; find . | grep -v ./boot/ | sed -n '/^\.\//s///p' | \
sed "s#\(.*\)#:0:0::::::\1#" | sort | \
- ${BIN_DIR}/cpio -o -Hustar -P | gzip -n9 >$@
+ ${STAGING_HOST_DIR}/usr/bin/cpio -o -Hustar -P | gzip -n9 >$@
${FW_DIR}/${INITRAMFS}_list: ${TARGET_DIR}
- bash ${LINUX_DIR}/scripts/gen_initramfs_list.sh -u squash -g squash \
+ $(BASH) ${LINUX_DIR}/scripts/gen_initramfs_list.sh -u squash -g squash \
${TARGET_DIR}/ >$@
( \
echo "nod /dev/console 0644 0 0 c 5 1"; \
@@ -162,12 +162,12 @@ ${FW_DIR}/${INITRAMFS}: ${FW_DIR}/${INITRAMFS}_list
${ADK_COMPRESSION_TOOL} -c >$@
${BUILD_DIR}/root.squashfs: ${TARGET_DIR}
- ${STAGING_HOST_DIR}/bin/mksquashfs ${TARGET_DIR} \
+ ${STAGING_HOST_DIR}/usr/bin/mksquashfs ${TARGET_DIR} \
${BUILD_DIR}/root.squashfs -comp xz \
-nopad -noappend -root-owned $(MAKE_TRACE)
${FW_DIR}/${ROOTFSJFFS2}: ${TARGET_DIR}
- ${STAGING_HOST_DIR}/bin/mkfs.jffs2 $(ADK_JFFS2_OPTS) -q -r ${TARGET_DIR} \
+ ${STAGING_HOST_DIR}/usr/bin/mkfs.jffs2 $(ADK_JFFS2_OPTS) -q -r ${TARGET_DIR} \
--pad=$(ADK_TARGET_MTD_SIZE) -o ${FW_DIR}/${ROOTFSJFFS2} $(MAKE_TRACE)
createinitramfs: ${FW_DIR}/${INITRAMFS}_list
@@ -242,7 +242,7 @@ ${FW_DIR}/${ROOTFSISO}: ${TARGET_DIR} kernel-package
${TARGET_DIR}/boot/syslinux
echo 'DEFAULT /boot/kernel root=/dev/sr0 init=/init' > \
${TARGET_DIR}/boot/syslinux/isolinux.cfg
- ${BIN_DIR}/mkisofs -R -uid 0 -gid 0 -o $@ \
+ ${STAGING_HOST_DIR}/usr/bin/mkisofs -R -uid 0 -gid 0 -o $@ \
-b boot/syslinux/isolinux.bin \
-c boot/syslinux/boot.cat -no-emul-boot \
-boot-load-size 4 -boot-info-table ${TARGET_DIR}
diff --git a/mk/kernel-vars.mk b/mk/kernel-vars.mk
index d668f7edb..0b3e7ddbb 100644
--- a/mk/kernel-vars.mk
+++ b/mk/kernel-vars.mk
@@ -25,4 +25,4 @@ ADK_KCPPFLAGS+= -DBCM47XX_OVERRIDE_FLASHSIZE=0x800000 \
endif
KERNEL_MAKE_ENV+= KCPPFLAGS='${ADK_KCPPFLAGS}' \
- PATH="${BIN_DIR}:$$PATH"
+ PATH="${STAGING_HOST_DIR}/usr/bin:$$PATH"
diff --git a/mk/package.mk b/mk/package.mk
index 125ed3d26..264cd06e0 100644
--- a/mk/package.mk
+++ b/mk/package.mk
@@ -249,7 +249,7 @@ endif
find usr ! -type d 2>/dev/null | \
grep -E -v -e '^usr/lib/pkgconfig' -e '^usr/share' -e '^usr/doc' -e '^usr/src' -e '^usr/man' -e '^usr/info' -e '^usr/lib/libc.so' -e '^usr/bin/[a-z0-9-]+-config' | \
tee '$${STAGING_PKG_DIR}/$(1)' | \
- $(BIN_DIR)/cpio -padlmu '$${STAGING_DIR}'
+ $(STAGING_HOST_DIR)/usr/bin/cpio -padlmu '$${STAGING_DIR}'
@cd '$${STAGING_DIR}'; grep 'usr/lib/.*\.la$$$$' \
'$${STAGING_PKG_DIR}/$(1)' | while read fn; do \
chmod u+w $$$$fn; \
diff --git a/mk/pkg-bottom.mk b/mk/pkg-bottom.mk
index d82a653ea..3988a676f 100644
--- a/mk/pkg-bottom.mk
+++ b/mk/pkg-bottom.mk
@@ -171,11 +171,11 @@ ifneq (,$(filter dev,${PKG_OPTS}))
@mkdir -p $(WRKDIR)/fake-${CPU_ARCH}/pkg-$(PKG_LIBNAME)-dev/usr/include
@test -d ${WRKINST}/usr/include && cd ${WRKINST}/usr/include; \
find . -name \*.h | \
- $(BIN_DIR)/cpio -padlmu $(WRKDIR)/fake-${CPU_ARCH}/pkg-$(PKG_LIBNAME)-dev/usr/include
+ $(STAGING_HOST_DIR)/usr/bin/cpio -padlmu $(WRKDIR)/fake-${CPU_ARCH}/pkg-$(PKG_LIBNAME)-dev/usr/include
@mkdir -p $(WRKDIR)/fake-${CPU_ARCH}/pkg-$(PKG_LIBNAME)-dev/usr/lib/pkgconfig
@test -d ${WRKINST}/usr/lib/pkgconfig && cd ${WRKINST}/usr/lib/pkgconfig; \
find . -name \*.pc | \
- $(BIN_DIR)/cpio -padlmu $(WRKDIR)/fake-${CPU_ARCH}/pkg-$(PKG_LIBNAME)-dev/usr/lib/pkgconfig
+ $(STAGING_HOST_DIR)/usr/bin/cpio -padlmu $(WRKDIR)/fake-${CPU_ARCH}/pkg-$(PKG_LIBNAME)-dev/usr/lib/pkgconfig
@for a in ${WRKINST}/usr/bin/*-config*; do \
[[ -e $$a ]] || continue; \
mkdir -p $(WRKDIR)/fake-${CPU_ARCH}/pkg-$(PKG_LIBNAME)-dev/usr/bin; \
@@ -191,7 +191,7 @@ endif
find usr ! -type d 2>/dev/null | \
grep -E -v -e '^usr/lib/pkgconfig' -e '^usr/share' -e '^usr/src' -e '^usr/doc' -e '^usr/local' -e '^usr/man' -e '^usr/info' -e '^usr/lib/libc.so' -e '^usr/bin/[a-z0-9-]+-config*' -e '^/usr/lib/libpthread_nonshared.a' | \
tee '${STAGING_PKG_DIR}/${PKG_NAME}' | \
- $(BIN_DIR)/cpio -padlmu '${STAGING_DIR}'
+ $(STAGING_HOST_DIR)/usr/bin/cpio -padlmu '${STAGING_DIR}'
@cd '${STAGING_DIR}'; grep 'usr/lib/.*\.la$$' \
'${STAGING_PKG_DIR}/${PKG_NAME}' | while read fn; do \
chmod u+w $$fn; \
diff --git a/mk/vars.mk b/mk/vars.mk
index 427b5b4ec..a9b213e4c 100644
--- a/mk/vars.mk
+++ b/mk/vars.mk
@@ -16,34 +16,38 @@ BUILD_DIR:= ${BASE_DIR}/build_${ADK_TARGET_SYSTEM}_${CPU_ARCH}_${ADK_TARGET_LIB
BUILD_DIR_PFX:= $(BASE_DIR)/build_*
STAGING_PKG_DIR:= ${BASE_DIR}/pkg_${ADK_TARGET_SYSTEM}_${CPU_ARCH}_${ADK_TARGET_LIBC}
STAGING_PKG_DIR_PFX:= ${BASE_DIR}/pkg_*
-STAGING_HOST_DIR:= ${BASE_DIR}/host_${CPU_ARCH}_${ADK_TARGET_SUFFIX}_${ADK_TARGET_LIBC}
+STAGING_HOST_DIR:= ${BASE_DIR}/host_${GNU_HOST_NAME}
STAGING_HOST_DIR_PFX:= ${BASE_DIR}/host_*
# use headers and foo-config from system
ifeq ($(ADK_NATIVE),y)
STAGING_TARGET_DIR:=
SCRIPT_TARGET_DIR:= /usr/bin
else
-STAGING_TARGET_DIR:= ${BASE_DIR}/target_${CPU_ARCH}_${ADK_TARGET_SUFFIX}_${ADK_TARGET_LIBC}
+ifeq ($(ADK_TARGET_ABI),)
+STAGING_TARGET_DIR:= ${BASE_DIR}/target_${CPU_ARCH}_${ADK_TARGET_LIBC}
+STAGING_DIR:= ${BASE_DIR}/target_${CPU_ARCH}_${ADK_TARGET_LIBC}
+STAGING_HOST2TARGET:= ../target_${CPU_ARCH}_${ADK_TARGET_LIBC}
+TOOLCHAIN_BUILD_DIR= $(BASE_DIR)/toolchain_build_${CPU_ARCH}_${ADK_TARGET_LIBC}
+else
+STAGING_TARGET_DIR:= ${BASE_DIR}/target_${CPU_ARCH}_${ADK_TARGET_LIBC}_${ADK_TARGET_ABI}
+STAGING_DIR:= ${BASE_DIR}/target_${CPU_ARCH}_${ADK_TARGET_LIBC}_${ADK_TARGET_ABI}
+STAGING_HOST2TARGET:= ../target_${CPU_ARCH}_${ADK_TARGET_LIBC}_${ADK_TARGET_ABI}
+TOOLCHAIN_BUILD_DIR= $(BASE_DIR)/toolchain_build_${CPU_ARCH}_${ADK_TARGET_LIBC}_${ADK_TARGET_ABI}
+endif
SCRIPT_TARGET_DIR:= ${STAGING_TARGET_DIR}/scripts
endif
-STAGING_DIR:= ${BASE_DIR}/target_${CPU_ARCH}_${ADK_TARGET_SUFFIX}_${ADK_TARGET_LIBC}
STAGING_TARGET_DIR_PFX:=${BASE_DIR}/target_*
-# relation from STAGING_HOST_DIR to STAGING_TARGET_DIR (for gcc to find
-# its sysroot while staying relocatable)
-STAGING_HOST2TARGET:= ../target_${CPU_ARCH}_${ADK_TARGET_SUFFIX}_${ADK_TARGET_LIBC}
-TOOLCHAIN_BUILD_DIR= $(BASE_DIR)/toolchain_build_${CPU_ARCH}_${ADK_TARGET_SUFFIX}_${ADK_TARGET_LIBC}
TOOLCHAIN_BUILD_DIR_PFX=$(BASE_DIR)/toolchain_build_*
TOOLS_BUILD_DIR= $(BASE_DIR)/tools_build
-BIN_DIR:= $(BASE_DIR)/bin
SCRIPT_DIR:= $(BASE_DIR)/scripts
FW_DIR:= $(BASE_DIR)/firmware/${ADK_TARGET_SYSTEM}_${CPU_ARCH}_${ADK_TARGET_LIBC}
FW_DIR_PFX:= $(BASE_DIR)/firmware
PACKAGE_DIR:= $(FW_DIR)/packages
TARGET_DIR:= $(BASE_DIR)/root_${ADK_TARGET_SYSTEM}_${CPU_ARCH}_${ADK_TARGET_LIBC}
TARGET_DIR_PFX:= $(BASE_DIR)/root_*
-TARGET_PATH= ${SCRIPT_DIR}:${BIN_DIR}:${STAGING_TARGET_DIR}/scripts:${STAGING_HOST_DIR}/bin:${STAGING_HOST_DIR}/usr/bin:${_PATH}
-HOST_PATH= ${SCRIPT_DIR}:${BIN_DIR}:${STAGING_HOST_DIR}/bin:${STAGING_HOST_DIR}/usr/bin:${_PATH}
-AUTOTOOL_PATH= ${BIN_DIR}:${STAGING_HOST_DIR}/bin:${STAGING_HOST_DIR}/usr/bin:${STAGING_TARGET_DIR}/scripts:${_PATH}
+TARGET_PATH= ${SCRIPT_DIR}:${STAGING_TARGET_DIR}/scripts:${STAGING_HOST_DIR}/bin:${STAGING_HOST_DIR}/usr/bin:${_PATH}
+HOST_PATH= ${SCRIPT_DIR}:${STAGING_HOST_DIR}/bin:${STAGING_HOST_DIR}/usr/bin:${_PATH}
+AUTOTOOL_PATH= ${STAGING_HOST_DIR}/bin:${STAGING_HOST_DIR}/usr/bin:${STAGING_TARGET_DIR}/scripts:${_PATH}
REAL_GNU_TARGET_NAME= $(CPU_ARCH)-$(ADK_VENDOR)-linux-$(ADK_TARGET_SUFFIX)
GNU_TARGET_NAME= $(CPU_ARCH)-$(ADK_VENDOR)-linux
@@ -185,7 +189,7 @@ PKG_INSTALL:= IPKG_TMP=$(BUILD_DIR)/tmp \
IPKG_INSTROOT=$(TARGET_DIR) \
IPKG_CONF_DIR=$(STAGING_TARGET_DIR)/etc \
IPKG_OFFLINE_ROOT=$(TARGET_DIR) \
- BIN_DIR=$(BIN_DIR) \
+ BIN_DIR=$(STAGING_HOST_DIR)/usr/bin \
${BASH} ${SCRIPT_DIR}/ipkg \
-force-defaults -force-depends install
PKG_STATE_DIR:= $(TARGET_DIR)/usr/lib/ipkg
@@ -208,21 +212,21 @@ EXTRACT_CMD= mkdir -p ${WRKDIR}; \
cd ${WRKDIR} && \
for file in ${FULLDISTFILES}; do case $$file in \
*.cpio) \
- cat $$file | $(BIN_DIR)/cpio -i -d ;; \
+ cat $$file | $(STAGING_HOST_DIR)/usr/bin/cpio -i -d ;; \
*.tar) \
tar -xf $$file ;; \
*.cpio.Z | *.cpio.gz | *.cgz | *.mcz) \
- gzip -dc $$file | $(BIN_DIR)/cpio -i -d ;; \
+ gzip -dc $$file | $(STAGING_HOST_DIR)/usr/bin/cpio -i -d ;; \
*.tar.xz | *.txz) \
- xz -dc $$file | tar -xf - ;; \
+ $(STAGING_HOST_DIR)/usr/bin/xz -dc $$file | tar -xf - ;; \
*.tar.Z | *.tar.gz | *.taz | *.tgz) \
gzip -dc $$file | tar -xf - ;; \
*.cpio.bz2 | *.cbz) \
- bzip2 -dc $$file | $(BIN_DIR)/cpio -i -d ;; \
+ $(STAGING_HOST_DIR)/usr/bin/bzip2 -dc $$file | $(STAGING_HOST_DIR)/usr/bin/cpio -i -d ;; \
*.tar.bz2 | *.tbz | *.tbz2) \
- bzip2 -dc $$file | tar -xf - ;; \
+ $(STAGING_HOST_DIR)/usr/bin/bzip2 -dc $$file | tar -xf - ;; \
*.zip) \
- cat $$file | $(BIN_DIR)/cpio -ivd -H zip ;; \
+ cat $$file | $(STAGING_HOST_DIR)/usr/bin/cpio -ivd -H zip ;; \
*.arm) \
cp $$file ${WRKDIR} ;; \
*) \
diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index 0eb3a40b3..ad09f8d3d 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -85,7 +85,7 @@ endif
echo "::1 localhost" >> $(IDIR_BASE_FILES)/etc/hosts
echo "127.0.1.1 $(ADK_RUNTIME_HOSTNAME)" >> $(IDIR_BASE_FILES)/etc/hosts
test -z $(ADK_RUNTIME_PASSWORD) || \
- $(SED) 's,\*NP\*,'"$$(${TOPDIR}/bin/mkcrypt \
+ $(SED) 's,\*NP\*,'"$$($(STAGING_HOST_DIR)/usr/bin/mkcrypt \
${ADK_RUNTIME_PASSWORD}),g" $(IDIR_BASE_FILES)/etc/shadow
git log -1|head -1|sed -e 's#commit ##' \
> $(IDIR_BASE_FILES)/etc/adkversion
diff --git a/package/gcc/Makefile b/package/gcc/Makefile
index 4b8480342..9e043401a 100644
--- a/package/gcc/Makefile
+++ b/package/gcc/Makefile
@@ -26,13 +26,13 @@ TARGET_CFLAGS:= ''
TARGET_CXXFLAGS:= $(filter-out -fstack-protector,$(TARGET_CXXFLAGS))
ifeq ($(ADK_TARGET_SYSTEM_LEMOTE_YEELONG),y)
-CONFIGURE_ARGS+= --with-abi=$(ADK_TARGET_ABI)
+CONFIGURE_ARGS+= --with-abi=$(ADK_TARGET_MIPS_ABI)
endif
ifeq ($(ADK_TARGET_SYSTEM_QEMU_MIPS64),y)
-CONFIGURE_ARGS+= --with-abi=$(ADK_TARGET_ABI)
+CONFIGURE_ARGS+= --with-abi=$(ADK_TARGET_MIPS_ABI)
endif
ifeq ($(ADK_TARGET_SYSTEM_QEMU_MIPS64EL),y)
-CONFIGURE_ARGS+= --with-abi=$(ADK_TARGET_ABI)
+CONFIGURE_ARGS+= --with-abi=$(ADK_TARGET_MIPS_ABI)
endif
ifeq ($(ADK_TOOLCHAIN_GCC_SJLJ),y)
diff --git a/rules.mk b/rules.mk
index 8865327f8..c4f7594ee 100644
--- a/rules.mk
+++ b/rules.mk
@@ -39,6 +39,7 @@ ADK_TARGET_ABI_CFLAGS:= $(strip $(subst ",, $(ADK_TARGET_ABI_CFLAGS)))
ADK_TARGET_ABI_LDFLAGS:= $(strip $(subst ",, $(ADK_TARGET_ABI_LDFLAGS)))
ADK_TARGET_KERNEL_LDFLAGS:= $(strip $(subst ",, $(ADK_TARGET_KERNEL_LDFLAGS)))
ADK_TARGET_ABI:= $(strip $(subst ",, $(ADK_TARGET_ABI)))
+ADK_TARGET_MIPS_ABI:= $(strip $(subst ",, $(ADK_TARGET_MIPS_ABI)))
ADK_TARGET_IP:= $(strip $(subst ",, $(ADK_TARGET_IP)))
ADK_TARGET_SUFFIX:= $(strip $(subst ",, $(ADK_TARGET_SUFFIX)))
ADK_TARGET_CMDLINE:= $(strip $(subst ",, $(ADK_TARGET_CMDLINE)))
diff --git a/scripts/create.sh b/scripts/create.sh
index 634a87643..f5309f884 100755
--- a/scripts/create.sh
+++ b/scripts/create.sh
@@ -28,11 +28,12 @@
# root partition and an OpenADK cfgfs partition.
TOPDIR=$(pwd)
+HOST=$(gcc -dumpmachine)
me=$0
case :$PATH: in
-(*:$TOPDIR/bin:*) ;;
-(*) export PATH=$PATH:$TOPDIR/bin ;;
+(*:$TOPDIR/host_$HOST/usr/bin:*) ;;
+(*) export PATH=$PATH:$TOPDIR/host_$HOST/usr/bin ;;
esac
test -n "$KSH_VERSION" || if ! which mksh >/dev/null 2>&1; then
diff --git a/scripts/scan-tools.sh b/scripts/scan-tools.sh
index a060d24fc..af3223b0b 100644
--- a/scripts/scan-tools.sh
+++ b/scripts/scan-tools.sh
@@ -112,30 +112,6 @@ if ! which gzip >/dev/null 2>&1; then
out=1
fi
-if ! which bzip2 >/dev/null 2>&1; then
- echo You must install bzip2 to continue.
- echo
- out=1
-fi
-
-if ! which lzop >/dev/null 2>&1; then
- echo You must install lzop to continue.
- echo
- out=1
-fi
-
-if ! which lzma >/dev/null 2>&1; then
- echo You must install lzma to continue.
- echo
- out=1
-fi
-
-if ! which xz >/dev/null 2>&1; then
- echo You must install xz-utils to continue.
- echo
- out=1
-fi
-
if ! which patch >/dev/null 2>&1; then
echo You must install patch to continue.
echo
@@ -219,18 +195,6 @@ if ! which perl >/dev/null 2>&1; then
out=1
fi
-if ! which m4 >/dev/null 2>&1; then
- echo "You must install m4 (macro processor) to continue."
- echo
- out=1
-fi
-
-if ! which bc >/dev/null 2>&1; then
- echo "You need bc to continue."
- echo
- out=1
-fi
-
if ! which xargs >/dev/null 2>&1; then
echo "You need xargs to continue."
echo
diff --git a/target/config/Config.in b/target/config/Config.in
index 68e2eefb0..f59bdd5b7 100644
--- a/target/config/Config.in
+++ b/target/config/Config.in
@@ -118,6 +118,17 @@ config ADK_n64
config ADK_TARGET_ABI
string
+ default "o32" if ADK_o32
+ default "n32" if ADK_n32
+ default "n64" if ADK_n64
+ default "32" if ADK_32
+ default "x32" if ADK_x32
+ default "64" if ADK_64
+ default "eabi" if ADK_EABI
+ default "eabihf" if ADK_EABIHF
+
+config ADK_TARGET_MIPS_ABI
+ string
default "32" if ADK_o32
default "n32" if ADK_n32
default "64" if ADK_n64
@@ -650,6 +661,7 @@ config ADK_TARGET_LIB_EGLIBC
prompt "Embedded GNU C library"
boolean
select ADK_eglibc
+ select ADK_HOST_NEED_GPERF
depends on \
ADK_LINUX_ARM || \
ADK_LINUX_ARMEB || \
@@ -719,6 +731,11 @@ config ADK_TARGET_SUFFIX
default "muslgnueabihf" if ADK_TARGET_LIB_MUSL && ADK_EABIHF
default "muslgnueabi" if ADK_TARGET_LIB_MUSL && ADK_EABI
default "musl" if ADK_TARGET_LIB_MUSL && !ADK_EABI
+ default "n64" if ADK_n64
+ default "n32" if ADK_n32
+ default "o32" if ADK_o32
+ default "32" if ADK_32
+ default "x32" if ADK_x32
default "gnu"
choice
@@ -767,6 +784,7 @@ config ADK_TARGET_ROOTFS_INITRAMFS_PIGGYBACK
config ADK_TARGET_ROOTFS_SQUASHFS
bool "Compressed read-only root filesystem (squashfs)"
select ADK_KERNEL_SQUASHFS
+ select ADK_HOST_NEED_SQUASHFS
depends on ADK_TARGET_WITH_MTD
help
highly compressed read-only filesystem for MTD flash systems.
@@ -775,6 +793,7 @@ config ADK_TARGET_ROOTFS_JFFS2
bool "Compressed read-write root filesystem (jffs2)"
select ADK_KERNEL_MISC_FILESYSTEMS
select ADK_KERNEL_JFFS2
+ select ADK_HOST_NEED_JFFS2
depends on ADK_TARGET_WITH_MTD
help
compressed read-write filesystem for MTD flash systems.
@@ -833,6 +852,7 @@ config ADK_TARGET_ROOTFS_GENEXT2FS
depends on ADK_TARGET_WITH_CF
select ADK_KERNEL_EXT2_FS
select ADK_KERNEL_SCSI
+ select ADK_HOST_NEED_GENEXT2FS
help
Use this option if you have a compact flash based system.
(ext2 filesystem is used.)
@@ -853,6 +873,8 @@ config ADK_TARGET_ROOTFS_ISO
select ADK_KERNEL_JOLIET
select ADK_KERNEL_SCSI
select ADK_KERNEL_BLK_DEV_SR
+ select ADK_HOST_NEED_MKISOFS
+ select ADK_HOST_NEED_SYSLINUX
depends on ADK_HOST_LINUX
depends on ADK_LINUX_X86
help
@@ -860,6 +882,7 @@ config ADK_TARGET_ROOTFS_ISO
config ADK_TARGET_ROOTFS_ARCHIVE
bool "Archive usable for different filesystems"
+ select ADK_HOST_NEED_GENEXT2FS if ADK_HARDWARE_QEMU
select ADK_KERNEL_EXT2_FS if ADK_HARDWARE_QEMU
depends on !ADK_LINUX_MICROBLAZE
help
diff --git a/target/config/Config.in.tools b/target/config/Config.in.tools
index 31246458d..cf92eadee 100644
--- a/target/config/Config.in.tools
+++ b/target/config/Config.in.tools
@@ -1,3 +1,43 @@
+config ADK_HOST_NEED_MKISOFS
+ boolean
+ default n
+
+config ADK_HOST_NEED_SYSLINUX
+ boolean
+ default n
+
+config ADK_HOST_NEED_GPERF
+ boolean
+ default n
+
+config ADK_HOST_NEED_SQUASHFS
+ boolean
+ default n
+
+config ADK_HOST_NEED_JFFS2
+ boolean
+ default n
+
+config ADK_HOST_NEED_GENEXT2FS
+ boolean
+ default n
+
+config ADK_HOST_NEED_LZOP
+ boolean
+ default n
+
+config ADK_HOST_NEED_LZMA
+ boolean
+ default n
+
+config ADK_HOST_NEED_BZIP2
+ boolean
+ default n
+
+config ADK_HOST_NEED_XZ
+ boolean
+ default n
+
config ADK_TOOLS_ADDPATTERN_ARGS
string
default "-p W54G -v v4.20.6" if ADK_TARGET_BROADCOM_MODEL_LINKSYS_WRT54G
diff --git a/target/linux/config/Config.in.kernel b/target/linux/config/Config.in.kernel
index db1ab5c57..d928cea09 100644
--- a/target/linux/config/Config.in.kernel
+++ b/target/linux/config/Config.in.kernel
@@ -11,18 +11,22 @@ config ADK_KERNEL_INITRAMFS_COMPRESSION_NONE
boolean
config ADK_KERNEL_INITRAMFS_COMPRESSION_XZ
+ select ADK_HOST_NEED_XZ
boolean
config ADK_KERNEL_INITRAMFS_COMPRESSION_LZMA
+ select ADK_HOST_NEED_LZMA
boolean
config ADK_KERNEL_INITRAMFS_COMPRESSION_LZO
+ select ADK_HOST_NEED_LZOP
boolean
-config ADK_KERNEL_INITRAMFS_COMPRESSION_GZIP
+config ADK_KERNEL_INITRAMFS_COMPRESSION_BZIP2
+ select ADK_HOST_NEED_BZIP2
boolean
-config ADK_KERNEL_INITRAMFS_COMPRESSION_BZIP2
+config ADK_KERNEL_INITRAMFS_COMPRESSION_GZIP
boolean
config ADK_KERNEL_RD_GZIP
diff --git a/target/microblaze/Makefile b/target/microblaze/Makefile
index 7a411aa95..c3b6dfa7e 100644
--- a/target/microblaze/Makefile
+++ b/target/microblaze/Makefile
@@ -9,11 +9,6 @@ include $(TOPDIR)/mk/image.mk
KERNEL:=$(LINUX_DIR)/arch/microblaze/boot/$(ADK_TARGET_KERNEL)
-tools-compile:
- $(MAKE) -C ../tools/mtd-utils all
- $(MAKE) -C ../tools/xz all
- $(MAKE) -C ../tools/squashfs all
-
ifeq ($(ADK_TARGET_QEMU_MICROBLAZE_MODEL_ML605),y)
MODEL:=petalogix-ml605
DTB:=-dtb target/microblaze/ml605.dtb
@@ -24,7 +19,7 @@ DTB:=
endif
ifeq ($(ADK_TARGET_FS),squashfs)
-imageinstall: tools-compile $(BUILD_DIR)/root.squashfs
+imageinstall: $(BUILD_DIR)/root.squashfs
qemu-img create -f raw $(FW_DIR)/$(ROOTFSSQUASHFS) $(ADK_TARGET_MTD_SIZE)
dd conv=notrunc if=$(BUILD_DIR)/root.squashfs of=$(FW_DIR)/$(ROOTFSSQUASHFS)
@cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
@@ -34,7 +29,7 @@ ifneq ($(ADK_HARDWARE_QEMU),)
endif
endif
ifeq ($(ADK_TARGET_FS),jffs2)
-imageinstall: tools-compile $(FW_DIR)/$(ROOTFSJFFS2)
+imageinstall: $(FW_DIR)/$(ROOTFSJFFS2)
@cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
ifneq ($(ADK_HARDWARE_QEMU),)
@echo "Start qemu with following options:"
diff --git a/target/mips/Makefile b/target/mips/Makefile
index 31cbc319a..5ebbe5d7d 100644
--- a/target/mips/Makefile
+++ b/target/mips/Makefile
@@ -11,16 +11,8 @@ KERNEL:=$(LINUX_DIR)/$(ADK_TARGET_KERNEL)
OSTRIP:=-R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id
-tools-compile:
- $(MAKE) -C ../tools/trx all
- $(MAKE) -C ../tools/addpattern all
- $(MAKE) -C ../tools/srec2bin all
- $(MAKE) -C ../tools/squashfs all
- $(MAKE) -C ../tools/lzma all
- $(MAKE) -C ../tools/lzma-loader all
-
ifeq ($(ADK_TARGET_SYSTEM_BROADCOM_BCM47XX),y)
-kernel-install: tools-compile
+kernel-install:
${TARGET_CROSS}objcopy ${OSTRIP} -S ${LINUX_DIR}/vmlinuz.elf \
${BUILD_DIR}/${TARGET_KERNEL}
@@ -39,7 +31,7 @@ endif
endif
ifeq ($(ADK_TARGET_SYSTEM_LINKSYS_AG241),y)
-kernel-install: tools-compile
+kernel-install:
${TARGET_CROSS}objcopy -S -O srec $(KERNEL) $(LINUX_DIR)/vmlinux.srec
PATH='${TARGET_PATH}' srec2bin $(LINUX_DIR)/vmlinux.srec $(LINUX_DIR)/vmlinux.bin
(dd if=/dev/zero bs=16 count=1; cat $(LINUX_DIR)/vmlinux.bin) > $(LINUX_DIR)/vmlinux.tmp
@@ -56,7 +48,7 @@ kernel-install:
$(TARGET_CROSS)objcopy $(OSTRIP) -S $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
endif
ifeq ($(ADK_TARGET_SYSTEM_FON_FON2100),y)
-kernel-install: tools-compile
+kernel-install:
$(TARGET_CROSS)objcopy $(OSTRIP) -S $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
${BUILD_DIR}/${ROOTFSSQUASHFS}: ${BUILD_DIR}/root.squashfs
diff --git a/target/tools/addpattern/Makefile b/target/tools/addpattern/Makefile
deleted file mode 100644
index 596daeb52..000000000
--- a/target/tools/addpattern/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-include $(TOPDIR)/rules.mk
-
-all: addpattern.c
- $(CC_FOR_BUILD) $(FLAGS_FOR_BUILD) -o ${STAGING_HOST_DIR}/bin/addpattern addpattern.c
diff --git a/target/tools/mkfimage/Makefile b/target/tools/mkfimage/Makefile
deleted file mode 100644
index 2c6e37878..000000000
--- a/target/tools/mkfimage/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-include $(TOPDIR)/rules.mk
-
-all: mkfimage.c
- $(CC_FOR_BUILD) ${FLAGS_FOR_BUILD} -o ${STAGING_HOST_DIR}/bin/mkfimage mkfimage.c $(MAKE_TRACE)
diff --git a/target/tools/rules.mk b/target/tools/rules.mk
deleted file mode 100644
index a6a3684ac..000000000
--- a/target/tools/rules.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-# This file is part of the OpenADK project. OpenADK is copyrighted
-# material, please see the LICENCE file in the top-level directory.
-
-WRKDIR_BASE= ${TOOLS_BUILD_DIR}
-WRKDIR= ${WRKDIR_BASE}
-
-include ${TOPDIR}/mk/buildhlp.mk
diff --git a/target/tools/srec2bin/Makefile b/target/tools/srec2bin/Makefile
deleted file mode 100644
index f48f8f939..000000000
--- a/target/tools/srec2bin/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-include $(TOPDIR)/rules.mk
-
-all: srec2bin.c
- $(CC_FOR_BUILD) $(FLAGS_FOR_BUILD) -o ${STAGING_HOST_DIR}/bin/srec2bin srec2bin.c
diff --git a/target/tools/trx/Makefile b/target/tools/trx/Makefile
deleted file mode 100644
index d1832ee8c..000000000
--- a/target/tools/trx/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-include $(TOPDIR)/rules.mk
-
-all: trx.c
- $(CC_FOR_BUILD) $(FLAGS_FOR_BUILD) -o ${STAGING_HOST_DIR}/bin/trx trx.c
diff --git a/toolchain/gcc/Makefile b/toolchain/gcc/Makefile
index 2cd720a63..57053e067 100644
--- a/toolchain/gcc/Makefile
+++ b/toolchain/gcc/Makefile
@@ -98,8 +98,8 @@ ifeq ($(ADK_CPU_CORTEX_A9),y)
GCC_CONFOPTS+= --with-arch=armv7-a --with-tune=cortex-a9 --with-fpu=neon
endif
-ifneq ($(ADK_TARGET_ABI),)
-GCC_CONFOPTS+= --with-abi=${ADK_TARGET_ABI}
+ifneq ($(ADK_TARGET_MIPS_ABI),)
+GCC_CONFOPTS+= --with-abi=${ADK_TARGET_MIPS_ABI}
endif
ifeq (${ADK_MAKE_PARALLEL},y)
diff --git a/tools/Makefile b/tools/Makefile
index 4326dd4ab..2ffa4971c 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -3,13 +3,35 @@
include $(TOPDIR)/rules.mk
-TARGETS:=adk mkcrypt cpio mkimage genext2fs bc
-ifeq ($(ADK_TARGET_ROOTFS_ISO),y)
-TARGETS+=cdrtools syslinux
+TARGETS:=adk mkcrypt cpio bc bzip2 m4 xz
+
+ifeq ($(ADK_HOST_NEED_GENEXT2FS),y)
+TARGETS+=genext2fs
+endif
+ifeq ($(ADK_HOST_NEED_MKIMAGE),y)
+TARGETS+=mkimage
+endif
+ifeq ($(ADK_HOST_NEED_MKISOFS),y)
+TARGETS+=cdrtools
+endif
+ifeq ($(ADK_HOST_NEED_SYSLINUX),y)
+TARGETS+=syslinux
endif
-ifeq ($(ADK_TARGET_LIB_EGLIBC),y)
+ifeq ($(ADK_HOST_NEED_GPERF),y)
TARGETS+=gperf
endif
+ifeq ($(ADK_HOST_NEED_JFFS2),y)
+TARGETS+=mtd-utils
+endif
+ifeq ($(ADK_HOST_NEED_SQUASHFS),y)
+TARGETS+=squashfs
+endif
+ifeq ($(ADK_HOST_NEED_LZOP),y)
+TARGETS+=lzo lzop
+endif
+ifeq ($(ADK_HOST_NEED_LZMA),y)
+TARGETS+=lzma
+endif
TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS))
TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS))
diff --git a/tools/addpattern/Makefile b/tools/addpattern/Makefile
new file mode 100644
index 000000000..10ba05933
--- /dev/null
+++ b/tools/addpattern/Makefile
@@ -0,0 +1,4 @@
+include $(TOPDIR)/rules.mk
+
+all: addpattern.c
+ $(CC_FOR_BUILD) $(FLAGS_FOR_BUILD) -o ${STAGING_HOST_DIR}/usr/bin/addpattern addpattern.c
diff --git a/target/tools/addpattern/addpattern.c b/tools/addpattern/addpattern.c
index 8133bf26e..8133bf26e 100644
--- a/target/tools/addpattern/addpattern.c
+++ b/tools/addpattern/addpattern.c
diff --git a/tools/adk/Makefile b/tools/adk/Makefile
index 60a50ffba..edd559f85 100644
--- a/tools/adk/Makefile
+++ b/tools/adk/Makefile
@@ -3,15 +3,15 @@
include $(TOPDIR)/rules.mk
-install: ${BIN_DIR}/depmaker ${BIN_DIR}/pkgrebuild ${BIN_DIR}/dkgetsz
+install: ${STAGING_HOST_DIR}/usr/bin/depmaker ${STAGING_HOST_DIR}/usr/bin/pkgrebuild ${STAGING_HOST_DIR}/usr/bin/dkgetsz
-${BIN_DIR}/depmaker: depmaker.c
+${STAGING_HOST_DIR}/usr/bin/depmaker: depmaker.c
${CC_FOR_BUILD} ${FLAGS_FOR_BUILD} -o $@ depmaker.c
-${BIN_DIR}/pkgrebuild: pkgrebuild.c strmap.c
+${STAGING_HOST_DIR}/usr/bin/pkgrebuild: pkgrebuild.c strmap.c
${CC_FOR_BUILD} ${FLAGS_FOR_BUILD} -o $@ pkgrebuild.c strmap.c
-${BIN_DIR}/dkgetsz: dkgetsz.c
+${STAGING_HOST_DIR}/usr/bin/dkgetsz: dkgetsz.c
${CC_FOR_BUILD} ${FLAGS_FOR_BUILD} -o $@ dkgetsz.c
include $(TOPDIR)/mk/tools.mk
diff --git a/tools/bc/Makefile b/tools/bc/Makefile
index 8d1561049..bb3c40492 100644
--- a/tools/bc/Makefile
+++ b/tools/bc/Makefile
@@ -11,15 +11,15 @@ PKG_SITES:= http://ftp.gnu.org/pub/gnu/bc/
include ../rules.mk
-install: ${BIN_DIR}/bc
+install: ${STAGING_HOST_DIR}/usr/bin/bc
$(WRKBUILD)/.compiled: ${WRKDIST}/.prepared
(cd ${WRKBUILD}; ./configure)
${MAKE} -C ${WRKBUILD} CC='${CC_FOR_BUILD}'
touch $@
-${BIN_DIR}/bc: $(WRKBUILD)/.compiled
+${STAGING_HOST_DIR}/usr/bin/bc: $(WRKBUILD)/.compiled
$(INSTALL_BIN) $(WRKBUILD)/bc/bc \
- ${BIN_DIR}
+ ${STAGING_HOST_DIR}/usr/bin
include $(TOPDIR)/mk/tools.mk
diff --git a/tools/cdrtools/Makefile b/tools/cdrtools/Makefile
index 6ea90b821..6522b5760 100644
--- a/tools/cdrtools/Makefile
+++ b/tools/cdrtools/Makefile
@@ -11,15 +11,15 @@ PKG_SITES:= ftp://ftp.berlios.de/pub/cdrecord/
include ../rules.mk
-install: ${BIN_DIR}/mkisofs
+install: ${STAGING_HOST_DIR}/usr/bin/mkisofs
$(WRKBUILD)/.compiled: ${WRKDIST}/.prepared
#(cd ${WRKBUILD}; ./configure)
${MAKE} -C ${WRKBUILD} CC='${CC_FOR_BUILD}'
touch $@
-${BIN_DIR}/mkisofs: $(WRKBUILD)/.compiled
+${STAGING_HOST_DIR}/usr/bin/mkisofs: $(WRKBUILD)/.compiled
$(INSTALL_BIN) $(WRKBUILD)/mkisofs/OBJ/*/mkisofs \
- ${BIN_DIR}
+ ${STAGING_HOST_DIR}/usr/bin
include $(TOPDIR)/mk/tools.mk
diff --git a/tools/cpio/Makefile b/tools/cpio/Makefile
index 290eabc8b..ffccd1480 100644
--- a/tools/cpio/Makefile
+++ b/tools/cpio/Makefile
@@ -3,7 +3,7 @@
include $(TOPDIR)/rules.mk
-install: ${BIN_DIR}/cpio
+install: ${STAGING_HOST_DIR}/usr/bin/cpio
SRCS:= src/ib_open.c \
src/ib_close.c \
@@ -26,7 +26,7 @@ SRCS:= src/ib_open.c \
src/nonpax.c \
src/cpio.c
-${BIN_DIR}/cpio: ${SRCS}
+${STAGING_HOST_DIR}/usr/bin/cpio: ${SRCS}
${CC_FOR_BUILD} ${FLAGS_FOR_BUILD} -D_GNU_SOURCE -Isrc -o $@ $^
include $(TOPDIR)/mk/tools.mk
diff --git a/tools/genext2fs/Makefile b/tools/genext2fs/Makefile
index b19662941..07e24d028 100644
--- a/tools/genext2fs/Makefile
+++ b/tools/genext2fs/Makefile
@@ -11,15 +11,15 @@ PKG_SITES:= ${MASTER_SITE_SOURCEFORGE:=genext2fs/}
include ../rules.mk
-install: ${BIN_DIR}/genext2fs
+install: ${STAGING_HOST_DIR}/usr/bin/genext2fs
$(WRKBUILD)/.compiled: ${WRKDIST}/.prepared
(cd ${WRKBUILD}; ./configure)
${MAKE} -C ${WRKBUILD} CC='${CC_FOR_BUILD}'
touch $@
-${BIN_DIR}/genext2fs: $(WRKBUILD)/.compiled
+${STAGING_HOST_DIR}/usr/bin/genext2fs: $(WRKBUILD)/.compiled
$(INSTALL_BIN) $(WRKBUILD)/genext2fs \
- ${BIN_DIR}
+ ${STAGING_HOST_DIR}/usr/bin
include $(TOPDIR)/mk/tools.mk
diff --git a/tools/gperf/Makefile b/tools/gperf/Makefile
index 7b0d0af77..7f7d6466d 100644
--- a/tools/gperf/Makefile
+++ b/tools/gperf/Makefile
@@ -11,15 +11,15 @@ PKG_SITES:= http://ftp.gnu.org/pub/gnu/gperf/
include ../rules.mk
-install: ${BIN_DIR}/gperf
+install: ${STAGING_HOST_DIR}/usr/bin/gperf
$(WRKBUILD)/.compiled: ${WRKDIST}/.prepared
(cd ${WRKBUILD}; ./configure)
${MAKE} -C ${WRKBUILD} CC='${CC_FOR_BUILD}'
touch $@
-${BIN_DIR}/gperf: $(WRKBUILD)/.compiled
+${STAGING_HOST_DIR}/usr/bin/gperf: $(WRKBUILD)/.compiled
$(INSTALL_BIN) $(WRKBUILD)/src/gperf \
- ${BIN_DIR}
+ ${STAGING_HOST_DIR}/usr/bin
include $(TOPDIR)/mk/tools.mk
diff --git a/target/tools/lzma-loader/.svn/entries b/tools/lzma-loader/.svn/entries
index 2934ab892..2934ab892 100644
--- a/target/tools/lzma-loader/.svn/entries
+++ b/tools/lzma-loader/.svn/entries
diff --git a/target/tools/lzma-loader/.svn/text-base/LzmaDecode.c.svn-base b/tools/lzma-loader/.svn/text-base/LzmaDecode.c.svn-base
index 951700bdd..951700bdd 100644
--- a/target/tools/lzma-loader/.svn/text-base/LzmaDecode.c.svn-base
+++ b/tools/lzma-loader/.svn/text-base/LzmaDecode.c.svn-base
diff --git a/target/tools/lzma-loader/.svn/text-base/LzmaDecode.h.svn-base b/tools/lzma-loader/.svn/text-base/LzmaDecode.h.svn-base
index f58944e3c..f58944e3c 100644
--- a/target/tools/lzma-loader/.svn/text-base/LzmaDecode.h.svn-base
+++ b/tools/lzma-loader/.svn/text-base/LzmaDecode.h.svn-base
diff --git a/target/tools/lzma-loader/.svn/text-base/Makefile.svn-base b/tools/lzma-loader/.svn/text-base/Makefile.svn-base
index 3320e565d..3320e565d 100644
--- a/target/tools/lzma-loader/.svn/text-base/Makefile.svn-base
+++ b/tools/lzma-loader/.svn/text-base/Makefile.svn-base
diff --git a/target/tools/lzma-loader/.svn/text-base/README.svn-base b/tools/lzma-loader/.svn/text-base/README.svn-base
index 16649e950..16649e950 100644
--- a/target/tools/lzma-loader/.svn/text-base/README.svn-base
+++ b/tools/lzma-loader/.svn/text-base/README.svn-base
diff --git a/target/tools/lzma-loader/.svn/text-base/decompress.c.svn-base b/tools/lzma-loader/.svn/text-base/decompress.c.svn-base
index 05681b152..05681b152 100644
--- a/target/tools/lzma-loader/.svn/text-base/decompress.c.svn-base
+++ b/tools/lzma-loader/.svn/text-base/decompress.c.svn-base
diff --git a/target/tools/lzma-loader/.svn/text-base/decompress.lds.in.svn-base b/tools/lzma-loader/.svn/text-base/decompress.lds.in.svn-base
index 33f56f8a0..33f56f8a0 100644
--- a/target/tools/lzma-loader/.svn/text-base/decompress.lds.in.svn-base
+++ b/tools/lzma-loader/.svn/text-base/decompress.lds.in.svn-base
diff --git a/target/tools/lzma-loader/.svn/text-base/head.S.svn-base b/tools/lzma-loader/.svn/text-base/head.S.svn-base
index 3a33e4016..3a33e4016 100644
--- a/target/tools/lzma-loader/.svn/text-base/head.S.svn-base
+++ b/tools/lzma-loader/.svn/text-base/head.S.svn-base
diff --git a/target/tools/lzma-loader/.svn/text-base/loader.lds.in.svn-base b/tools/lzma-loader/.svn/text-base/loader.lds.in.svn-base
index 20f2ea98e..20f2ea98e 100644
--- a/target/tools/lzma-loader/.svn/text-base/loader.lds.in.svn-base
+++ b/tools/lzma-loader/.svn/text-base/loader.lds.in.svn-base
diff --git a/target/tools/lzma-loader/Makefile b/tools/lzma-loader/Makefile
index ad4a531b6..ad4a531b6 100644
--- a/target/tools/lzma-loader/Makefile
+++ b/tools/lzma-loader/Makefile
diff --git a/target/tools/lzma-loader/src/LzmaDecode.c b/tools/lzma-loader/src/LzmaDecode.c
index 951700bdd..951700bdd 100644
--- a/target/tools/lzma-loader/src/LzmaDecode.c
+++ b/tools/lzma-loader/src/LzmaDecode.c
diff --git a/target/tools/lzma-loader/src/LzmaDecode.h b/tools/lzma-loader/src/LzmaDecode.h
index f58944e3c..f58944e3c 100644
--- a/target/tools/lzma-loader/src/LzmaDecode.h
+++ b/tools/lzma-loader/src/LzmaDecode.h
diff --git a/target/tools/lzma-loader/src/LzmaDecode.o b/tools/lzma-loader/src/LzmaDecode.o
index 3d7be3f4d..3d7be3f4d 100644
--- a/target/tools/lzma-loader/src/LzmaDecode.o
+++ b/tools/lzma-loader/src/LzmaDecode.o
Binary files differ
diff --git a/target/tools/lzma-loader/src/Makefile b/tools/lzma-loader/src/Makefile
index f5d780c2b..f5d780c2b 100644
--- a/target/tools/lzma-loader/src/Makefile
+++ b/tools/lzma-loader/src/Makefile
diff --git a/target/tools/lzma-loader/src/README b/tools/lzma-loader/src/README
index 16649e950..16649e950 100644
--- a/target/tools/lzma-loader/src/README
+++ b/tools/lzma-loader/src/README
diff --git a/target/tools/lzma-loader/src/data.lds b/tools/lzma-loader/src/data.lds
index ec48b2dfd..ec48b2dfd 100644
--- a/target/tools/lzma-loader/src/data.lds
+++ b/tools/lzma-loader/src/data.lds
diff --git a/target/tools/lzma-loader/src/data.o b/tools/lzma-loader/src/data.o
index 3c398909f..3c398909f 100644
--- a/target/tools/lzma-loader/src/data.o
+++ b/tools/lzma-loader/src/data.o
Binary files differ
diff --git a/target/tools/lzma-loader/src/decompress b/tools/lzma-loader/src/decompress
index 9b2091e78..9b2091e78 100755
--- a/target/tools/lzma-loader/src/decompress
+++ b/tools/lzma-loader/src/decompress
Binary files differ
diff --git a/target/tools/lzma-loader/src/decompress.c b/tools/lzma-loader/src/decompress.c
index 05681b152..05681b152 100644
--- a/target/tools/lzma-loader/src/decompress.c
+++ b/tools/lzma-loader/src/decompress.c
diff --git a/target/tools/lzma-loader/src/decompress.image b/tools/lzma-loader/src/decompress.image
index b0cb1af95..b0cb1af95 100755
--- a/target/tools/lzma-loader/src/decompress.image
+++ b/tools/lzma-loader/src/decompress.image
Binary files differ
diff --git a/target/tools/lzma-loader/src/decompress.lds b/tools/lzma-loader/src/decompress.lds
index 7da944d0c..7da944d0c 100644
--- a/target/tools/lzma-loader/src/decompress.lds
+++ b/tools/lzma-loader/src/decompress.lds
diff --git a/target/tools/lzma-loader/src/decompress.lds.in b/tools/lzma-loader/src/decompress.lds.in
index 33f56f8a0..33f56f8a0 100644
--- a/target/tools/lzma-loader/src/decompress.lds.in
+++ b/tools/lzma-loader/src/decompress.lds.in
diff --git a/target/tools/lzma-loader/src/decompress.o b/tools/lzma-loader/src/decompress.o
index 483bc0b32..483bc0b32 100644
--- a/target/tools/lzma-loader/src/decompress.o
+++ b/tools/lzma-loader/src/decompress.o
Binary files differ
diff --git a/target/tools/lzma-loader/src/head.S b/tools/lzma-loader/src/head.S
index 3a33e4016..3a33e4016 100644
--- a/target/tools/lzma-loader/src/head.S
+++ b/tools/lzma-loader/src/head.S
diff --git a/target/tools/lzma-loader/src/head.o b/tools/lzma-loader/src/head.o
index 04763fa4b..04763fa4b 100644
--- a/target/tools/lzma-loader/src/head.o
+++ b/tools/lzma-loader/src/head.o
Binary files differ
diff --git a/target/tools/lzma-loader/src/loader b/tools/lzma-loader/src/loader
index 871117b87..871117b87 100755
--- a/target/tools/lzma-loader/src/loader
+++ b/tools/lzma-loader/src/loader
Binary files differ
diff --git a/target/tools/lzma-loader/src/loader.elf b/tools/lzma-loader/src/loader.elf
index 0633a0e77..0633a0e77 100755
--- a/target/tools/lzma-loader/src/loader.elf
+++ b/tools/lzma-loader/src/loader.elf
Binary files differ
diff --git a/target/tools/lzma-loader/src/loader.gz b/tools/lzma-loader/src/loader.gz
index 426c9295e..426c9295e 100644
--- a/target/tools/lzma-loader/src/loader.gz
+++ b/tools/lzma-loader/src/loader.gz
Binary files differ
diff --git a/target/tools/lzma-loader/src/loader.lds b/tools/lzma-loader/src/loader.lds
index 9d95adbfa..9d95adbfa 100644
--- a/target/tools/lzma-loader/src/loader.lds
+++ b/tools/lzma-loader/src/loader.lds
diff --git a/target/tools/lzma-loader/src/loader.lds.in b/tools/lzma-loader/src/loader.lds.in
index 20f2ea98e..20f2ea98e 100644
--- a/target/tools/lzma-loader/src/loader.lds.in
+++ b/tools/lzma-loader/src/loader.lds.in
diff --git a/target/tools/lzma-loader/src/loader.o b/tools/lzma-loader/src/loader.o
index 0633a0e77..0633a0e77 100755
--- a/target/tools/lzma-loader/src/loader.o
+++ b/tools/lzma-loader/src/loader.o
Binary files differ
diff --git a/target/tools/lzma/Makefile b/tools/lzma/Makefile
index 23cbc7f73..3ca257783 100644
--- a/target/tools/lzma/Makefile
+++ b/tools/lzma/Makefile
@@ -10,11 +10,10 @@ PKG_MD5SUM:= 434e51a018b4c8ef377bf81520a53af0
PKG_SITES:= http://downloads.openwrt.org/sources/
DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
-#WRKDIST= ${WRKDIR}/$(PKG_NAME)${PKG_VERSION}
include ../rules.mk
-all: ${STAGING_HOST_DIR}/bin/lzma
+install: ${STAGING_HOST_DIR}/usr/bin/lzma
UTIL_DIR=$(WRKBUILD)/C/LzmaUtil
ALONE_DIR=$(WRKBUILD)/CPP/7zip/Compress/LZMA_Alone
@@ -24,8 +23,8 @@ $(WRKBUILD)/.compiled: ${WRKDIST}/.prepared
$(MAKE) -C $(ALONE_DIR) -f makefile.gcc
touch $@
-${STAGING_HOST_DIR}/bin/lzma: $(WRKBUILD)/.compiled
+${STAGING_HOST_DIR}/usr/bin/lzma: $(WRKBUILD)/.compiled
$(INSTALL_BIN) $(WRKBUILD)/CPP/7zip/Compress/LZMA_Alone/lzma_alone \
- $(STAGING_DIR)/bin/lzma
+ $(STAGING_DIR)/usr/bin/lzma
include $(TOPDIR)/mk/tools.mk
diff --git a/target/tools/lzma/patches/001-large_files.patch b/tools/lzma/patches/001-large_files.patch
index b95fe9e90..b95fe9e90 100644
--- a/target/tools/lzma/patches/001-large_files.patch
+++ b/tools/lzma/patches/001-large_files.patch
diff --git a/target/tools/lzma/patches/002-lzmp.patch b/tools/lzma/patches/002-lzmp.patch
index 72d881cdb..72d881cdb 100644
--- a/target/tools/lzma/patches/002-lzmp.patch
+++ b/tools/lzma/patches/002-lzmp.patch
diff --git a/target/tools/lzma/patches/003-compile_fixes.patch b/tools/lzma/patches/003-compile_fixes.patch
index 49ae66b9c..49ae66b9c 100644
--- a/target/tools/lzma/patches/003-compile_fixes.patch
+++ b/tools/lzma/patches/003-compile_fixes.patch
diff --git a/target/tools/lzma/patches/100-static_library.patch b/tools/lzma/patches/100-static_library.patch
index 15ab4e055..15ab4e055 100644
--- a/target/tools/lzma/patches/100-static_library.patch
+++ b/tools/lzma/patches/100-static_library.patch
diff --git a/tools/mkcrypt/Makefile b/tools/mkcrypt/Makefile
index c36ec2a5a..089c6ad7b 100644
--- a/tools/mkcrypt/Makefile
+++ b/tools/mkcrypt/Makefile
@@ -3,9 +3,9 @@
include $(TOPDIR)/rules.mk
-install: ${BIN_DIR}/mkcrypt
+install: ${STAGING_HOST_DIR}/usr/bin/mkcrypt
-${BIN_DIR}/mkcrypt:
+${STAGING_HOST_DIR}/usr/bin/mkcrypt:
$(CC_FOR_BUILD) ${FLAGS_FOR_BUILD} -o $@ mkcrypt.c
include $(TOPDIR)/mk/tools.mk
diff --git a/tools/mkfimage/Makefile b/tools/mkfimage/Makefile
new file mode 100644
index 000000000..195614f2b
--- /dev/null
+++ b/tools/mkfimage/Makefile
@@ -0,0 +1,4 @@
+include $(TOPDIR)/rules.mk
+
+all: mkfimage.c
+ $(CC_FOR_BUILD) ${FLAGS_FOR_BUILD} -o ${STAGING_HOST_DIR}/usr/bin/mkfimage mkfimage.c $(MAKE_TRACE)
diff --git a/target/tools/mkfimage/mkfimage.c b/tools/mkfimage/mkfimage.c
index b1897fbd7..b1897fbd7 100644
--- a/target/tools/mkfimage/mkfimage.c
+++ b/tools/mkfimage/mkfimage.c
diff --git a/tools/mkimage/Makefile b/tools/mkimage/Makefile
index 66d058370..db2e42c3f 100644
--- a/tools/mkimage/Makefile
+++ b/tools/mkimage/Makefile
@@ -3,9 +3,9 @@
include $(TOPDIR)/rules.mk
-install: ${BIN_DIR}/mkimage
+install: ${STAGING_HOST_DIR}/usr/bin/mkimage
-${BIN_DIR}/mkimage: mkimage.c crc32.c
+${STAGING_HOST_DIR}/usr/bin/mkimage: mkimage.c crc32.c
$(CC_FOR_BUILD) ${FLAGS_FOR_BUILD} -o $@ mkimage.c crc32.c
include $(TOPDIR)/mk/tools.mk
diff --git a/target/tools/mtd-utils/Makefile b/tools/mtd-utils/Makefile
index 38f10de69..0152a41ac 100644
--- a/target/tools/mtd-utils/Makefile
+++ b/tools/mtd-utils/Makefile
@@ -11,14 +11,14 @@ PKG_SITES:= http://openadk.org/distfiles/
include ../rules.mk
-all: ${STAGING_HOST_DIR}/bin/mkfs.jffs2
+install: ${STAGING_HOST_DIR}/usr/bin/mkfs.jffs2
$(WRKBUILD)/.compiled: ${WRKDIST}/.prepared
${MAKE} -C ${WRKBUILD} CC='${CC_FOR_BUILD}' CPPFLAGS='-DWITHOUT_XATTR=1 -I./include'
touch $@
-${STAGING_HOST_DIR}/bin/mkfs.jffs2: $(WRKBUILD)/.compiled
+${STAGING_HOST_DIR}/usr/bin/mkfs.jffs2: $(WRKBUILD)/.compiled
$(INSTALL_BIN) $(WRKBUILD)/mkfs.jffs2 \
- ${STAGING_HOST_DIR}/bin
+ ${STAGING_HOST_DIR}/usr/bin
include $(TOPDIR)/mk/tools.mk
diff --git a/target/tools/mtd-utils/patches/lzo.patch b/tools/mtd-utils/patches/lzo.patch
index 52f16146c..52f16146c 100644
--- a/target/tools/mtd-utils/patches/lzo.patch
+++ b/tools/mtd-utils/patches/lzo.patch
diff --git a/target/tools/squashfs/Makefile b/tools/squashfs/Makefile
index 94b3a0115..423008ff8 100644
--- a/target/tools/squashfs/Makefile
+++ b/tools/squashfs/Makefile
@@ -14,16 +14,16 @@ WRKDIST= ${WRKDIR}/$(PKG_NAME)${PKG_VERSION}
include ../rules.mk
-all: ${STAGING_HOST_DIR}/bin/mksquashfs
+install: ${STAGING_HOST_DIR}/usr/bin/mksquashfs
$(WRKBUILD)/.compiled: ${WRKDIST}/.prepared
${MAKE} -C ${WRKBUILD}/squashfs-tools CC='${CC_FOR_BUILD}' \
XZ_SUPPORT=1 CPPFLAGS_FOR_BUILD=$(CPPFLAGS_FOR_BUILD) \
EXTRA_LDFLAGS=$(LDFLAGS_FOR_BUILD)
- touch $@
+ @touch $@
-${STAGING_HOST_DIR}/bin/mksquashfs: $(WRKBUILD)/.compiled
+${STAGING_HOST_DIR}/usr/bin/mksquashfs: $(WRKBUILD)/.compiled
$(INSTALL_BIN) $(WRKBUILD)/squashfs-tools/mksquashfs \
- ${STAGING_HOST_DIR}/bin
+ ${STAGING_HOST_DIR}/usr/bin
include $(TOPDIR)/mk/tools.mk
diff --git a/target/tools/squashfs/patches/cppflags.patch b/tools/squashfs/patches/cppflags.patch
index 1432ea3cf..1432ea3cf 100644
--- a/target/tools/squashfs/patches/cppflags.patch
+++ b/tools/squashfs/patches/cppflags.patch
diff --git a/tools/srec2bin/Makefile b/tools/srec2bin/Makefile
new file mode 100644
index 000000000..01021c8ff
--- /dev/null
+++ b/tools/srec2bin/Makefile
@@ -0,0 +1,4 @@
+include $(TOPDIR)/rules.mk
+
+all: srec2bin.c
+ $(CC_FOR_BUILD) $(FLAGS_FOR_BUILD) -o ${STAGING_HOST_DIR}/usr/bin/srec2bin srec2bin.c
diff --git a/target/tools/srec2bin/srec2bin.c b/tools/srec2bin/srec2bin.c
index 8ba4387e6..8ba4387e6 100644
--- a/target/tools/srec2bin/srec2bin.c
+++ b/tools/srec2bin/srec2bin.c
diff --git a/tools/syslinux/Makefile b/tools/syslinux/Makefile
index 5543813d5..1344538d1 100644
--- a/tools/syslinux/Makefile
+++ b/tools/syslinux/Makefile
@@ -12,27 +12,26 @@ PKG_SITES:= http://www.kernel.org/pub/linux/utils/boot/syslinux/
include ../rules.mk
WRKINST:= ${WRKBUILD}/openadk_installroot
-install: ${BIN_DIR}/extlinux ${STAGING_HOST_DIR}/usr/share/syslinux/.installed
+install: ${STAGING_HOST_DIR}/usr/bin/extlinux ${STAGING_HOST_DIR}/usr/share/syslinux/.installed
$(WRKBUILD)/.compiled: ${WRKDIST}/.prepared
- #(cd ${WRKBUILD}; ./configure)
${MAKE} -C ${WRKBUILD} CC='${CC_FOR_BUILD}' bios installer
- touch $@
+ @touch $@
$(WRKBUILD)/.installed: ${WRKBUILD}/.compiled
mkdir -p ${WRKINST}
${MAKE} -C ${WRKBUILD} CC='${CC_FOR_BUILD}' \
INSTALLROOT='${WRKINST}' \
bios install
- touch $@
+ @touch $@
-${BIN_DIR}/extlinux: $(WRKBUILD)/.installed
+${STAGING_HOST_DIR}/usr/bin/extlinux: $(WRKBUILD)/.installed
$(INSTALL_BIN) ${WRKINST}/sbin/extlinux \
- ${BIN_DIR}
+ ${STAGING_HOST_DIR}/usr/bin
${STAGING_HOST_DIR}/usr/share/syslinux/.installed: ${WRKBUILD}/.installed
mkdir -p ${STAGING_HOST_DIR}/usr/share
${CP} ${WRKINST}/usr/share/syslinux ${STAGING_HOST_DIR}/usr/share
- touch ${STAGING_HOST_DIR}/usr/share/syslinux/.installed
+ @touch ${STAGING_HOST_DIR}/usr/share/syslinux/.installed
include $(TOPDIR)/mk/tools.mk
diff --git a/tools/trx/Makefile b/tools/trx/Makefile
new file mode 100644
index 000000000..25e2b02db
--- /dev/null
+++ b/tools/trx/Makefile
@@ -0,0 +1,4 @@
+include $(TOPDIR)/rules.mk
+
+all: trx.c
+ $(CC_FOR_BUILD) $(FLAGS_FOR_BUILD) -o ${STAGING_HOST_DIR}/usr/bin/trx trx.c
diff --git a/target/tools/trx/trx.c b/tools/trx/trx.c
index 9e4d521ca..9e4d521ca 100644
--- a/target/tools/trx/trx.c
+++ b/tools/trx/trx.c
diff --git a/target/tools/xz/Makefile b/tools/xz/Makefile
index 6cefbb476..fa4c51f92 100644
--- a/target/tools/xz/Makefile
+++ b/tools/xz/Makefile
@@ -11,18 +11,18 @@ PKG_SITES:= http://tukaani.org/xz/
include ../rules.mk
-all: $(WRKBUILD)/.installed
+install: $(WRKBUILD)/.installed
$(WRKBUILD)/.configured: ${WRKDIST}/.prepared
(cd ${WRKBUILD}; ./configure --prefix=$(STAGING_HOST_DIR)/usr)
- touch $@
+ @touch $@
$(WRKBUILD)/.compiled: $(WRKBUILD)/.configured
${MAKE} -C ${WRKBUILD}
- touch $@
+ @touch $@
$(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
${MAKE} -C ${WRKBUILD} install
- touch $@
+ @touch $@
include $(TOPDIR)/mk/tools.mk