2005-03-06 05:34:52 +02:00
|
|
|
# Main makefile for the toolchain
|
|
|
|
include $(TOPDIR)/rules.mk
|
2005-10-09 00:43:56 +03:00
|
|
|
TARGETS:=sed utils binutils gcc uClibc ipkg-utils gdb libnotimpl
|
2005-03-06 05:34:52 +02:00
|
|
|
|
|
|
|
TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS))
|
|
|
|
TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS))
|
|
|
|
|
|
|
|
all: install
|
|
|
|
install: $(TARGETS_INSTALL)
|
|
|
|
clean: $(TARGETS_CLEAN)
|
|
|
|
|
|
|
|
uClibc-prepare: kernel-headers-prepare sed-install utils-install
|
|
|
|
binutils-prepare: uClibc-prepare
|
|
|
|
gcc-prepare: binutils-install
|
|
|
|
uClibc-compile: gcc-prepare
|
2005-04-06 19:46:51 +03:00
|
|
|
gcc-compile: uClibc-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):
|
|
|
|
mkdir -p $(TOOLCHAIN_STAMP_DIR)
|
2005-03-06 05:34:52 +02:00
|
|
|
|
|
|
|
$(STAGING_DIR):
|
|
|
|
@mkdir -p $(STAGING_DIR)/lib
|
|
|
|
@mkdir -p $(STAGING_DIR)/include
|
|
|
|
@mkdir -p $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)
|
|
|
|
@ln -sf ../lib $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib
|
|
|
|
|
|
|
|
$(TOOL_BUILD_DIR):
|
|
|
|
@mkdir -p $(TOOL_BUILD_DIR)
|
|
|
|
|
2005-07-18 01:52:59 +03:00
|
|
|
%-prepare: $(TOOLCHAIN_STAMP_DIR) $(STAGING_DIR) $(TOOL_BUILD_DIR)
|
2005-10-22 03:06:20 +03:00
|
|
|
@[ -f $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@ ] || { \
|
|
|
|
$(TRACE) toolchain/$(patsubst %-prepare,%,$@)/prepare; \
|
|
|
|
$(MAKE) -C $(patsubst %-prepare,%,$@) prepare; \
|
|
|
|
}
|
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_$@ ] || { \
|
|
|
|
$(TRACE) toolchain/$(patsubst %-compile,%,$@)/compile; \
|
|
|
|
$(MAKE) -C $(patsubst %-compile,%,$@) compile; \
|
|
|
|
}
|
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_$@ ] || { \
|
|
|
|
$(TRACE) toolchain/$(patsubst %-install,%,$@)/install; \
|
|
|
|
$(MAKE) -C $(patsubst %-install,%,$@) install; \
|
|
|
|
}
|
2005-07-18 01:52:59 +03:00
|
|
|
@touch $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@
|
2005-03-06 05:34:52 +02:00
|
|
|
|
|
|
|
%-clean:
|
2005-10-22 03:06:20 +03:00
|
|
|
$(TRACE) toolchain/$(patsubst %-clean,%,$@)/clean
|
2005-03-06 05:34:52 +02: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
|
|
|
|