sync ath9k with the git tree
[openwrt/svn-archive/archive.git] / toolchain / Makefile
1 #
2 # Copyright (C) 2007 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 curdir:=toolchain
10
11 # subdirectories to descend into
12 $(curdir)/builddirs := kernel-headers $(if $(CONFIG_GDB),gdb) $(if $(CONFIG_NATIVE_TOOLCHAIN),,binutils gcc uClibc)
13 $(curdir)/builddirs-compile:=. $(filter-out kernel-headers,$($(curdir)/builddirs))
14 $(curdir)/builddirs-install:=$($(curdir)/builddirs-compile)
15
16 # builddir dependencies
17 $(curdir)/uClibc/prepare:=$(curdir)/kernel-headers/prepare
18 ifeq ($(CONFIG_NATIVE_TOOLCHAIN),)
19 $(curdir)/binutils/prepare:=$(curdir)/uClibc/prepare
20 $(curdir)/gcc/prepare:=$(curdir)/binutils/install
21 $(curdir)/uClibc/compile:=$(curdir)/gcc/compile
22 $(curdir)/gcc/install:=$(curdir)/uClibc/compile
23 $(curdir)/uClibc/install:=$(curdir)/gcc/install
24 endif
25
26 ifneq ($(ARCH),)
27 $(TOOLCHAIN_DIR)/info.mk: .config
28 @for dir in $(TOOLCHAIN_DIR); do ( \
29 set -x; \
30 mkdir -p "$$dir"; \
31 cd "$$dir"; \
32 mkdir -p bin lib include stamp; \
33 ); done
34 @grep GCC_VERSION $@ >/dev/null 2>&1 || $(INSTALL_DATA) $(TOPDIR)/toolchain/info.mk $@
35 @touch $@
36 endif
37
38 # prerequisites for the individual targets
39 $(curdir)/ := .config prereq
40 $(curdir)//prepare = $(STAGING_DIR)/.prepared $(TOOLCHAIN_DIR)/info.mk
41 $(curdir)//compile = $(1)/prepare
42 $(curdir)//install = $(1)/compile
43
44 $(TOOLCHAIN_DIR)/stamp/.gcc-initial_installed:
45
46 $(eval $(call stampfile,$(curdir),toolchain,install,$(TOOLCHAIN_DIR)/stamp/.gcc-initial_installed))
47 $(eval $(call subdir,$(curdir)))
48