summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2014-03-08 18:31:42 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2014-03-08 18:31:42 +0100
commited3d91cf2dfc6f63ae749b54c7d718eb73dd6211 (patch)
tree1b2ea8ee4b80c2e2e8c28a65a41cb90648d571ca /mk
parent3fe732e577313be28abbb99a636779a9debe400c (diff)
parentbd228e8c35627f71a4a15a05424dbd178fcb31e8 (diff)
Merge branch 'master' of git+ssh://openadk.org/git/openadk
Diffstat (limited to 'mk')
-rw-r--r--mk/build.mk2
-rw-r--r--mk/fetch.mk4
-rw-r--r--mk/image.mk6
-rw-r--r--mk/vars.mk48
4 files changed, 37 insertions, 23 deletions
diff --git a/mk/build.mk b/mk/build.mk
index 62366cbad..8a77a1bfe 100644
--- a/mk/build.mk
+++ b/mk/build.mk
@@ -143,7 +143,7 @@ ${TOPDIR}/package/Depends.mk: ${TOPDIR}/.config $(wildcard ${TOPDIR}/package/*/M
.PHONY: all world clean cleantarget cleandir cleantoolchain distclean image_clean
world:
- mkdir -p $(DISTDIR) $(BUILD_DIR) $(TARGET_DIR) $(FW_DIR) \
+ mkdir -p $(DL_DIR) $(BUILD_DIR) $(TARGET_DIR) $(FW_DIR) \
$(PACKAGE_DIR) $(TOOLS_BUILD_DIR) $(STAGING_HOST_DIR)/usr/bin \
$(TOOLCHAIN_BUILD_DIR) $(STAGING_PKG_DIR)/stamps
${BASH} ${TOPDIR}/scripts/scan-pkgs.sh
diff --git a/mk/fetch.mk b/mk/fetch.mk
index a2590d467..6382571b3 100644
--- a/mk/fetch.mk
+++ b/mk/fetch.mk
@@ -2,9 +2,9 @@
# material, please see the LICENCE file in the top-level directory.
ifneq ($(strip ${DIST_SUBDIR}),)
-FULLDISTDIR?= ${DISTDIR}/${DIST_SUBDIR}
+FULLDISTDIR?= ${DL_DIR}/${DIST_SUBDIR}
else
-FULLDISTDIR?= ${DISTDIR}
+FULLDISTDIR?= ${DL_DIR}
endif
FULLDISTFILES= $(patsubst %,${FULLDISTDIR}/%,${DISTFILES})
diff --git a/mk/image.mk b/mk/image.mk
index ec61ff374..6721549b5 100644
--- a/mk/image.mk
+++ b/mk/image.mk
@@ -47,11 +47,10 @@ image-prepare-post:
mkfontdir ${TARGET_DIR}/usr/share/fonts/X11/$${i}; \
done; \
fi
- sed -i '/^root:/s!:/bin/sh$$!:${ROOTSH}!' ${TARGET_DIR}/etc/passwd
+ $(SED) '/^root:/s!:/bin/sh$$!:${ROOTSH}!' ${TARGET_DIR}/etc/passwd
-rm -f ${TARGET_DIR}/bin/sh
ln -sf ${BINSH} ${TARGET_DIR}/bin/sh
ifeq ($(ADK_LINUX_X86_64),y)
-ifneq ($(ADK_TARGET_ABI_X32),y)
# fixup lib dirs
mv ${TARGET_DIR}/lib/* ${TARGET_DIR}/${ADK_TARGET_LIBC_PATH}
rm -rf ${TARGET_DIR}/lib/
@@ -61,7 +60,6 @@ ifneq ($(ADK_TARGET_ABI_X32),y)
rm -rf ${TARGET_DIR}/usr/lib/
(cd ${TARGET_DIR}/usr ; ln -sf ${ADK_TARGET_LIBC_PATH} lib)
endif
-endif
ifeq ($(ADK_LINUX_PPC64),y)
# fixup lib dirs
mv ${TARGET_DIR}/lib/* ${TARGET_DIR}/${ADK_TARGET_LIBC_PATH}
@@ -173,7 +171,7 @@ ${FW_DIR}/${ROOTFSJFFS2}: ${TARGET_DIR}
--pad=$(ADK_TARGET_MTD_SIZE) -o ${FW_DIR}/${ROOTFSJFFS2} $(MAKE_TRACE)
createinitramfs: ${STAGING_TARGET_DIR}/${INITRAMFS}_list
- ${SED} 's/.*CONFIG_(BLK_DEV_INITRD|INITRAMFS_SOURCE|INITRAMFS_COMPRESSION).*//' \
+ ${SED} 's/.*CONFIG_\(RD_\|XZ_\|BLK_DEV_INITRD\|INITRAMFS_\).*//' \
${LINUX_DIR}/.config
( \
echo "CONFIG_BLK_DEV_INITRD=y"; \
diff --git a/mk/vars.mk b/mk/vars.mk
index 8f3022634..01120b005 100644
--- a/mk/vars.mk
+++ b/mk/vars.mk
@@ -10,40 +10,56 @@ MAKEFLAGS= $(EXTRA_MAKEFLAGS)
BUILD_USER= $(shell id -un)
BUILD_GROUP= $(shell id -gn)
+# some global dirs
BASE_DIR:= $(TOPDIR)
-DISTDIR?= ${BASE_DIR}/dl
-BUILD_DIR:= ${BASE_DIR}/build_${ADK_TARGET_SYSTEM}_${CPU_ARCH}_${ADK_TARGET_LIBC}
+ifeq ($(ADK_DL_DIR),)
+DL_DIR?= $(BASE_DIR)/dl
+else
+DL_DIR?= $(ADK_DL_DIR)
+endif
+TOOLS_BUILD_DIR= $(BASE_DIR)/tools_build
+SCRIPT_DIR:= $(BASE_DIR)/scripts
+STAGING_HOST_DIR:= ${BASE_DIR}/host_${GNU_HOST_NAME}
+
+# PFX dirs for cleandir
+FW_DIR_PFX:= $(BASE_DIR)/firmware
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_${GNU_HOST_NAME}
+STAGING_TARGET_DIR_PFX:=${BASE_DIR}/target_*
+TOOLCHAIN_BUILD_DIR_PFX=$(BASE_DIR)/toolchain_build_*
STAGING_HOST_DIR_PFX:= ${BASE_DIR}/host_*
+TARGET_DIR_PFX:= $(BASE_DIR)/root_*
+
ifeq ($(ADK_TARGET_ABI),)
+TARGET_DIR:= $(BASE_DIR)/root_${ADK_TARGET_SYSTEM}_${CPU_ARCH}_${ADK_TARGET_LIBC}
+FW_DIR:= $(BASE_DIR)/firmware/${ADK_TARGET_SYSTEM}_${CPU_ARCH}_${ADK_TARGET_LIBC}
+BUILD_DIR:= ${BASE_DIR}/build_${ADK_TARGET_SYSTEM}_${CPU_ARCH}_${ADK_TARGET_LIBC}
STAGING_TARGET_DIR:= ${BASE_DIR}/target_${CPU_ARCH}_${ADK_TARGET_LIBC}
STAGING_DIR:= ${BASE_DIR}/target_${CPU_ARCH}_${ADK_TARGET_LIBC}
+STAGING_PKG_DIR:= ${BASE_DIR}/pkg_${ADK_TARGET_SYSTEM}_${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
+TARGET_DIR:= $(BASE_DIR)/root_${ADK_TARGET_SYSTEM}_${CPU_ARCH}_${ADK_TARGET_LIBC}_${ADK_TARGET_ABI}
+FW_DIR:= $(BASE_DIR)/firmware/${ADK_TARGET_SYSTEM}_${CPU_ARCH}_${ADK_TARGET_LIBC}_${ADK_TARGET_ABI}
+BUILD_DIR:= ${BASE_DIR}/build_${ADK_TARGET_SYSTEM}_${CPU_ARCH}_${ADK_TARGET_LIBC}_${ADK_TARGET_ABI}
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_PKG_DIR:= ${BASE_DIR}/pkg_${ADK_TARGET_SYSTEM}_${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
-STAGING_TARGET_DIR_PFX:=${BASE_DIR}/target_*
-TOOLCHAIN_BUILD_DIR_PFX=$(BASE_DIR)/toolchain_build_*
-TOOLS_BUILD_DIR= $(BASE_DIR)/tools_build
-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_*
+SCRIPT_TARGET_DIR:= ${STAGING_TARGET_DIR}/scripts
+
+# PATH variables
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}
+
ifeq ($(ADK_TARGET_ABI_X32),y)
-GNU_TARGET_NAME= $(CPU_ARCH)-x32-linux
+GNU_TARGET_NAME= $(CPU_ARCH)-x32-linux-$(ADK_TARGET_SUFFIX)
else
GNU_TARGET_NAME= $(CPU_ARCH)-$(ADK_VENDOR)-linux-$(ADK_TARGET_SUFFIX)
endif
@@ -133,9 +149,9 @@ LDFLAGS_FOR_BUILD?= -L$(STAGING_HOST_DIR)/usr/lib
FLAGS_FOR_BUILD= ${CPPFLAGS_FOR_BUILD} ${CFLAGS_FOR_BUILD} ${LDFLAGS_FOR_BUILD}
PATCH= ${BASH} $(SCRIPT_DIR)/patch.sh
-SED:= sed -i -e
+SED:= PATH=${HOST_PATH} sed -i -e
LINUX_DIR:= $(BUILD_DIR)/linux
-KERNEL_MODULE_FLAGS:= ARCH=${ARCH} KERNELVERSION="2.6" \
+KERNEL_MODULE_FLAGS:= ARCH=${ARCH} \
KERNEL_PATH=${LINUX_DIR} KERNELDIR=${LINUX_DIR} KERNEL_DIR=${LINUX_DIR} \
PREFIX=/usr CROSS_COMPILE="${TARGET_CROSS}" \
LDFLAGS="$(ADK_TARGET_KERNEL_LDFLAGS)" CFLAGS_MODULE="-fhonour-copts" V=1