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
10 TARGETS-y
:=sed kernel-headers sstrip
11 ifeq ($(CONFIG_NATIVE_TOOLCHAIN
),)
12 TARGETS-y
+=binutils gcc uClibc
14 TARGETS-y
+=ipkg-utils libnotimpl ext2fs squashfs jffs2 lzma mkimage
16 TARGETS-
$(CONFIG_GDB
) += gdb
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
)
27 kernel-headers-prepare
: sed-install
28 uClibc-prepare
: kernel-headers-prepare sstrip-install
29 ifeq ($(CONFIG_NATIVE_TOOLCHAIN
),)
30 binutils-prepare
: uClibc-prepare
31 gcc-prepare
: binutils-install
32 uClibc-compile
: gcc-compile
34 gcc-install
: uClibc-install
35 squashfs-compile
: lzma-install
37 TOOLCHAIN_STAMP_DIR
:=$(STAGING_DIR
)/stampfiles
39 $(TOOLCHAIN_STAMP_DIR
):
45 @mkdir
-p
$@
/$(REAL_GNU_TARGET_NAME
)
46 @ln
-sf ..
/lib
$@
/$(REAL_GNU_TARGET_NAME
)/lib
52 $(MAKE
) -C
$(patsubst %-download
,%,$@
) download
54 %-prepare
: $(TOOLCHAIN_STAMP_DIR
) $(STAGING_DIR
) $(TOOL_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,%,$@
)-*