1 # Main makefile for the toolchain
2 include $(TOPDIR
)/rules.mk
3 TARGETS
:=sed utils binutils gcc uClibc ipkg-utils gdb libnotimpl
5 TARGETS_INSTALL
:=$(patsubst %,%-install,$(TARGETS
))
6 TARGETS_CLEAN
:=$(patsubst %,%-clean,$(TARGETS
))
9 install: $(TARGETS_INSTALL
)
10 clean: $(TARGETS_CLEAN
)
12 uClibc-prepare
: kernel-headers-prepare sed-install utils-install
13 binutils-prepare
: uClibc-prepare
14 gcc-prepare
: binutils-install
15 uClibc-compile
: gcc-prepare
16 gcc-compile
: uClibc-install
18 TOOLCHAIN_STAMP_DIR
:=$(STAGING_DIR
)/stampfiles
20 $(TOOLCHAIN_STAMP_DIR
):
21 mkdir
-p
$(TOOLCHAIN_STAMP_DIR
)
24 @mkdir
-p
$(STAGING_DIR
)/lib
25 @mkdir
-p
$(STAGING_DIR
)/include
26 @mkdir
-p
$(STAGING_DIR
)/$(REAL_GNU_TARGET_NAME
)
27 @ln
-sf ..
/lib
$(STAGING_DIR
)/$(REAL_GNU_TARGET_NAME
)/lib
30 @mkdir
-p
$(TOOL_BUILD_DIR
)
32 %-prepare
: $(TOOLCHAIN_STAMP_DIR
) $(STAGING_DIR
) $(TOOL_BUILD_DIR
)
33 @
[ -f
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
] ||
{ \
34 $(TRACE
) toolchain
/$(patsubst %-prepare
,%,$@
)/prepare
; \
35 $(MAKE
) -C
$(patsubst %-prepare
,%,$@
) prepare
; \
37 @touch
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
40 @
[ -f
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
] ||
{ \
41 $(TRACE
) toolchain
/$(patsubst %-compile
,%,$@
)/compile
; \
42 $(MAKE
) -C
$(patsubst %-compile
,%,$@
) compile
; \
44 @touch
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
47 @
[ -f
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
] ||
{ \
48 $(TRACE
) toolchain
/$(patsubst %-install,%,$@
)/install; \
49 $(MAKE
) -C
$(patsubst %-install,%,$@
) install; \
51 @touch
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
54 $(TRACE
) toolchain
/$(patsubst %-clean,%,$@
)/clean
55 @
$(MAKE
) -C
$(patsubst %-clean,%,$@
) clean
56 @
rm -f
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$(patsubst %-clean,%,$@
)-*