summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2009-05-27 22:14:21 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2009-05-27 22:14:21 +0200
commitbbd610f15a71b27c955175cb98392b114717fd47 (patch)
tree13d196e0e70c15c119336f59fa8f7183884590d5 /mk
parentbad63eb735b13e1f009a19af1dd810f7279c2ba1 (diff)
native build support
- just use native gcc and binutils to compile a system - can be used to chroot into it - maybe useful later on lemote book to build packages natively
Diffstat (limited to 'mk')
-rw-r--r--mk/build.mk8
-rw-r--r--mk/kernel-build.mk12
-rw-r--r--mk/package.mk11
-rw-r--r--mk/vars.mk4
4 files changed, 33 insertions, 2 deletions
diff --git a/mk/build.mk b/mk/build.mk
index 79406bf9f..ef40ec962 100644
--- a/mk/build.mk
+++ b/mk/build.mk
@@ -18,8 +18,8 @@ noconfig_targets:= menuconfig \
_mconfig \
tags
-MAKECLEAN_SYMBOLS= ADK_TARGET_LIB_UCLIBC ADK_TARGET_LIB_GLIBC ADK_SSP ADK_IPV6 ADK_CXX \
- ADK_DEBUG
+MAKECLEAN_SYMBOLS= ADK_TARGET_LIB_UCLIBC ADK_TARGET_LIB_GLIBC ADK_SSP \
+ ADK_IPV6 ADK_CXX ADK_DEBUG
POSTCONFIG= -@\
if [ -f .config.old ];then \
if [ -d .cfg ];then \
@@ -57,7 +57,11 @@ all: world
world: $(DISTDIR) $(BUILD_DIR) $(TARGET_DIR) $(PACKAGE_DIR) ${TOPDIR}/.cfg/ADK_HAVE_DOT_CONFIG
${BASH} ${TOPDIR}/scripts/scan-pkgs.sh
+ifeq ($(ADK_NATIVE),y)
+ $(MAKE) -f mk/build.mk toolchain/kernel-headers-prepare target/config-prepare target/compile package/compile root_clean package/install package_index target/install
+else
$(MAKE) -f mk/build.mk toolchain/install target/config-prepare target/compile package/compile root_clean package/install package_index target/install
+endif
package_index:
-cd ${PACKAGE_DIR} && \
diff --git a/mk/kernel-build.mk b/mk/kernel-build.mk
index 02990c250..f1ed65f57 100644
--- a/mk/kernel-build.mk
+++ b/mk/kernel-build.mk
@@ -26,16 +26,28 @@ $(LINUX_DIR)/.config: $(LINUX_DIR)/.prepared $(BUILD_DIR)/.kernelconfig
$(TRACE) target/$(DEVICE)-kernel-configure
for f in $(TARGETS);do if [ -f $$f ];then rm $$f;fi;done $(MAKE_TRACE)
$(CP) $(BUILD_DIR)/.kernelconfig $(LINUX_DIR)/.config
+ifeq ($(ADK_NATIVE),y)
+ echo N | $(MAKE) -C $(LINUX_DIR) oldconfig $(MAKE_TRACE)
+ $(MAKE) -C $(LINUX_DIR) V=1 prepare scripts $(MAKE_TRACE)
+else
echo N | $(MAKE) -C $(LINUX_DIR) CROSS_COMPILE="$(KERNEL_CROSS)" ARCH=$(ARCH) CC="$(TARGET_CC)" oldconfig $(MAKE_TRACE)
$(MAKE) -C $(LINUX_DIR) V=1 CROSS_COMPILE="$(KERNEL_CROSS)" ARCH=$(ARCH) CC="$(TARGET_CC)" prepare scripts $(MAKE_TRACE)
+endif
touch -c $(LINUX_DIR)/.config
$(LINUX_DIR)/vmlinux: $(LINUX_DIR)/.config
$(TRACE) target/$(DEVICE)-kernel-compile
+ifeq ($(ADK_NATIVE),y)
+ $(MAKE) -C $(LINUX_DIR) V=1 $(MAKE_TRACE)
+ $(TRACE) target/$(DEVICE)-kernel-modules-install
+ rm -rf $(LINUX_BUILD_DIR)/modules
+ $(MAKE) -C "$(LINUX_DIR)" V=1 DEPMOD=true INSTALL_MOD_PATH=$(LINUX_BUILD_DIR)/modules modules_install $(MAKE_TRACE)
+else
$(MAKE) -C $(LINUX_DIR) V=1 CROSS_COMPILE="$(KERNEL_CROSS)" ARCH=$(ARCH) CC="$(TARGET_CC)" $(MAKE_TRACE)
$(TRACE) target/$(DEVICE)-kernel-modules-install
rm -rf $(LINUX_BUILD_DIR)/modules
$(MAKE) -C "$(LINUX_DIR)" V=1 CROSS_COMPILE="$(KERNEL_CROSS)" ARCH=$(ARCH) DEPMOD=true INSTALL_MOD_PATH=$(LINUX_BUILD_DIR)/modules modules_install $(MAKE_TRACE)
+endif
$(TRACE) target/$(DEVICE)-create-packages
$(MAKE) $(KERNEL_IPKG) $(TARGETS)
touch -c $(LINUX_DIR)/vmlinux
diff --git a/mk/package.mk b/mk/package.mk
index e359a6f7c..03e07e2ed 100644
--- a/mk/package.mk
+++ b/mk/package.mk
@@ -24,6 +24,10 @@ CONFIGURE_ARGS+= --enable-ipv6
else
CONFIGURE_ARGS+= --disable-ipv6
endif
+
+ifeq ($(ADK_NATIVE),y)
+ CONFIG_SHELL='$(strip ${SHELL})'
+else
CONFIGURE_ENV+= ${TARGET_CONFIGURE_OPTS} \
${HOST_CONFIGURE_OPTS} \
CC='${TARGET_CC}' CXX='${TARGET_CXX}' \
@@ -36,6 +40,7 @@ CONFIGURE_ENV+= ${TARGET_CONFIGURE_OPTS} \
CONFIG_SHELL='$(strip ${SHELL})' \
ac_cv_func_realloc_0_nonnull=yes \
ac_cv_func_malloc_0_nonnull=yes
+endif
MAKE_FILE?= Makefile
# this is environment for 'make all' and 'make install'
MAKE_ENV?=
@@ -47,6 +52,11 @@ MAKE_FLAGS?=
FAKE_FLAGS?=
ALL_TARGET?= all
INSTALL_TARGET?= install
+ifeq ($(ADK_NATIVE),y)
+MAKE_ENV+= \
+ WRKDIR='${WRKDIR}' WRKDIST='${WRKDIST}' \
+ WRKSRC='${WRKSRC}' WRKBUILD='${WRKBUILD}'
+else
MAKE_ENV+= PATH='${TARGET_PATH}' \
${HOST_CONFIGURE_OPTS} \
WRKDIR='${WRKDIR}' WRKDIST='${WRKDIST}' \
@@ -60,6 +70,7 @@ MAKE_ENV+= PATH='${TARGET_PATH}' \
CXXFLAGS='$(strip ${TCXXFLAGS})' \
CPPFLAGS='$(strip ${TCPPFLAGS})' \
LDFLAGS='$(strip ${TLDFLAGS})'
+endif
MAKE_FLAGS+= ${XAKE_FLAGS}
FAKE_FLAGS+= ${XAKE_FLAGS}
diff --git a/mk/vars.mk b/mk/vars.mk
index f9e8798d6..5532cb07f 100644
--- a/mk/vars.mk
+++ b/mk/vars.mk
@@ -86,7 +86,11 @@ IPKG:= IPKG_TMP=$(BUILD_DIR)/tmp \
${BASH} ${SCRIPT_DIR}/ipkg -force-defaults -force-depends
IPKG_STATE_DIR:= $(TARGET_DIR)/usr/lib/ipkg
+ifeq ($(ADK_NATIVE),y)
+RSTRIP:= prefix=' ' ${BASH} ${SCRIPT_DIR}/rstrip.sh
+else
RSTRIP:= prefix='${TARGET_CROSS}' ${BASH} ${SCRIPT_DIR}/rstrip.sh
+endif
EXTRACT_CMD= mkdir -p ${WRKDIR}; \
cd ${WRKDIR} && \