download: $(TARGETS_DOWNLOAD)
install: $(TARGETS_INSTALL)
clean: $(TARGETS_CLEAN)
+$(TARGETS_INSTALL): $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)
uClibc-prepare: kernel-headers-prepare
ifeq ($(CONFIG_NATIVE_TOOLCHAIN),)
TOOLCHAIN_STAMP_DIR:=$(STAGING_DIR)/stampfiles
+$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME):
+ @mkdir -p $@
+ @ln -sf ../lib $@/lib
+
$(TOOLCHAIN_STAMP_DIR):
mkdir -p $@
%-download: FORCE
$(MAKE) -C $(patsubst %-download,%,$@) download
-%-prepare: $(TOOLCHAIN_STAMP_DIR) $(STAGING_DIR) $(TOOLCHAIN_BUILD_DIR) FORCE
+%-prepare: $(TOOLCHAIN_STAMP_DIR) $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME) $(TOOLCHAIN_BUILD_DIR) FORCE
@[ -f $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@ ] || { \
$(MAKE) -C $(patsubst %-prepare,%,$@) prepare; \
}
TARGETS-y:=sed sstrip ipkg-utils ext2fs squashfs mtd-utils lzma mkimage
TARGETS_DOWNLOAD:=$(patsubst %,%-download,$(TARGETS-y))
+TARGETS_PREPARE:=$(patsubst %,%-prepare,$(TARGETS-y))
TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS-y))
TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS-y))
$(TOOL_STAMP_DIR):
mkdir -p $@
-$(STAGING_DIR):
- @mkdir -p $@/lib
- @mkdir -p $@/include
- @mkdir -p $@/include-host
- $(CP) ./include/*.h $@/include-host/
- @ln -sf ../lib $@/$(REAL_GNU_TARGET_NAME)/lib
- @mkdir -p $@/$(REAL_GNU_TARGET_NAME)
+$(STAGING_DIR)/include-host:
+ @mkdir -p $@
+ @$(CP) ./include/*.h $@/
$(TOOL_BUILD_DIR):
@mkdir -p $@
%-download: FORCE
$(MAKE) -C $(patsubst %-download,%,$@) download
-%-prepare: $(TOOL_STAMP_DIR) $(STAGING_DIR) $(TOOL_BUILD_DIR) FORCE
+%-prepare: $(TOOL_STAMP_DIR) $(STAGING_DIR)/include-host $(TOOL_BUILD_DIR) FORCE
@[ -f $(TOOL_STAMP_DIR)/.tool_$@ ] || { \
$(MAKE) -C $(patsubst %-prepare,%,$@) prepare; \
}