1 # Main makefile for the toolchain
2 include $(TOPDIR
)/rules.mk
3 TARGETS-y
:=sed kernel-headers sstrip binutils gcc uClibc ipkg-utils libnotimpl squashfs jffs2 lzma
4 TARGETS-
$(CONFIG_GDB
) += gdb
6 TARGETS_DOWNLOAD
:=$(patsubst %,%-source
,$(TARGETS-y
))
7 TARGETS_INSTALL
:=$(patsubst %,%-install,$(TARGETS-y
))
8 TARGETS_CLEAN
:=$(patsubst %,%-clean,$(TARGETS-y
))
11 download
: $(TARGETS_DOWNLOAD
)
12 install: $(TARGETS_INSTALL
)
13 clean: $(TARGETS_CLEAN
)
15 kernel-headers-prepare
: sed-install
16 uClibc-prepare
: kernel-headers-prepare sstrip-install
17 binutils-prepare
: uClibc-prepare
18 gcc-prepare
: binutils-install
19 uClibc-compile
: gcc-compile
20 gcc-install
: uClibc-install
21 squashfs-compile
: lzma-install
23 TOOLCHAIN_STAMP_DIR
:=$(STAGING_DIR
)/stampfiles
25 $(TOOLCHAIN_STAMP_DIR
):
31 @mkdir
-p
$@
/$(REAL_GNU_TARGET_NAME
)
32 @ln
-sf ..
/lib
$@
/$(REAL_GNU_TARGET_NAME
)/lib
38 $(MAKE
) -C
$(patsubst %-source
,%,$@
) source
40 %-prepare
: $(TOOLCHAIN_STAMP_DIR
) $(STAGING_DIR
) $(TOOL_BUILD_DIR
) FORCE
41 @
[ -f
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
] ||
{ \
42 $(MAKE
) -C
$(patsubst %-prepare
,%,$@
) prepare
; \
44 @touch
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
47 @
[ -f
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
] ||
{ \
48 $(MAKE
) -C
$(patsubst %-compile
,%,$@
) compile
; \
50 @touch
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
53 @
[ -f
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
] ||
{ \
54 $(MAKE
) -C
$(patsubst %-install,%,$@
) install; \
56 @touch
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
59 @
$(MAKE
) -C
$(patsubst %-clean,%,$@
) clean
60 @
rm -f
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$(patsubst %-clean,%,$@
)-*