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
12 TARGETS-
$(CONFIG_GDB
) += gdb
13 TARGETS-
$(CONFIG_CCACHE
) += ccache
14 ifeq ($(CONFIG_NATIVE_TOOLCHAIN
),)
15 TARGETS-y
+=binutils gcc uClibc
18 TARGETS_DOWNLOAD
:=$(patsubst %,%-download
,$(TARGETS-y
))
19 TARGETS_INSTALL
:=$(patsubst %,%-install,$(TARGETS-y
))
20 TARGETS_CLEAN
:=$(patsubst %,%-clean,$(TARGETS-y
))
23 download
: $(TARGETS_DOWNLOAD
)
24 install: $(TARGETS_INSTALL
)
25 clean: $(TARGETS_CLEAN
)
26 $(TARGETS_INSTALL
): $(STAGING_DIR
)/$(REAL_GNU_TARGET_NAME
)
28 ifeq ($(CONFIG_CCACHE
),y
)
29 uClibc-prepare
: ccache-install
31 uClibc-prepare
: kernel-headers-prepare
32 ifeq ($(CONFIG_NATIVE_TOOLCHAIN
),)
33 binutils-prepare
: uClibc-prepare
34 gcc-prepare
: binutils-install
35 uClibc-compile
: gcc-compile
37 gcc-install
: uClibc-install
39 TOOLCHAIN_STAMP_DIR
:=$(STAGING_DIR
)/stampfiles
41 $(STAGING_DIR
)/$(REAL_GNU_TARGET_NAME
):
45 $(TOOLCHAIN_STAMP_DIR
):
48 $(TOOLCHAIN_BUILD_DIR
):
52 $(MAKE
) -C
$(patsubst %-download
,%,$@
) download
54 %-prepare
: $(TOOLCHAIN_STAMP_DIR
) $(STAGING_DIR
)/$(REAL_GNU_TARGET_NAME
) $(TOOLCHAIN_BUILD_DIR
) FORCE
55 @
[ -f
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
] ||
{ \
56 $(MAKE
) -C
$(patsubst %-prepare
,%,$@
) prepare
; \
58 @touch
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
61 @
[ -f
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
] ||
{ \
62 $(MAKE
) -C
$(patsubst %-compile
,%,$@
) compile
; \
64 @touch
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
67 @
[ -f
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
] ||
{ \
68 $(MAKE
) -C
$(patsubst %-install,%,$@
) install; \
70 @touch
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
73 @
$(MAKE
) -C
$(patsubst %-clean,%,$@
) clean
74 @
rm -f
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$(patsubst %-clean,%,$@
)-*
This page took 0.04034 seconds and 5 git commands to generate.