1 # Main makefile for the toolchain
2 include $(TOPDIR
)/rules.mk
3 TARGETS-y
:=sed utils binutils gcc uClibc ipkg-utils libnotimpl
4 TARGETS-
$(CONFIG_GDB
) += gdb
6 TARGETS_INSTALL
:=$(patsubst %,%-install,$(TARGETS-y
))
7 TARGETS_CLEAN
:=$(patsubst %,%-clean,$(TARGETS-y
))
10 install: $(TARGETS_INSTALL
)
11 clean: $(TARGETS_CLEAN
)
13 uClibc-prepare
: kernel-headers-prepare sed-install utils-install
14 binutils-prepare
: uClibc-prepare
15 gcc-prepare
: binutils-install
16 uClibc-compile
: gcc-prepare
17 gcc-compile
: uClibc-install
19 TOOLCHAIN_STAMP_DIR
:=$(STAGING_DIR
)/stampfiles
21 $(TOOLCHAIN_STAMP_DIR
):
27 @mkdir
-p
$@
/$(REAL_GNU_TARGET_NAME
)
28 @ln
-sf ..
/lib
$@
/$(REAL_GNU_TARGET_NAME
)/lib
33 %-prepare
: $(TOOLCHAIN_STAMP_DIR
) $(STAGING_DIR
) $(TOOL_BUILD_DIR
) FORCE
34 @
[ -f
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
] ||
{ \
35 $(MAKE
) -C
$(patsubst %-prepare
,%,$@
) prepare
; \
37 @touch
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
40 @
[ -f
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
] ||
{ \
41 $(MAKE
) -C
$(patsubst %-compile
,%,$@
) compile
; \
43 @touch
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
46 @
[ -f
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
] ||
{ \
47 $(MAKE
) -C
$(patsubst %-install,%,$@
) install; \
49 @touch
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
52 @
$(MAKE
) -C
$(patsubst %-clean,%,$@
) clean
53 @
rm -f
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$(patsubst %-clean,%,$@
)-*