2003-02-12 11:40:28 +01:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# file
|
|
|
|
#
|
|
|
|
#############################################################
|
2008-09-02 15:54:55 +02:00
|
|
|
FILE_VERSION:=4.26
|
|
|
|
FILE_SOURCE:=file-$(FILE_VERSION).tar.gz
|
|
|
|
FILE_SITE:=ftp://ftp.astron.com/pub/file/
|
2007-07-11 16:06:06 +02:00
|
|
|
FILE_SOURCE_DIR:=$(BUILD_DIR)/file-$(FILE_VERSION)
|
2009-09-23 01:30:00 +02:00
|
|
|
FILE_DIR1:=$(TOOLCHAIN_DIR)/file-$(FILE_VERSION)-host
|
2007-07-11 16:06:06 +02:00
|
|
|
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):
|
2009-01-16 12:42:52 +01:00
|
|
|
$(call DOWNLOAD,$(FILE_SITE),$(FILE_SOURCE))
|
2003-02-12 11:40:28 +01:00
|
|
|
|
|
|
|
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)" \
|
2009-10-01 21:24:42 +02:00
|
|
|
$(FILE_SOURCE_DIR)/configure $(QUIET) \
|
2005-08-30 05:35:37 +02:00
|
|
|
--prefix=$(FILE_DIR1)/install \
|
2007-08-21 21:20:18 +02:00
|
|
|
)
|
2007-09-17 14:30:31 +02:00
|
|
|
touch $@
|
2005-08-30 05:35:37 +02:00
|
|
|
|
2009-09-23 01:30:00 +02:00
|
|
|
$(TOOLCHAIN_DIR)/bin/file: $(FILE_DIR1)/.configured
|
2005-08-30 05:35:37 +02:00
|
|
|
$(MAKE) -C $(FILE_DIR1) install
|
2009-09-23 01:30:00 +02:00
|
|
|
ln -sf $(FILE_DIR1)/install/bin/file $(TOOLCHAIN_DIR)/bin/file
|
2005-08-30 05:35:37 +02:00
|
|
|
|
2009-09-23 01:30:00 +02:00
|
|
|
host-file: $(TOOLCHAIN_DIR)/bin/file
|
2005-08-30 05:35:37 +02:00
|
|
|
|
|
|
|
host-file-clean:
|
2008-03-27 16:42:42 +01:00
|
|
|
-$(MAKE) -C $(FILE_DIR1) clean
|
2005-08-30 05:35:37 +02:00
|
|
|
|
|
|
|
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)
|
2007-09-17 14:30:31 +02:00
|
|
|
touch $@
|
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) \
|
2009-10-01 21:24:42 +02:00
|
|
|
$(FILE_SOURCE_DIR)/configure $(QUIET) \
|
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 \
|
2007-09-17 14:30:31 +02:00
|
|
|
--mandir=/usr/share/man \
|
|
|
|
--infodir=/usr/share/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 \
|
2007-08-21 21:20:18 +02:00
|
|
|
)
|
2007-09-17 14:30:31 +02:00
|
|
|
touch $@
|
2003-02-12 11:40:28 +01:00
|
|
|
|
2009-09-23 01:30:00 +02:00
|
|
|
$(FILE_DIR2)/$(FILE_BINARY): $(FILE_DIR2)/.configured $(TOOLCHAIN_DIR)/bin/file
|
2008-07-04 22:35:41 +02:00
|
|
|
ln -sf $(FILE_DIR1)/install/bin/file $(FILE_DIR2)/magic/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
|
2007-10-01 18:15:31 +02:00
|
|
|
-($(STRIPCMD) $(TARGET_DIR)/usr/lib/libmagic.so.*.* > /dev/null 2>&1)
|
2007-09-17 14:30:31 +02:00
|
|
|
ifneq ($(BR2_HAVE_INFOPAGES),y)
|
|
|
|
rm -rf $(TARGET_DIR)/usr/share/info
|
|
|
|
endif
|
|
|
|
ifneq ($(BR2_HAVE_MANPAGES),y)
|
|
|
|
rm -rf $(TARGET_DIR)/usr/share/man
|
|
|
|
endif
|
|
|
|
rm -rf $(TARGET_DIR)/share/locale
|
|
|
|
rm -rf $(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
|
|
|
|
2009-09-02 17:02:02 +02:00
|
|
|
file: zlib $(TARGET_DIR)/$(FILE_TARGET_BINARY)
|
2003-02-12 11:40:28 +01:00
|
|
|
|
|
|
|
file-clean:
|
2008-04-01 09:03:07 +02:00
|
|
|
-$(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(FILE_DIR2) uninstall
|
2005-08-30 05:35:37 +02:00
|
|
|
-$(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
|
|
|
|
#
|
|
|
|
#############################################################
|
2008-12-08 09:15:27 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_FILE),y)
|
2005-02-10 04:06:39 +01:00
|
|
|
TARGETS+=file
|
|
|
|
endif
|