1 # Main makefile for the toolchain
2 include $(TOPDIR
)/rules.mk
3 TARGETS-y
:=sed kernel-headers utils binutils gcc uClibc ipkg-utils libnotimpl
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 uClibc-prepare
: kernel-headers-prepare sed-install utils-install
16 binutils-prepare
: uClibc-prepare
17 gcc-prepare
: binutils-install
18 uClibc-compile
: gcc-prepare
19 gcc-compile
: uClibc-install
21 TOOLCHAIN_STAMP_DIR
:=$(STAGING_DIR
)/stampfiles
23 $(TOOLCHAIN_STAMP_DIR
):
29 @mkdir
-p
$@
/$(REAL_GNU_TARGET_NAME
)
30 @ln
-sf ..
/lib
$@
/$(REAL_GNU_TARGET_NAME
)/lib
36 $(MAKE
) -C
$(patsubst %-source
,%,$@
) source
38 %-prepare
: $(TOOLCHAIN_STAMP_DIR
) $(STAGING_DIR
) $(TOOL_BUILD_DIR
) FORCE
39 @
[ -f
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
] ||
{ \
40 $(MAKE
) -C
$(patsubst %-prepare
,%,$@
) prepare
; \
42 @touch
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
45 @
[ -f
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
] ||
{ \
46 $(MAKE
) -C
$(patsubst %-compile
,%,$@
) compile
; \
48 @touch
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
51 @
[ -f
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
] ||
{ \
52 $(MAKE
) -C
$(patsubst %-install,%,$@
) install; \
54 @touch
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
57 @
$(MAKE
) -C
$(patsubst %-clean,%,$@
) clean
58 @
rm -f
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$(patsubst %-clean,%,$@
)-*