fix gene2fs build on freebsd
authorFelix Fietkau <nbd@openwrt.org>
Tue, 10 Oct 2006 16:36:47 +0000 (16:36 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 10 Oct 2006 16:36:47 +0000 (16:36 +0000)
SVN-Revision: 5019

openwrt/toolchain/Makefile
openwrt/tools/Makefile
openwrt/tools/ext2fs/Makefile

index ed563f00ed5ca4921f21d648cf09affa596df29f..2d8d88219da78ee764f8b76f9d30eee8eac4ef1e 100644 (file)
@@ -22,6 +22,7 @@ all: install
 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),)
@@ -34,6 +35,10 @@ gcc-install: uClibc-install
 
 TOOLCHAIN_STAMP_DIR:=$(STAGING_DIR)/stampfiles
 
+$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME):
+       @mkdir -p $@
+       @ln -sf ../lib $@/lib
+
 $(TOOLCHAIN_STAMP_DIR):
        mkdir -p $@
 
@@ -43,7 +48,7 @@ $(TOOLCHAIN_BUILD_DIR):
 %-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; \
        }
index 741fd48f6af27f314e3ae1d7edee2b91632e3e03..c8fad2323683df3d62275ea3981b38fbebe41e08 100644 (file)
@@ -10,6 +10,7 @@ include $(TOPDIR)/rules.mk
 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))
 
@@ -25,13 +26,9 @@ TOOL_STAMP_DIR:=$(STAGING_DIR)/stampfiles
 $(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 $@
@@ -39,7 +36,7 @@ $(TOOL_BUILD_DIR):
 %-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; \
        }
index dd60a7eb9a520b47b4f7997fcbef476b1dc34234..f10adbb6c3c237ee1db28d919d6cb717d3857838 100644 (file)
@@ -42,7 +42,9 @@ define Build/Configure
 endef
 
 define Build/Compile
-       $(MAKE) -C $(PKG_BUILD_DIR) all
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               CFLAGS="-O2 -I $(STAGING_DIR)/include-host -include getline.h" \
+               all
 endef
 
 define Build/Install