summaryrefslogtreecommitdiff
path: root/toolchain/uclibc-ng/Makefile
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2015-12-02 08:51:13 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2015-12-02 08:53:47 +0100
commitf06aece697aeab98f44c6ad0017e87e36c8ae764 (patch)
tree2dbfa60819b6fae3358eb997d41826940424f4c7 /toolchain/uclibc-ng/Makefile
parentfcfd8fdbd759d500a5b585e58fade1bd74801c49 (diff)
simplify toolchain building
Buildroot uses the two-stage mechanism since a while. This reduces the build time a lot. Instead of three stages, we just use the two-stage build. The benefit is that the C library do not need to be rebuild and one gcc compile is obsolete. Tested with embedded-test.sh. There is one unresolved problem, tile toolchain building is broken.
Diffstat (limited to 'toolchain/uclibc-ng/Makefile')
-rw-r--r--toolchain/uclibc-ng/Makefile47
1 files changed, 10 insertions, 37 deletions
diff --git a/toolchain/uclibc-ng/Makefile b/toolchain/uclibc-ng/Makefile
index 53ee55a75..5a6442952 100644
--- a/toolchain/uclibc-ng/Makefile
+++ b/toolchain/uclibc-ng/Makefile
@@ -8,6 +8,7 @@ include ../rules.mk
include Makefile.inc
include ${ADK_TOPDIR}/mk/buildhlp.mk
+# disable LTO
TARGET_CFLAGS:=$(filter-out -flto,$(TARGET_CFLAGS))
# handled by uClibc-ng makefiles
TARGET_CFLAGS:=$(filter-out -fstack-protector-all,$(TARGET_CFLAGS))
@@ -35,7 +36,7 @@ ifeq (${ADK_MAKE_PARALLEL},y)
UCLIBC_MAKEOPTS+= -j${ADK_MAKE_JOBS}
endif
-$(WRKBUILD)/.headers:
+$(WRKBUILD)/.configured: $(WRKBUILD)/.prepared
$(SED) 's,^CROSS_COMPILE=.*,CROSS_COMPILE=$(TARGET_CROSS),g' $(WRKBUILD)/Rules.mak
ifeq ($(ADK_TARGET_LIB_UCLIBC_NG_GIT),y)
PATH='$(HOST_PATH)' sed -e 's^KERNEL_HEADERS.*$$KERNEL_HEADERS=\"${STAGING_TARGET_DIR}/usr/include\"' \
@@ -277,7 +278,7 @@ ifeq ($(ADK_TARGET_ABI_O32),y)
$(SED) 's/.*\(CONFIG_MIPS_N64_ABI\).*/# \1 is not set/' ${WRKBUILD}/.config
endif
endif
- echo N|PATH='$(HOST_PATH)' $(MAKE) ${UCLIBC_MAKEOPTS} -C $(WRKBUILD) \
+ echo N|PATH='$(HOST_PATH)' $(MAKE) $(UCLIBC_MAKEOPTS) -C $(WRKBUILD) \
PREFIX=$(STAGING_TARGET_DIR) \
DEVEL_PREFIX=/usr/ \
RUNTIME_PREFIX=$(STAGING_TARGET_DIR) \
@@ -285,19 +286,10 @@ endif
UCLIBC_EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
UCLIBC_EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
oldconfig
- PATH='$(HOST_PATH)' $(MAKE) ${UCLIBC_MAKEOPTS} -C $(WRKBUILD) \
- PREFIX=$(STAGING_TARGET_DIR) \
- DEVEL_PREFIX=/usr/ \
- RUNTIME_PREFIX=$(STAGING_TARGET_DIR) \
- HOSTCC="$(HOST_CC)" \
- UCLIBC_EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
- UCLIBC_EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
- install_headers
- touch $(WRKBUILD)/.configured
touch $@
-$(WRKBUILD)/.compiled:
- PATH='$(HOST_PATH)' $(MAKE) ${UCLIBC_MAKEOPTS} -C $(WRKBUILD) \
+$(WRKBUILD)/.compiled: $(WRKBUILD)/.configured
+ PATH='$(HOST_PATH)' $(MAKE) $(UCLIBC_MAKEOPTS) -C $(WRKBUILD) \
PREFIX= \
DEVEL_PREFIX=/usr/ \
RUNTIME_PREFIX=/ \
@@ -308,7 +300,7 @@ $(WRKBUILD)/.compiled:
all
touch $@
-$(WRKBUILD)/.install_headers: $(WRKBUILD)/.compiled
+$(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
PATH='$(HOST_PATH)' $(MAKE) -C $(WRKBUILD) \
PREFIX=$(STAGING_TARGET_DIR) \
DEVEL_PREFIX=/usr/ \
@@ -317,38 +309,19 @@ $(WRKBUILD)/.install_headers: $(WRKBUILD)/.compiled
UCLIBC_EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
UCLIBC_EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
VERBOSE=1 \
- install_dev
- touch $@
-
-$(WRKBUILD)/.installed: $(WRKBUILD)/.install_headers
+ install_runtime install_dev
PATH='$(HOST_PATH)' $(MAKE) -C $(WRKBUILD) \
- PREFIX=$(STAGING_TARGET_DIR) \
+ CC='$(TARGET_CC)' \
+ PREFIX= \
DEVEL_PREFIX=/usr/ \
- DEVEL_PREFIX_LIB=/ \
RUNTIME_PREFIX=/ \
+ HOSTCC="$(HOST_CC)" \
UCLIBC_EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
UCLIBC_EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
- VERBOSE=1 \
- install_runtime
- touch $@
-
-$(WRKBUILD)/.fixup:
- PATH='$(HOST_PATH)' $(MAKE) -C $(WRKBUILD) \
- CC='$(TARGET_CC)' \
TEST_INSTALLED_UCLIBC=1 \
UCLIBC_ONLY=1 \
- UCLIBC_EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
- UCLIBC_EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
VERBOSE=1 \
test_compile test_gen
-ifeq ($(ADK_TARGET_TOOLCHAIN),y)
- # cleanup toolchain
- -find $(STAGING_TARGET_DIR) $(STAGING_HOST_DIR) -name \*.la -exec rm {} \;
- # strip target libs and host tools for toolchain builds
- PATH="$(TARGET_PATH)" debug='0' prefix='${TARGET_CROSS}' ${BASH} ${SCRIPT_DIR}/rstrip.sh \
- $(STAGING_TARGET_DIR) $(TOOLCHAIN_DIR)/usr/lib/gcc/$(GNU_TARGET_NAME)
- debug='0' prefix=' ' ${BASH} ${SCRIPT_DIR}/rstrip.sh $(TOOLCHAIN_DIR)/usr/bin
-endif
touch $@
include ${ADK_TOPDIR}/mk/toolchain.mk