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 binutils gcc uClibc ipkg-utils libnotimpl ext2fs squashfs jffs2 lzma
11 TARGETS-
$(CONFIG_GDB
) += gdb
13 TARGETS_DOWNLOAD
:=$(patsubst %,%-download
,$(TARGETS-y
))
14 TARGETS_INSTALL
:=$(patsubst %,%-install,$(TARGETS-y
))
15 TARGETS_CLEAN
:=$(patsubst %,%-clean,$(TARGETS-y
))
18 download
: $(TARGETS_DOWNLOAD
)
19 install: $(TARGETS_INSTALL
)
20 clean: $(TARGETS_CLEAN
)
22 kernel-headers-prepare
: sed-install
23 uClibc-prepare
: kernel-headers-prepare sstrip-install
24 binutils-prepare
: uClibc-prepare
25 gcc-prepare
: binutils-install
26 uClibc-compile
: gcc-compile
27 gcc-install
: uClibc-install
28 squashfs-compile
: lzma-install
30 TOOLCHAIN_STAMP_DIR
:=$(STAGING_DIR
)/stampfiles
32 $(TOOLCHAIN_STAMP_DIR
):
38 @mkdir
-p
$@
/$(REAL_GNU_TARGET_NAME
)
39 @ln
-sf ..
/lib
$@
/$(REAL_GNU_TARGET_NAME
)/lib
45 $(MAKE
) -C
$(patsubst %-download
,%,$@
) download
47 %-prepare
: $(TOOLCHAIN_STAMP_DIR
) $(STAGING_DIR
) $(TOOL_BUILD_DIR
) FORCE
48 @
[ -f
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
] ||
{ \
49 $(MAKE
) -C
$(patsubst %-prepare
,%,$@
) prepare
; \
51 @touch
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
54 @
[ -f
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
] ||
{ \
55 $(MAKE
) -C
$(patsubst %-compile
,%,$@
) compile
; \
57 @touch
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
60 @
[ -f
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
] ||
{ \
61 $(MAKE
) -C
$(patsubst %-install,%,$@
) install; \
63 @touch
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
66 @
$(MAKE
) -C
$(patsubst %-clean,%,$@
) clean
67 @
rm -f
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$(patsubst %-clean,%,$@
)-*