2006-06-27 02:44:04 +02: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 04:34:52 +01:00
|
|
|
# Main makefile for the toolchain
|
2006-06-27 02:44:04 +02:00
|
|
|
#
|
2005-03-06 04:34:52 +01:00
|
|
|
include $(TOPDIR)/rules.mk
|
2006-09-27 16:06:46 +02:00
|
|
|
|
2006-10-31 12:33:34 +01:00
|
|
|
TARGETS-y:=kernel-headers
|
2006-09-27 16:06:46 +02:00
|
|
|
TARGETS-$(CONFIG_GDB) += gdb
|
2006-12-11 17:42:57 +01:00
|
|
|
TARGETS-$(CONFIG_CCACHE) += ccache
|
2006-08-10 21:25:26 +02:00
|
|
|
ifeq ($(CONFIG_NATIVE_TOOLCHAIN),)
|
|
|
|
TARGETS-y+=binutils gcc uClibc
|
|
|
|
endif
|
2005-03-06 04:34:52 +01:00
|
|
|
|
2006-07-20 19:28:05 +02:00
|
|
|
TARGETS_DOWNLOAD:=$(patsubst %,%-download,$(TARGETS-y))
|
2006-06-01 01:29:05 +02:00
|
|
|
TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS-y))
|
|
|
|
TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS-y))
|
2005-03-06 04:34:52 +01:00
|
|
|
|
|
|
|
all: install
|
2006-06-21 01:49:23 +02:00
|
|
|
download: $(TARGETS_DOWNLOAD)
|
2005-03-06 04:34:52 +01:00
|
|
|
install: $(TARGETS_INSTALL)
|
|
|
|
clean: $(TARGETS_CLEAN)
|
2006-10-10 18:36:47 +02:00
|
|
|
$(TARGETS_INSTALL): $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)
|
2005-03-06 04:34:52 +01:00
|
|
|
|
2006-12-14 06:10:23 +01:00
|
|
|
ifeq ($(CONFIG_CCACHE),y)
|
|
|
|
uClibc-prepare: ccache-install
|
|
|
|
endif
|
|
|
|
uClibc-prepare: kernel-headers-prepare
|
2006-08-10 21:25:26 +02:00
|
|
|
ifeq ($(CONFIG_NATIVE_TOOLCHAIN),)
|
|
|
|
binutils-prepare: uClibc-prepare
|
|
|
|
gcc-prepare: binutils-install
|
|
|
|
uClibc-compile: gcc-compile
|
|
|
|
endif
|
2006-06-21 08:19:43 +02:00
|
|
|
gcc-install: uClibc-install
|
2005-03-06 04:34:52 +01:00
|
|
|
|
2005-07-18 00:52:59 +02:00
|
|
|
TOOLCHAIN_STAMP_DIR:=$(STAGING_DIR)/stampfiles
|
|
|
|
|
2006-10-10 18:36:47 +02:00
|
|
|
$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME):
|
|
|
|
@mkdir -p $@
|
|
|
|
@ln -sf ../lib $@/lib
|
|
|
|
|
2005-07-18 00:52:59 +02:00
|
|
|
$(TOOLCHAIN_STAMP_DIR):
|
2006-06-01 01:29:05 +02:00
|
|
|
mkdir -p $@
|
2005-03-06 04:34:52 +01:00
|
|
|
|
2006-09-27 16:06:46 +02:00
|
|
|
$(TOOLCHAIN_BUILD_DIR):
|
2006-06-01 01:29:05 +02:00
|
|
|
@mkdir -p $@
|
2005-03-06 04:34:52 +01:00
|
|
|
|
2006-07-20 19:28:05 +02:00
|
|
|
%-download: FORCE
|
|
|
|
$(MAKE) -C $(patsubst %-download,%,$@) download
|
2006-06-21 01:49:23 +02:00
|
|
|
|
2006-10-10 18:36:47 +02:00
|
|
|
%-prepare: $(TOOLCHAIN_STAMP_DIR) $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME) $(TOOLCHAIN_BUILD_DIR) FORCE
|
2005-10-22 02:06:20 +02:00
|
|
|
@[ -f $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@ ] || { \
|
2006-05-10 22:33:38 +02:00
|
|
|
$(MAKE) -C $(patsubst %-prepare,%,$@) prepare; \
|
2005-10-22 02:06:20 +02:00
|
|
|
}
|
2005-07-18 00:52:59 +02:00
|
|
|
@touch $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@
|
2005-03-06 04:34:52 +01:00
|
|
|
|
|
|
|
%-compile: %-prepare
|
2005-10-22 02:06:20 +02:00
|
|
|
@[ -f $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@ ] || { \
|
2006-05-10 22:33:38 +02:00
|
|
|
$(MAKE) -C $(patsubst %-compile,%,$@) compile; \
|
2005-10-22 02:06:20 +02:00
|
|
|
}
|
2005-07-18 00:52:59 +02:00
|
|
|
@touch $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@
|
2005-03-06 04:34:52 +01:00
|
|
|
|
|
|
|
%-install: %-compile
|
2005-10-22 02:06:20 +02:00
|
|
|
@[ -f $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@ ] || { \
|
2006-05-10 22:33:38 +02:00
|
|
|
$(MAKE) -C $(patsubst %-install,%,$@) install; \
|
2005-10-22 02:06:20 +02:00
|
|
|
}
|
2005-07-18 00:52:59 +02:00
|
|
|
@touch $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@
|
2005-03-06 04:34:52 +01:00
|
|
|
|
2006-06-01 01:29:05 +02:00
|
|
|
%-clean: FORCE
|
2006-05-10 22:33:38 +02:00
|
|
|
@$(MAKE) -C $(patsubst %-clean,%,$@) clean
|
2005-07-18 00:52:59 +02:00
|
|
|
@rm -f $(TOOLCHAIN_STAMP_DIR)/.toolchain_$(patsubst %-clean,%,$@)-*
|
2005-03-06 04:34:52 +01:00
|
|
|
|