make sure tmp/info gets created
[openwrt/openwrt.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 ifeq ($(CONFIG_NATIVE_TOOLCHAIN),)
14 TARGETS-y+=binutils gcc uClibc
15 endif
16
17 TARGETS_DOWNLOAD:=$(patsubst %,%-download,$(TARGETS-y))
18 TARGETS_COMPILE:=$(patsubst %,%-compile,$(TARGETS-y))
19 TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS-y))
20 TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS-y))
21 STAMP:=$(STAGING_DIR)/stampfiles/.toolchain_installed
22
23 all: install
24 download: $(TARGETS_DOWNLOAD)
25 compile: $(TARGETS_COMPILE)
26 install: $(STAMP)
27 clean: $(TARGETS_CLEAN)
28
29 ifneq ($(shell $(SCRIPT_DIR)/timestamp.pl -p . $(STAMP)),$(STAMP))
30 $(STAMP): $(TARGETS_INSTALL)
31 endif
32
33 uClibc-prepare: kernel-headers-prepare
34 ifeq ($(CONFIG_NATIVE_TOOLCHAIN),)
35 binutils-prepare: uClibc-prepare
36 gcc-prepare: binutils-install
37 uClibc-compile: gcc-compile
38 endif
39 gcc-install: uClibc-install
40
41 $(STAMP):
42 mkdir -p $(shell dirname $@)
43 touch $@
44
45 $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME):
46 @mkdir -p $@
47 @ln -sf ../lib $@/lib
48
49 $(TOOLCHAIN_BUILD_DIR):
50 @mkdir -p $@
51
52 $(eval $(call default_subtargets,$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME) $(TOOLCHAIN_BUILD_DIR)))
53