2006-06-27 03:44:04 +03:00
|
|
|
#
|
|
|
|
# Copyright (C) 2006 OpenWrt.org
|
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
2005-03-06 05:34:52 +02:00
|
|
|
# Main makefile for the toolchain
|
2006-06-27 03:44:04 +03:00
|
|
|
#
|
2005-03-06 05:34:52 +02:00
|
|
|
include $(TOPDIR)/rules.mk
|
2006-09-27 17:06:46 +03:00
|
|
|
|
2006-10-31 13:33:34 +02:00
|
|
|
TARGETS-y:=kernel-headers
|
2006-09-27 17:06:46 +03:00
|
|
|
TARGETS-$(CONFIG_GDB) += gdb
|
2006-08-10 22:25:26 +03:00
|
|
|
ifeq ($(CONFIG_NATIVE_TOOLCHAIN),)
|
|
|
|
TARGETS-y+=binutils gcc uClibc
|
|
|
|
endif
|
2005-03-06 05:34:52 +02:00
|
|
|
|
2006-07-20 20:28:05 +03:00
|
|
|
TARGETS_DOWNLOAD:=$(patsubst %,%-download,$(TARGETS-y))
|
2007-04-18 20:35:46 +03:00
|
|
|
TARGETS_PREPARE:=$(patsubst %,%-prepare,$(TARGETS-y))
|
2007-02-25 19:49:25 +02:00
|
|
|
TARGETS_COMPILE:=$(patsubst %,%-compile,$(TARGETS-y))
|
2006-06-01 02:29:05 +03:00
|
|
|
TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS-y))
|
|
|
|
TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS-y))
|
2007-02-25 19:49:25 +02:00
|
|
|
STAMP:=$(STAGING_DIR)/stampfiles/.toolchain_installed
|
2005-03-06 05:34:52 +02:00
|
|
|
|
|
|
|
all: install
|
2006-06-21 02:49:23 +03:00
|
|
|
download: $(TARGETS_DOWNLOAD)
|
2007-02-25 19:49:25 +02:00
|
|
|
compile: $(TARGETS_COMPILE)
|
|
|
|
install: $(STAMP)
|
2005-03-06 05:34:52 +02:00
|
|
|
clean: $(TARGETS_CLEAN)
|
2007-02-25 19:49:25 +02:00
|
|
|
|
|
|
|
ifneq ($(shell $(SCRIPT_DIR)/timestamp.pl -p . $(STAMP)),$(STAMP))
|
|
|
|
$(STAMP): $(TARGETS_INSTALL)
|
|
|
|
endif
|
2005-03-06 05:34:52 +02:00
|
|
|
|
2006-12-14 07:10:23 +02:00
|
|
|
uClibc-prepare: kernel-headers-prepare
|
2006-08-10 22:25:26 +03:00
|
|
|
ifeq ($(CONFIG_NATIVE_TOOLCHAIN),)
|
|
|
|
binutils-prepare: uClibc-prepare
|
|
|
|
gcc-prepare: binutils-install
|
|
|
|
uClibc-compile: gcc-compile
|
|
|
|
endif
|
2006-06-21 09:19:43 +03:00
|
|
|
gcc-install: uClibc-install
|
2005-03-06 05:34:52 +02:00
|
|
|
|
2007-02-25 19:49:25 +02:00
|
|
|
$(STAMP):
|
|
|
|
mkdir -p $(shell dirname $@)
|
|
|
|
touch $@
|
2005-07-18 01:52:59 +03:00
|
|
|
|
2006-10-10 19:36:47 +03:00
|
|
|
$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME):
|
|
|
|
@mkdir -p $@
|
|
|
|
@ln -sf ../lib $@/lib
|
|
|
|
|
2006-09-27 17:06:46 +03:00
|
|
|
$(TOOLCHAIN_BUILD_DIR):
|
2006-06-01 02:29:05 +03:00
|
|
|
@mkdir -p $@
|
2005-03-06 05:34:52 +02:00
|
|
|
|
2007-06-28 10:20:02 +03:00
|
|
|
%-prereq %-download %-clean %-refresh: FORCE
|
2007-04-18 20:35:46 +03:00
|
|
|
$(MAKE) -C $* $(patsubst $*-%,%,$@)
|
2005-03-06 05:34:52 +02:00
|
|
|
|
2007-04-18 20:35:46 +03:00
|
|
|
%-prepare: $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME) $(TOOLCHAIN_BUILD_DIR)
|
|
|
|
$(MAKE) -C $* $(patsubst $*-%,%,$@)
|
|
|
|
|
|
|
|
%-compile: %-prepare FORCE
|
|
|
|
$(MAKE) -C $* $(patsubst $*-%,%,$@)
|
|
|
|
|
|
|
|
%-install: %-compile FORCE
|
|
|
|
$(MAKE) -C $* $(patsubst $*-%,%,$@)
|