2006-06-27 00:44:04 +00:00
|
|
|
#
|
2009-09-23 02:27:38 +00:00
|
|
|
# Copyright (C) 2007-2009 OpenWrt.org
|
2006-06-27 00:44:04 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
2005-03-06 03:34:52 +00:00
|
|
|
# Main makefile for the toolchain
|
2006-06-27 00:44:04 +00:00
|
|
|
#
|
2009-01-08 01:49:11 +00:00
|
|
|
# Steps:
|
|
|
|
# 1) toolchain/binutils/install
|
|
|
|
# build & install binutils
|
|
|
|
# 2) toolchain/gcc/prepare
|
|
|
|
# build & install a minimal gcc, needed for steps 3 & 4
|
|
|
|
# 3) toolchain/kernel-headers/install
|
|
|
|
# install kernel headers, needed for step 4
|
|
|
|
# 4) toolchain/libc/prepare
|
|
|
|
# build & install libc headers & support files, needed for step 5
|
|
|
|
# 5) toolchain/gcc/compile
|
|
|
|
# build & install an initial gcc, needed for step 6
|
|
|
|
# 6) toolchain/libc/compile
|
|
|
|
# build & install the final libc
|
|
|
|
# 7) toolchain/gcc/install
|
|
|
|
# build & install the final gcc
|
|
|
|
# 8) toolchain/libc/install
|
|
|
|
# build & install libc utilities
|
|
|
|
#
|
|
|
|
|
2007-07-30 15:00:27 +00:00
|
|
|
curdir:=toolchain
|
2006-09-27 14:06:46 +00:00
|
|
|
|
2007-07-28 13:29:03 +00:00
|
|
|
# subdirectories to descend into
|
2012-04-28 22:24:12 +00:00
|
|
|
$(curdir)/builddirs := $(if $(CONFIG_GDB),gdb) $(if $(CONFIG_INSIGHT),insight) $(if $(CONFIG_EXTERNAL_TOOLCHAIN),wrapper,kernel-headers binutils gcc/minimal gcc/initial gcc/final $(LIBC))
|
2012-06-30 21:44:05 +00:00
|
|
|
ifdef CONFIG_USE_UCLIBC
|
|
|
|
$(curdir)/builddirs += $(LIBC)/headers
|
|
|
|
$(curdir)/builddirs += $(LIBC)/utils
|
|
|
|
endif
|
2009-01-08 01:49:11 +00:00
|
|
|
$(curdir)/builddirs-compile:=$($(curdir)/builddirs-prepare)
|
2007-07-30 21:57:14 +00:00
|
|
|
$(curdir)/builddirs-install:=$($(curdir)/builddirs-compile)
|
2005-03-06 03:34:52 +00:00
|
|
|
|
2007-07-28 13:29:03 +00:00
|
|
|
# builddir dependencies
|
2009-09-23 02:27:38 +00:00
|
|
|
ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
|
2010-07-20 20:57:21 +00:00
|
|
|
$(curdir)/gcc/minimal/compile:=$(curdir)/binutils/install
|
|
|
|
$(curdir)/kernel-headers/install:=$(curdir)/gcc/minimal/install
|
2011-01-12 15:44:53 +00:00
|
|
|
$(curdir)/gcc/initial/prepare:=$(curdir)/gcc/minimal/prepare
|
|
|
|
$(curdir)/gcc/final/prepare:=$(curdir)/gcc/initial/prepare
|
2012-06-30 21:44:05 +00:00
|
|
|
|
|
|
|
ifdef CONFIG_USE_UCLIBC
|
2012-07-03 10:43:59 +00:00
|
|
|
$(curdir)/$(LIBC)/headers/compile:=$(curdir)/kernel-headers/install
|
2012-06-30 21:44:05 +00:00
|
|
|
$(curdir)/gcc/initial/compile:=$(curdir)/$(LIBC)/headers/install
|
|
|
|
$(curdir)/$(LIBC)/compile:=$(curdir)/gcc/initial/install
|
|
|
|
$(curdir)/gcc/final/compile:=$(curdir)/$(LIBC)/install
|
|
|
|
$(curdir)/$(LIBC)/utils/compile:=$(curdir)/gcc/final/install
|
|
|
|
$(curdir)/$(LIBC)/prepare:=$(curdir)/$(LIBC)/headers/prepare
|
|
|
|
$(curdir)/$(LIBC)/utils/prepare:=$(curdir)/$(LIBC)/headers/prepare
|
|
|
|
else
|
2012-07-03 10:43:59 +00:00
|
|
|
$(curdir)/$(LIBC)/prepare:=$(curdir)/kernel-headers/install
|
2012-06-30 21:44:05 +00:00
|
|
|
$(curdir)/$(LIBC)/compile:=$(curdir)/gcc/initial/install
|
|
|
|
$(curdir)/$(LIBC)/install:=$(curdir)/gcc/final/install
|
|
|
|
$(curdir)/gcc/initial/compile:=$(curdir)/$(LIBC)/prepare
|
|
|
|
$(curdir)/gcc/final/compile:=$(curdir)/$(LIBC)/compile
|
|
|
|
endif
|
2006-08-10 19:25:26 +00:00
|
|
|
endif
|
2007-08-07 00:04:25 +00:00
|
|
|
|
2009-10-10 19:25:48 +00:00
|
|
|
ifdef CONFIG_GCC_VERSION_LLVM
|
|
|
|
$(curdir)/builddirs += llvm
|
2010-07-20 20:57:21 +00:00
|
|
|
$(curdir)/gcc/minimal/compile += $(curdir)/llvm/install
|
2009-10-10 19:25:48 +00:00
|
|
|
endif
|
|
|
|
|
2010-09-01 17:51:36 +00:00
|
|
|
ifndef DUMP_TARGET_DB
|
2008-06-15 14:34:00 +00:00
|
|
|
ifneq ($(ARCH),)
|
|
|
|
$(TOOLCHAIN_DIR)/info.mk: .config
|
2007-08-07 00:04:25 +00:00
|
|
|
@for dir in $(TOOLCHAIN_DIR); do ( \
|
2011-04-04 00:54:37 +00:00
|
|
|
$(if $(QUIET),,set -x;) \
|
2007-08-07 00:04:25 +00:00
|
|
|
mkdir -p "$$dir"; \
|
|
|
|
cd "$$dir"; \
|
2011-11-28 19:19:33 +00:00
|
|
|
ln -sf lib lib64; \
|
2009-01-08 01:49:11 +00:00
|
|
|
mkdir -p stamp lib usr/include usr/lib ; \
|
2007-08-07 00:04:25 +00:00
|
|
|
); done
|
|
|
|
@grep GCC_VERSION $@ >/dev/null 2>&1 || $(INSTALL_DATA) $(TOPDIR)/toolchain/info.mk $@
|
|
|
|
@touch $@
|
2008-06-15 14:34:00 +00:00
|
|
|
endif
|
2010-09-01 17:51:36 +00:00
|
|
|
endif
|
2005-03-06 03:34:52 +00:00
|
|
|
|
2007-07-28 13:29:03 +00:00
|
|
|
# prerequisites for the individual targets
|
2007-07-30 21:14:08 +00:00
|
|
|
$(curdir)/ := .config prereq
|
2007-08-07 00:04:25 +00:00
|
|
|
$(curdir)//prepare = $(STAGING_DIR)/.prepared $(TOOLCHAIN_DIR)/info.mk
|
2007-07-28 13:44:04 +00:00
|
|
|
$(curdir)//compile = $(1)/prepare
|
|
|
|
$(curdir)//install = $(1)/compile
|
2005-03-06 03:34:52 +00:00
|
|
|
|
2010-09-01 17:51:36 +00:00
|
|
|
ifndef DUMP_TARGET_DB
|
2007-09-08 19:55:42 +00:00
|
|
|
$(TOOLCHAIN_DIR)/stamp/.gcc-initial_installed:
|
2010-09-01 17:51:36 +00:00
|
|
|
endif
|
2007-09-08 19:55:42 +00:00
|
|
|
|
2009-07-11 12:48:59 +00:00
|
|
|
$(eval $(call stampfile,$(curdir),toolchain,install,$(TOOLCHAIN_DIR)/stamp/.gcc-initial_installed,,$(TOOLCHAIN_DIR)))
|
2007-07-28 13:44:04 +00:00
|
|
|
$(eval $(call subdir,$(curdir)))
|
2007-04-18 17:35:46 +00:00
|
|
|
|