Integrate basic UCI config file validation support
[openwrt/svn-archive/archive.git] / toolchain / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # Main makefile for the toolchain
8 #
9 include $(TOPDIR)/rules.mk
10
11 TARGETS-y:=kernel-headers
12 TARGETS-$(CONFIG_GDB) += gdb
13 TARGETS-$(CONFIG_CCACHE) += ccache
14 ifeq ($(CONFIG_NATIVE_TOOLCHAIN),)
15 TARGETS-y+=binutils gcc uClibc
16 endif
17
18 TARGETS_DOWNLOAD:=$(patsubst %,%-download,$(TARGETS-y))
19 TARGETS_COMPILE:=$(patsubst %,%-compile,$(TARGETS-y))
20 TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS-y))
21 TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS-y))
22 STAMP:=$(STAGING_DIR)/stampfiles/.toolchain_installed
23
24 all: install
25 download: $(TARGETS_DOWNLOAD)
26 compile: $(TARGETS_COMPILE)
27 install: $(STAMP)
28 clean: $(TARGETS_CLEAN)
29
30 ifneq ($(shell $(SCRIPT_DIR)/timestamp.pl -p . $(STAMP)),$(STAMP))
31 $(STAMP): $(TARGETS_INSTALL)
32 endif
33
34 ifeq ($(CONFIG_CCACHE),y)
35 uClibc-prepare: ccache-install
36 endif
37 uClibc-prepare: kernel-headers-prepare
38 ifeq ($(CONFIG_NATIVE_TOOLCHAIN),)
39 binutils-prepare: uClibc-prepare
40 gcc-prepare: binutils-install
41 uClibc-compile: gcc-compile
42 endif
43 gcc-install: uClibc-install
44
45 $(STAMP):
46 mkdir -p $(shell dirname $@)
47 touch $@
48
49 $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME):
50 @mkdir -p $@
51 @ln -sf ../lib $@/lib
52
53 $(TOOLCHAIN_BUILD_DIR):
54 @mkdir -p $@
55
56 $(eval $(call default_subtargets,$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME) $(TOOLCHAIN_BUILD_DIR)))
57