build system cleanup. move shared include files into $(TOPDIR)/include, move lzma...
[openwrt.git] / toolchain / Makefile
1 # Main makefile for the toolchain
2 include $(TOPDIR)/rules.mk
3 TARGETS-y:=sed kernel-headers utils binutils gcc uClibc ipkg-utils libnotimpl squashfs jffs2 lzma
4 TARGETS-$(CONFIG_GDB) += gdb
5
6 TARGETS_DOWNLOAD:=$(patsubst %,%-source,$(TARGETS-y))
7 TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS-y))
8 TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS-y))
9
10 all: install
11 download: $(TARGETS_DOWNLOAD)
12 install: $(TARGETS_INSTALL)
13 clean: $(TARGETS_CLEAN)
14
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
20 squashfs-compile: lzma-compile
21
22 TOOLCHAIN_STAMP_DIR:=$(STAGING_DIR)/stampfiles
23
24 $(TOOLCHAIN_STAMP_DIR):
25 mkdir -p $@
26
27 $(STAGING_DIR):
28 @mkdir -p $@/lib
29 @mkdir -p $@/include
30 @mkdir -p $@/$(REAL_GNU_TARGET_NAME)
31 @ln -sf ../lib $@/$(REAL_GNU_TARGET_NAME)/lib
32
33 $(TOOL_BUILD_DIR):
34 @mkdir -p $@
35
36 %-source: FORCE
37 $(MAKE) -C $(patsubst %-source,%,$@) source
38
39 %-prepare: $(TOOLCHAIN_STAMP_DIR) $(STAGING_DIR) $(TOOL_BUILD_DIR) FORCE
40 @[ -f $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@ ] || { \
41 $(MAKE) -C $(patsubst %-prepare,%,$@) prepare; \
42 }
43 @touch $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@
44
45 %-compile: %-prepare
46 @[ -f $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@ ] || { \
47 $(MAKE) -C $(patsubst %-compile,%,$@) compile; \
48 }
49 @touch $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@
50
51 %-install: %-compile
52 @[ -f $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@ ] || { \
53 $(MAKE) -C $(patsubst %-install,%,$@) install; \
54 }
55 @touch $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@
56
57 %-clean: FORCE
58 @$(MAKE) -C $(patsubst %-clean,%,$@) clean
59 @rm -f $(TOOLCHAIN_STAMP_DIR)/.toolchain_$(patsubst %-clean,%,$@)-*
60
This page took 0.041937 seconds and 5 git commands to generate.