2005-03-06 05:34:52 +02:00
|
|
|
# Main makefile for the toolchain
|
|
|
|
include $(TOPDIR)/rules.mk
|
2006-06-21 09:19:43 +03:00
|
|
|
TARGETS-y:=sed kernel-headers sstrip binutils gcc uClibc ipkg-utils libnotimpl squashfs jffs2 lzma
|
2006-06-01 02:29:05 +03:00
|
|
|
TARGETS-$(CONFIG_GDB) += gdb
|
2005-03-06 05:34:52 +02:00
|
|
|
|
2006-06-21 02:49:23 +03:00
|
|
|
TARGETS_DOWNLOAD:=$(patsubst %,%-source,$(TARGETS-y))
|
2006-06-01 02:29:05 +03:00
|
|
|
TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS-y))
|
|
|
|
TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS-y))
|
2005-03-06 05:34:52 +02:00
|
|
|
|
|
|
|
all: install
|
2006-06-21 02:49:23 +03:00
|
|
|
download: $(TARGETS_DOWNLOAD)
|
2005-03-06 05:34:52 +02:00
|
|
|
install: $(TARGETS_INSTALL)
|
|
|
|
clean: $(TARGETS_CLEAN)
|
|
|
|
|
2006-06-21 09:19:43 +03:00
|
|
|
kernel-headers-prepare: sed-install
|
|
|
|
uClibc-prepare: kernel-headers-prepare sstrip-install
|
2005-03-06 05:34:52 +02:00
|
|
|
binutils-prepare: uClibc-prepare
|
|
|
|
gcc-prepare: binutils-install
|
2006-06-21 09:19:43 +03:00
|
|
|
uClibc-compile: gcc-compile
|
|
|
|
gcc-install: uClibc-install
|
|
|
|
squashfs-compile: lzma-install
|
2005-03-06 05:34:52 +02:00
|
|
|
|
2005-07-18 01:52:59 +03:00
|
|
|
TOOLCHAIN_STAMP_DIR:=$(STAGING_DIR)/stampfiles
|
|
|
|
|
|
|
|
$(TOOLCHAIN_STAMP_DIR):
|
2006-06-01 02:29:05 +03:00
|
|
|
mkdir -p $@
|
2005-03-06 05:34:52 +02:00
|
|
|
|
|
|
|
$(STAGING_DIR):
|
2006-06-01 02:29:05 +03:00
|
|
|
@mkdir -p $@/lib
|
|
|
|
@mkdir -p $@/include
|
|
|
|
@mkdir -p $@/$(REAL_GNU_TARGET_NAME)
|
|
|
|
@ln -sf ../lib $@/$(REAL_GNU_TARGET_NAME)/lib
|
2005-03-06 05:34:52 +02:00
|
|
|
|
|
|
|
$(TOOL_BUILD_DIR):
|
2006-06-01 02:29:05 +03:00
|
|
|
@mkdir -p $@
|
2005-03-06 05:34:52 +02:00
|
|
|
|
2006-06-21 02:49:23 +03:00
|
|
|
%-source: FORCE
|
|
|
|
$(MAKE) -C $(patsubst %-source,%,$@) source
|
|
|
|
|
2006-06-01 02:29:05 +03:00
|
|
|
%-prepare: $(TOOLCHAIN_STAMP_DIR) $(STAGING_DIR) $(TOOL_BUILD_DIR) FORCE
|
2005-10-22 03:06:20 +03:00
|
|
|
@[ -f $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@ ] || { \
|
2006-05-10 23:33:38 +03:00
|
|
|
$(MAKE) -C $(patsubst %-prepare,%,$@) prepare; \
|
2005-10-22 03:06:20 +03:00
|
|
|
}
|
2005-07-18 01:52:59 +03:00
|
|
|
@touch $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@
|
2005-03-06 05:34:52 +02:00
|
|
|
|
|
|
|
%-compile: %-prepare
|
2005-10-22 03:06:20 +03:00
|
|
|
@[ -f $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@ ] || { \
|
2006-05-10 23:33:38 +03:00
|
|
|
$(MAKE) -C $(patsubst %-compile,%,$@) compile; \
|
2005-10-22 03:06:20 +03:00
|
|
|
}
|
2005-07-18 01:52:59 +03:00
|
|
|
@touch $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@
|
2005-03-06 05:34:52 +02:00
|
|
|
|
|
|
|
%-install: %-compile
|
2005-10-22 03:06:20 +03:00
|
|
|
@[ -f $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@ ] || { \
|
2006-05-10 23:33:38 +03:00
|
|
|
$(MAKE) -C $(patsubst %-install,%,$@) install; \
|
2005-10-22 03:06:20 +03:00
|
|
|
}
|
2005-07-18 01:52:59 +03:00
|
|
|
@touch $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@
|
2005-03-06 05:34:52 +02:00
|
|
|
|
2006-06-01 02:29:05 +03:00
|
|
|
%-clean: FORCE
|
2006-05-10 23:33:38 +03:00
|
|
|
@$(MAKE) -C $(patsubst %-clean,%,$@) clean
|
2005-07-18 01:52:59 +03:00
|
|
|
@rm -f $(TOOLCHAIN_STAMP_DIR)/.toolchain_$(patsubst %-clean,%,$@)-*
|
2005-03-06 05:34:52 +02:00
|
|
|
|