2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 # Main makefile for the toolchain
9 include $(TOPDIR
)/rules.mk
11 TARGETS-y
:=kernel-headers libnotimpl
12 TARGETS-
$(CONFIG_GDB
) += gdb
13 ifeq ($(CONFIG_NATIVE_TOOLCHAIN
),)
14 TARGETS-y
+=binutils gcc uClibc
17 TARGETS_DOWNLOAD
:=$(patsubst %,%-download
,$(TARGETS-y
))
18 TARGETS_INSTALL
:=$(patsubst %,%-install,$(TARGETS-y
))
19 TARGETS_CLEAN
:=$(patsubst %,%-clean,$(TARGETS-y
))
22 download
: $(TARGETS_DOWNLOAD
)
23 install: $(TARGETS_INSTALL
)
24 clean: $(TARGETS_CLEAN
)
25 $(TARGETS_INSTALL
): $(STAGING_DIR
)/$(REAL_GNU_TARGET_NAME
)
27 uClibc-prepare
: kernel-headers-prepare
28 ifeq ($(CONFIG_NATIVE_TOOLCHAIN
),)
29 binutils-prepare
: uClibc-prepare
30 gcc-prepare
: binutils-install
31 uClibc-compile
: gcc-compile
32 libnotimpl-compile
: gcc-install
34 gcc-install
: uClibc-install
36 TOOLCHAIN_STAMP_DIR
:=$(STAGING_DIR
)/stampfiles
38 $(STAGING_DIR
)/$(REAL_GNU_TARGET_NAME
):
42 $(TOOLCHAIN_STAMP_DIR
):
45 $(TOOLCHAIN_BUILD_DIR
):
49 $(MAKE
) -C
$(patsubst %-download
,%,$@
) download
51 %-prepare
: $(TOOLCHAIN_STAMP_DIR
) $(STAGING_DIR
)/$(REAL_GNU_TARGET_NAME
) $(TOOLCHAIN_BUILD_DIR
) FORCE
52 @
[ -f
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
] ||
{ \
53 $(MAKE
) -C
$(patsubst %-prepare
,%,$@
) prepare
; \
55 @touch
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
58 @
[ -f
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
] ||
{ \
59 $(MAKE
) -C
$(patsubst %-compile
,%,$@
) compile
; \
61 @touch
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
64 @
[ -f
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
] ||
{ \
65 $(MAKE
) -C
$(patsubst %-install,%,$@
) install; \
67 @touch
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
70 @
$(MAKE
) -C
$(patsubst %-clean,%,$@
) clean
71 @
rm -f
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$(patsubst %-clean,%,$@
)-*