add arm eabi patches
[openwrt.git] / toolchain / Makefile
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
5
6 TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS-y))
7 TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS-y))
8
9 all: install
10 install: $(TARGETS_INSTALL)
11 clean: $(TARGETS_CLEAN)
12
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
18
19 TOOLCHAIN_STAMP_DIR:=$(STAGING_DIR)/stampfiles
20
21 $(TOOLCHAIN_STAMP_DIR):
22 mkdir -p $@
23
24 $(STAGING_DIR):
25 @mkdir -p $@/lib
26 @mkdir -p $@/include
27 @mkdir -p $@/$(REAL_GNU_TARGET_NAME)
28 @ln -sf ../lib $@/$(REAL_GNU_TARGET_NAME)/lib
29
30 $(TOOL_BUILD_DIR):
31 @mkdir -p $@
32
33 %-prepare: $(TOOLCHAIN_STAMP_DIR) $(STAGING_DIR) $(TOOL_BUILD_DIR) FORCE
34 @[ -f $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@ ] || { \
35 $(MAKE) -C $(patsubst %-prepare,%,$@) prepare; \
36 }
37 @touch $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@
38
39 %-compile: %-prepare
40 @[ -f $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@ ] || { \
41 $(MAKE) -C $(patsubst %-compile,%,$@) compile; \
42 }
43 @touch $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@
44
45 %-install: %-compile
46 @[ -f $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@ ] || { \
47 $(MAKE) -C $(patsubst %-install,%,$@) install; \
48 }
49 @touch $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@
50
51 %-clean: FORCE
52 @$(MAKE) -C $(patsubst %-clean,%,$@) clean
53 @rm -f $(TOOLCHAIN_STAMP_DIR)/.toolchain_$(patsubst %-clean,%,$@)-*
54
This page took 0.045784 seconds and 5 git commands to generate.