2003-02-12 11:40:28 +01:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# file
|
|
|
|
#
|
|
|
|
#############################################################
|
2007-07-11 16:06:06 +02:00
|
|
|
FILE_VERSION:=4.21
|
2007-08-05 14:10:35 +02:00
|
|
|
FILE_SOURCE:=file_$(FILE_VERSION).orig.tar.gz
|
|
|
|
FILE_SITE:=http://ftp.debian.org/debian/pool/main/f/file
|
2007-07-11 16:06:06 +02:00
|
|
|
FILE_SOURCE_DIR:=$(BUILD_DIR)/file-$(FILE_VERSION)
|
|
|
|
FILE_DIR1:=$(TOOL_BUILD_DIR)/file-$(FILE_VERSION)-host
|
|
|
|
FILE_DIR2:=$(BUILD_DIR)/file-$(FILE_VERSION)-target
|
2006-10-01 17:17:52 +02:00
|
|
|
FILE_CAT:=$(ZCAT)
|
2003-10-03 03:27:09 +02:00
|
|
|
FILE_BINARY:=src/file
|
2003-02-12 11:40:28 +01:00
|
|
|
FILE_TARGET_BINARY:=usr/bin/file
|
|
|
|
|
|
|
|
$(DL_DIR)/$(FILE_SOURCE):
|
|
|
|
$(WGET) -P $(DL_DIR) $(FILE_SITE)/$(FILE_SOURCE)
|
|
|
|
|
|
|
|
file-source: $(DL_DIR)/$(FILE_SOURCE)
|
|
|
|
|
2005-08-30 05:35:37 +02:00
|
|
|
|
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# build file for use on the host system
|
|
|
|
#
|
|
|
|
#############################################################
|
2006-12-15 16:19:46 +01:00
|
|
|
$(FILE_DIR1)/.configured: $(FILE_SOURCE_DIR)/.unpacked
|
|
|
|
mkdir -p $(FILE_DIR1)
|
2005-08-30 05:35:37 +02:00
|
|
|
(cd $(FILE_DIR1); rm -rf config.cache; \
|
2006-12-15 16:19:46 +01:00
|
|
|
CC="$(HOSTCC)" \
|
|
|
|
$(FILE_SOURCE_DIR)/configure \
|
2005-08-30 05:35:37 +02:00
|
|
|
--prefix=$(FILE_DIR1)/install \
|
|
|
|
);
|
2005-11-24 07:53:24 +01:00
|
|
|
touch $(FILE_DIR1)/.configured
|
2005-08-30 05:35:37 +02:00
|
|
|
|
|
|
|
$(TOOL_BUILD_DIR)/bin/file: $(FILE_DIR1)/.configured
|
|
|
|
$(MAKE) -C $(FILE_DIR1) install
|
|
|
|
ln -sf $(FILE_DIR1)/install/bin/file $(TOOL_BUILD_DIR)/bin/file
|
|
|
|
|
|
|
|
host-file: $(TOOL_BUILD_DIR)/bin/file
|
|
|
|
|
|
|
|
host-file-clean:
|
|
|
|
$(MAKE) -C $(FILE_DIR1) clean
|
|
|
|
|
|
|
|
host-file-dirclean:
|
|
|
|
rm -rf $(FILE_DIR1)
|
|
|
|
|
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# build file for use on the target system
|
|
|
|
#
|
|
|
|
#############################################################
|
2006-12-15 16:19:46 +01:00
|
|
|
file-unpacked: $(FILE_SOURCE_DIR)/.unpacked
|
|
|
|
$(FILE_SOURCE_DIR)/.unpacked: $(DL_DIR)/$(FILE_SOURCE)
|
2004-10-09 23:19:47 +02:00
|
|
|
$(FILE_CAT) $(DL_DIR)/$(FILE_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
|
2006-12-15 16:19:46 +01:00
|
|
|
toolchain/patch-kernel.sh $(FILE_SOURCE_DIR) package/file/ file\*.patch
|
2007-03-07 15:32:22 +01:00
|
|
|
$(CONFIG_UPDATE) $(FILE_SOURCE_DIR)
|
2006-12-15 16:19:46 +01:00
|
|
|
touch $(FILE_SOURCE_DIR)/.unpacked
|
2003-02-12 11:40:28 +01:00
|
|
|
|
2006-12-15 16:19:46 +01:00
|
|
|
$(FILE_DIR2)/.configured: $(FILE_SOURCE_DIR)/.unpacked
|
|
|
|
mkdir -p $(FILE_DIR2)
|
2005-08-30 05:35:37 +02:00
|
|
|
(cd $(FILE_DIR2); rm -rf config.cache; \
|
2003-03-04 20:16:19 +01:00
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
2007-06-27 14:01:27 +02:00
|
|
|
$(TARGET_CONFIGURE_ARGS) \
|
2006-12-15 16:19:46 +01:00
|
|
|
$(FILE_SOURCE_DIR)/configure \
|
2003-02-12 11:40:28 +01:00
|
|
|
--target=$(GNU_TARGET_NAME) \
|
2003-03-04 20:16:19 +01:00
|
|
|
--host=$(GNU_TARGET_NAME) \
|
|
|
|
--build=$(GNU_HOST_NAME) \
|
2003-02-12 11:40:28 +01:00
|
|
|
--prefix=/usr \
|
|
|
|
--exec-prefix=/usr \
|
|
|
|
--bindir=/usr/bin \
|
|
|
|
--sbindir=/usr/sbin \
|
2007-01-14 04:52:21 +01:00
|
|
|
--libdir=/lib \
|
2003-02-12 11:40:28 +01:00
|
|
|
--libexecdir=/usr/lib \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--datadir=/usr/share/misc \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--mandir=/usr/man \
|
|
|
|
--infodir=/usr/info \
|
2003-09-03 09:18:18 +02:00
|
|
|
$(DISABLE_NLS) \
|
2003-11-17 02:31:38 +01:00
|
|
|
$(DISABLE_LARGEFILE) \
|
2004-07-30 01:44:44 +02:00
|
|
|
--enable-static \
|
2003-10-03 03:27:09 +02:00
|
|
|
--disable-fsect-man5 \
|
2003-02-12 11:40:28 +01:00
|
|
|
);
|
2005-11-24 07:53:24 +01:00
|
|
|
touch $(FILE_DIR2)/.configured
|
2003-02-12 11:40:28 +01:00
|
|
|
|
2005-09-08 02:03:33 +02:00
|
|
|
$(FILE_DIR2)/$(FILE_BINARY): $(FILE_DIR2)/.configured $(TOOL_BUILD_DIR)/bin/file
|
2007-07-06 06:26:32 +02:00
|
|
|
$(MAKE) $(TARGET_CONFIGURE_OPTS) LDFLAGS="-static" -C $(FILE_DIR2)
|
2003-02-12 11:40:28 +01:00
|
|
|
|
2005-08-30 05:35:37 +02:00
|
|
|
$(TARGET_DIR)/$(FILE_TARGET_BINARY): $(FILE_DIR2)/$(FILE_BINARY)
|
2007-07-06 06:26:32 +02:00
|
|
|
$(MAKE) $(TARGET_CONFIGURE_OPTS) DESTDIR=$(TARGET_DIR) -C $(FILE_DIR2) install
|
2003-11-01 06:34:41 +01:00
|
|
|
-($(STRIP) $(TARGET_DIR)/usr/lib/libmagic.so.*.* > /dev/null 2>&1)
|
2003-02-12 11:40:28 +01:00
|
|
|
rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
|
|
|
|
$(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
|
2007-01-16 01:33:24 +01:00
|
|
|
mv $(TARGET_DIR)/lib/libmagic.a $(STAGING_DIR)/lib
|
|
|
|
rm -f $(TARGET_DIR)/lib/libmagic.la
|
2007-07-07 13:06:08 +02:00
|
|
|
mv $(TARGET_DIR)/usr/include/magic.h $(STAGING_DIR)/usr/include
|
2003-02-12 11:40:28 +01:00
|
|
|
|
2003-02-19 10:59:24 +01:00
|
|
|
file: zlib uclibc $(TARGET_DIR)/$(FILE_TARGET_BINARY)
|
2003-02-12 11:40:28 +01:00
|
|
|
|
|
|
|
file-clean:
|
2005-08-30 05:35:37 +02:00
|
|
|
$(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(FILE_DIR2) uninstall
|
|
|
|
-$(MAKE) -C $(FILE_DIR2) clean
|
2003-02-12 11:40:28 +01:00
|
|
|
|
|
|
|
file-dirclean:
|
2005-08-30 05:35:37 +02:00
|
|
|
rm -rf $(FILE_DIR2)
|
2003-02-12 11:40:28 +01:00
|
|
|
|
2005-02-10 04:06:39 +01:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# Toplevel Makefile options
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
ifeq ($(strip $(BR2_PACKAGE_FILE)),y)
|
|
|
|
TARGETS+=file
|
|
|
|
endif
|