1 # Main makefile for the toolchain
2 include $(TOPDIR
)/rules.mk
3 TARGETS
:=sed utils binutils gcc uClibc ipkg-utils gdb
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_
$@
] ||
$(MAKE
) -C
$(patsubst %-prepare
,%,$@
) prepare
34 @touch
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
37 @
[ -f
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
] ||
$(MAKE
) -C
$(patsubst %-compile
,%,$@
) compile
38 @touch
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
41 @
[ -f
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
] ||
$(MAKE
) -C
$(patsubst %-install,%,$@
) install
42 @touch
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$@
45 @
$(MAKE
) -C
$(patsubst %-clean,%,$@
) clean
46 @
rm -f
$(TOOLCHAIN_STAMP_DIR
)/.toolchain_
$(patsubst %-clean,%,$@
)-*