2006-06-27 08:44:04 +08:00
|
|
|
#
|
2007-07-28 21:29:03 +08:00
|
|
|
# Copyright (C) 2007 OpenWrt.org
|
2006-06-27 08:44:04 +08:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
2005-03-06 11:34:52 +08:00
|
|
|
# Main makefile for the toolchain
|
2006-06-27 08:44:04 +08:00
|
|
|
#
|
2007-07-30 23:00:27 +08:00
|
|
|
curdir:=toolchain
|
2006-09-27 22:06:46 +08:00
|
|
|
|
2007-07-28 21:29:03 +08:00
|
|
|
# subdirectories to descend into
|
2007-07-28 21:44:04 +08:00
|
|
|
$(curdir)/builddirs := kernel-headers $(if $(CONFIG_GDB),gdb) $(if $(CONFIG_NATIVE_TOOLCHAIN),,binutils gcc uClibc)
|
2007-07-31 05:57:14 +08:00
|
|
|
$(curdir)/builddirs-compile:=. $(filter-out kernel-headers,$($(curdir)/builddirs))
|
|
|
|
$(curdir)/builddirs-install:=$($(curdir)/builddirs-compile)
|
2005-03-06 11:34:52 +08:00
|
|
|
|
2007-07-28 21:29:03 +08:00
|
|
|
# builddir dependencies
|
2007-07-28 21:44:04 +08:00
|
|
|
$(curdir)/uClibc/prepare:=$(curdir)/kernel-headers/prepare
|
2006-08-11 03:25:26 +08:00
|
|
|
ifeq ($(CONFIG_NATIVE_TOOLCHAIN),)
|
2007-07-28 21:44:04 +08:00
|
|
|
$(curdir)/binutils/prepare:=$(curdir)/uClibc/prepare
|
|
|
|
$(curdir)/gcc/prepare:=$(curdir)/binutils/install
|
|
|
|
$(curdir)/uClibc/compile:=$(curdir)/gcc/compile
|
2007-08-07 08:04:25 +08:00
|
|
|
$(curdir)/gcc/install:=$(curdir)/uClibc/compile
|
|
|
|
$(curdir)/uClibc/install:=$(curdir)/gcc/install
|
2006-08-11 03:25:26 +08:00
|
|
|
endif
|
2007-08-07 08:04:25 +08:00
|
|
|
|
2008-06-15 22:34:00 +08:00
|
|
|
ifneq ($(ARCH),)
|
|
|
|
$(TOOLCHAIN_DIR)/info.mk: .config
|
2007-08-07 08:04:25 +08:00
|
|
|
@for dir in $(TOOLCHAIN_DIR); do ( \
|
|
|
|
set -x; \
|
|
|
|
mkdir -p "$$dir"; \
|
|
|
|
cd "$$dir"; \
|
|
|
|
mkdir -p bin lib include stamp; \
|
|
|
|
); done
|
|
|
|
@grep GCC_VERSION $@ >/dev/null 2>&1 || $(INSTALL_DATA) $(TOPDIR)/toolchain/info.mk $@
|
|
|
|
@touch $@
|
2008-06-15 22:34:00 +08:00
|
|
|
endif
|
2005-03-06 11:34:52 +08:00
|
|
|
|
2007-07-28 21:29:03 +08:00
|
|
|
# prerequisites for the individual targets
|
2007-07-31 05:14:08 +08:00
|
|
|
$(curdir)/ := .config prereq
|
2007-08-07 08:04:25 +08:00
|
|
|
$(curdir)//prepare = $(STAGING_DIR)/.prepared $(TOOLCHAIN_DIR)/info.mk
|
2007-07-28 21:44:04 +08:00
|
|
|
$(curdir)//compile = $(1)/prepare
|
|
|
|
$(curdir)//install = $(1)/compile
|
2005-03-06 11:34:52 +08:00
|
|
|
|
2007-09-09 03:55:42 +08:00
|
|
|
$(TOOLCHAIN_DIR)/stamp/.gcc-initial_installed:
|
|
|
|
|
|
|
|
$(eval $(call stampfile,$(curdir),toolchain,install,$(TOOLCHAIN_DIR)/stamp/.gcc-initial_installed))
|
2007-07-28 21:44:04 +08:00
|
|
|
$(eval $(call subdir,$(curdir)))
|
2007-04-19 01:35:46 +08:00
|
|
|
|