kumquat-buildroot/package/file/file.mk

111 lines
3.2 KiB
Makefile
Raw Normal View History

2003-02-12 11:40:28 +01:00
#############################################################
#
# file
#
#############################################################
2006-04-15 04:27:01 +02:00
FILE_VER:=4.17
2004-10-08 20:02:37 +02:00
FILE_SOURCE:=file-$(FILE_VER).tar.gz
2003-02-12 11:40:28 +01:00
FILE_SITE:=ftp://ftp.astron.com/pub/file
FILE_DIR1:=$(TOOL_BUILD_DIR)/file-$(FILE_VER)
FILE_DIR2:=$(BUILD_DIR)/file-$(FILE_VER)
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)
#############################################################
#
# build file for use on the host system
#
#############################################################
$(FILE_DIR1)/.unpacked: $(DL_DIR)/$(FILE_SOURCE)
$(FILE_CAT) $(DL_DIR)/$(FILE_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
touch $(FILE_DIR1)/.unpacked
$(FILE_DIR1)/.configured: $(FILE_DIR1)/.unpacked
(cd $(FILE_DIR1); rm -rf config.cache; \
./configure \
--prefix=$(FILE_DIR1)/install \
);
2005-11-24 07:53:24 +01:00
touch $(FILE_DIR1)/.configured
$(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-02-25 07:48:20 +01:00
file-unpacked: $(FILE_DIR2)/.unpacked
$(FILE_DIR2)/.unpacked: $(DL_DIR)/$(FILE_SOURCE)
$(FILE_CAT) $(DL_DIR)/$(FILE_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
toolchain/patch-kernel.sh $(FILE_DIR2) package/file/ file\*.patch
2005-11-24 07:53:24 +01:00
touch $(FILE_DIR2)/.unpacked
2003-02-12 11:40:28 +01:00
$(FILE_DIR2)/.configured: $(FILE_DIR2)/.unpacked
(cd $(FILE_DIR2); rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) \
CFLAGS="$(TARGET_CFLAGS)" \
2003-02-12 11:40:28 +01:00
./configure \
--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 \
--libexecdir=/usr/lib \
--sysconfdir=/etc \
--datadir=/usr/share/misc \
--localstatedir=/var \
--mandir=/usr/man \
--infodir=/usr/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 \
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
$(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
-($(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
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:
$(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 ($(strip $(BR2_PACKAGE_FILE)),y)
TARGETS+=file
endif