kumquat-buildroot/package/file/file.mk

123 lines
3.5 KiB
Makefile
Raw Normal View History

2003-02-12 11:40:28 +01:00
#############################################################
#
# file
#
#############################################################
FILE_VERSION:=4.26
FILE_SOURCE:=file-$(FILE_VERSION).tar.gz
FILE_SITE:=ftp://ftp.astron.com/pub/file/
FILE_SOURCE_DIR:=$(BUILD_DIR)/file-$(FILE_VERSION)
FILE_DIR1:=$(TOOLCHAIN_DIR)/file-$(FILE_VERSION)-host
FILE_DIR2:=$(BUILD_DIR)/file-$(FILE_VERSION)-target
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)
#############################################################
#
# build file for use on the host system
#
#############################################################
$(FILE_DIR1)/.configured: $(FILE_SOURCE_DIR)/.unpacked
mkdir -p $(FILE_DIR1)
(cd $(FILE_DIR1); rm -rf config.cache; \
CC="$(HOSTCC)" \
$(FILE_SOURCE_DIR)/configure $(QUIET) \
--prefix=$(FILE_DIR1)/install \
)
touch $@
$(TOOLCHAIN_DIR)/bin/file: $(FILE_DIR1)/.configured
$(MAKE) -C $(FILE_DIR1) install
ln -sf $(FILE_DIR1)/install/bin/file $(TOOLCHAIN_DIR)/bin/file
host-file: $(TOOLCHAIN_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
#
#############################################################
file-unpacked: $(FILE_SOURCE_DIR)/.unpacked
$(FILE_SOURCE_DIR)/.unpacked: $(DL_DIR)/$(FILE_SOURCE)
$(FILE_CAT) $(DL_DIR)/$(FILE_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
toolchain/patch-kernel.sh $(FILE_SOURCE_DIR) package/file/ file\*.patch
$(CONFIG_UPDATE) $(FILE_SOURCE_DIR)
touch $@
2003-02-12 11:40:28 +01:00
$(FILE_DIR2)/.configured: $(FILE_SOURCE_DIR)/.unpacked
mkdir -p $(FILE_DIR2)
(cd $(FILE_DIR2); rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) \
$(TARGET_CONFIGURE_ARGS) \
$(FILE_SOURCE_DIR)/configure $(QUIET) \
2003-02-12 11:40:28 +01:00
--target=$(GNU_TARGET_NAME) \
--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 \
--libdir=/lib \
2003-02-12 11:40:28 +01:00
--libexecdir=/usr/lib \
--sysconfdir=/etc \
--datadir=/usr/share/misc \
--localstatedir=/var \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
$(DISABLE_NLS) \
$(DISABLE_LARGEFILE) \
2004-07-30 01:44:44 +02:00
--enable-static \
2003-10-03 03:27:09 +02:00
--disable-fsect-man5 \
)
touch $@
2003-02-12 11:40:28 +01:00
$(FILE_DIR2)/$(FILE_BINARY): $(FILE_DIR2)/.configured $(TOOLCHAIN_DIR)/bin/file
ln -sf $(FILE_DIR1)/install/bin/file $(FILE_DIR2)/magic/file
$(MAKE) $(TARGET_CONFIGURE_OPTS) LDFLAGS="-static" -C $(FILE_DIR2)
2003-02-12 11:40:28 +01:00
$(TARGET_DIR)/$(FILE_TARGET_BINARY): $(FILE_DIR2)/$(FILE_BINARY)
$(MAKE) $(TARGET_CONFIGURE_OPTS) DESTDIR=$(TARGET_DIR) -C $(FILE_DIR2) install
-($(STRIPCMD) $(TARGET_DIR)/usr/lib/libmagic.so.*.* > /dev/null 2>&1)
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
mv $(TARGET_DIR)/lib/libmagic.a $(STAGING_DIR)/lib
rm -f $(TARGET_DIR)/lib/libmagic.la
mv $(TARGET_DIR)/usr/include/magic.h $(STAGING_DIR)/usr/include
2003-02-12 11:40:28 +01:00
file: zlib $(TARGET_DIR)/$(FILE_TARGET_BINARY)
2003-02-12 11:40:28 +01:00
file-clean:
-$(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:
rm -rf $(FILE_DIR2)
2003-02-12 11:40:28 +01:00
#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(BR2_PACKAGE_FILE),y)
TARGETS+=file
endif