2006-06-27 00:44:04 +00:00
|
|
|
#
|
|
|
|
# Copyright (C) 2006 OpenWrt.org
|
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
2005-03-06 03:34:52 +00:00
|
|
|
# Main makefile for the toolchain
|
2006-06-27 00:44:04 +00:00
|
|
|
#
|
2005-03-06 03:34:52 +00:00
|
|
|
include $(TOPDIR)/rules.mk
|
2006-08-10 19:25:26 +00:00
|
|
|
TARGETS-y:=sed kernel-headers sstrip
|
|
|
|
ifeq ($(CONFIG_NATIVE_TOOLCHAIN),)
|
|
|
|
TARGETS-y+=binutils gcc uClibc
|
|
|
|
endif
|
2006-08-25 21:53:54 +00:00
|
|
|
TARGETS-y+=ipkg-utils libnotimpl ext2fs squashfs jffs2 lzma mkimage
|
2006-08-10 19:25:26 +00:00
|
|
|
|
2006-05-31 23:29:05 +00:00
|
|
|
TARGETS-$(CONFIG_GDB) += gdb
|
2005-03-06 03:34:52 +00:00
|
|
|
|
2006-07-20 17:28:05 +00:00
|
|
|
TARGETS_DOWNLOAD:=$(patsubst %,%-download,$(TARGETS-y))
|
2006-05-31 23:29:05 +00:00
|
|
|
TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS-y))
|
|
|
|
TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS-y))
|
2005-03-06 03:34:52 +00:00
|
|
|
|
|
|
|
all: install
|
2006-06-20 23:49:23 +00:00
|
|
|
download: $(TARGETS_DOWNLOAD)
|
2005-03-06 03:34:52 +00:00
|
|
|
install: $(TARGETS_INSTALL)
|
|
|
|
clean: $(TARGETS_CLEAN)
|
|
|
|
|
2006-06-21 06:19:43 +00:00
|
|
|
kernel-headers-prepare: sed-install
|
|
|
|
uClibc-prepare: kernel-headers-prepare sstrip-install
|
2006-08-10 19:25:26 +00:00
|
|
|
ifeq ($(CONFIG_NATIVE_TOOLCHAIN),)
|
|
|
|
binutils-prepare: uClibc-prepare
|
|
|
|
gcc-prepare: binutils-install
|
|
|
|
uClibc-compile: gcc-compile
|
|
|
|
endif
|
2006-06-21 06:19:43 +00:00
|
|
|
gcc-install: uClibc-install
|
|
|
|
squashfs-compile: lzma-install
|
2005-03-06 03:34:52 +00:00
|
|
|
|
2005-07-17 22:52:59 +00:00
|
|
|
TOOLCHAIN_STAMP_DIR:=$(STAGING_DIR)/stampfiles
|
|
|
|
|
|
|
|
$(TOOLCHAIN_STAMP_DIR):
|
2006-05-31 23:29:05 +00:00
|
|
|
mkdir -p $@
|
2005-03-06 03:34:52 +00:00
|
|
|
|
|
|
|
$(STAGING_DIR):
|
2006-05-31 23:29:05 +00:00
|
|
|
@mkdir -p $@/lib
|
|
|
|
@mkdir -p $@/include
|
|
|
|
@mkdir -p $@/$(REAL_GNU_TARGET_NAME)
|
|
|
|
@ln -sf ../lib $@/$(REAL_GNU_TARGET_NAME)/lib
|
2005-03-06 03:34:52 +00:00
|
|
|
|
|
|
|
$(TOOL_BUILD_DIR):
|
2006-05-31 23:29:05 +00:00
|
|
|
@mkdir -p $@
|
2005-03-06 03:34:52 +00:00
|
|
|
|
2006-07-20 17:28:05 +00:00
|
|
|
%-download: FORCE
|
|
|
|
$(MAKE) -C $(patsubst %-download,%,$@) download
|
2006-06-20 23:49:23 +00:00
|
|
|
|
2006-05-31 23:29:05 +00:00
|
|
|
%-prepare: $(TOOLCHAIN_STAMP_DIR) $(STAGING_DIR) $(TOOL_BUILD_DIR) FORCE
|
2005-10-22 00:06:20 +00:00
|
|
|
@[ -f $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@ ] || { \
|
2006-05-10 20:33:38 +00:00
|
|
|
$(MAKE) -C $(patsubst %-prepare,%,$@) prepare; \
|
2005-10-22 00:06:20 +00:00
|
|
|
}
|
2005-07-17 22:52:59 +00:00
|
|
|
@touch $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@
|
2005-03-06 03:34:52 +00:00
|
|
|
|
|
|
|
%-compile: %-prepare
|
2005-10-22 00:06:20 +00:00
|
|
|
@[ -f $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@ ] || { \
|
2006-05-10 20:33:38 +00:00
|
|
|
$(MAKE) -C $(patsubst %-compile,%,$@) compile; \
|
2005-10-22 00:06:20 +00:00
|
|
|
}
|
2005-07-17 22:52:59 +00:00
|
|
|
@touch $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@
|
2005-03-06 03:34:52 +00:00
|
|
|
|
|
|
|
%-install: %-compile
|
2005-10-22 00:06:20 +00:00
|
|
|
@[ -f $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@ ] || { \
|
2006-05-10 20:33:38 +00:00
|
|
|
$(MAKE) -C $(patsubst %-install,%,$@) install; \
|
2005-10-22 00:06:20 +00:00
|
|
|
}
|
2005-07-17 22:52:59 +00:00
|
|
|
@touch $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@
|
2005-03-06 03:34:52 +00:00
|
|
|
|
2006-05-31 23:29:05 +00:00
|
|
|
%-clean: FORCE
|
2006-05-10 20:33:38 +00:00
|
|
|
@$(MAKE) -C $(patsubst %-clean,%,$@) clean
|
2005-07-17 22:52:59 +00:00
|
|
|
@rm -f $(TOOLCHAIN_STAMP_DIR)/.toolchain_$(patsubst %-clean,%,$@)-*
|
2005-03-06 03:34:52 +00:00
|
|
|
|