kumquat-buildroot/package/zlib/zlib.mk

86 lines
2.8 KiB
Makefile
Raw Normal View History

2002-05-11 07:48:55 +02:00
#############################################################
#
# zlib
#
#############################################################
ZLIB_VER=1.2.3
ZLIB_SOURCE=zlib-$(ZLIB_VER).tar.bz2
ZLIB_SITE=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/libpng
ZLIB_DIR=$(BUILD_DIR)/zlib-$(ZLIB_VER)
ZLIB_CFLAGS= $(TARGET_CFLAGS) -fPIC
ifeq ($(BR2_LARGEFILE),y)
ZLIB_CFLAGS+= -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
2002-05-11 07:48:55 +02:00
endif
$(DL_DIR)/$(ZLIB_SOURCE):
$(WGET) -P $(DL_DIR) $(ZLIB_SITE)/$(ZLIB_SOURCE)
2002-05-11 07:48:55 +02:00
$(ZLIB_DIR)/.source: $(DL_DIR)/$(ZLIB_SOURCE)
bzcat $(DL_DIR)/$(ZLIB_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
2005-08-31 00:46:58 +02:00
toolchain/patch-kernel.sh $(ZLIB_DIR) package/zlib/ zlib\*.patch
2002-05-11 07:48:55 +02:00
touch $(ZLIB_DIR)/.source
$(ZLIB_DIR)/.configured: $(ZLIB_DIR)/.source
(cd $(ZLIB_DIR); \
2005-08-31 00:46:58 +02:00
$(TARGET_CONFIGURE_OPTS) \
./configure \
--shared \
--prefix=/usr \
--exec-prefix=$(STAGING_DIR)/usr/bin \
--libdir=$(STAGING_DIR)/lib \
--includedir=$(STAGING_DIR)/include \
);
2002-05-11 07:48:55 +02:00
touch $(ZLIB_DIR)/.configured;
$(ZLIB_DIR)/libz.so.$(ZLIB_VER): $(ZLIB_DIR)/.configured
2005-08-31 00:46:58 +02:00
$(MAKE) -C $(ZLIB_DIR) all libz.a
touch -c $(ZLIB_DIR)/libz.so.$(ZLIB_VER)
2002-05-11 07:48:55 +02:00
$(STAGING_DIR)/lib/libz.so.$(ZLIB_VER): $(ZLIB_DIR)/libz.so.$(ZLIB_VER)
2003-01-19 01:57:10 +01:00
cp -dpf $(ZLIB_DIR)/libz.a $(STAGING_DIR)/lib;
cp -dpf $(ZLIB_DIR)/zlib.h $(STAGING_DIR)/include;
cp -dpf $(ZLIB_DIR)/zconf.h $(STAGING_DIR)/include;
cp -dpf $(ZLIB_DIR)/libz.so* $(STAGING_DIR)/lib;
(cd $(STAGING_DIR)/lib; ln -fs libz.so.$(ZLIB_VER) libz.so.1);
chmod a-x $(STAGING_DIR)/lib/libz.so.$(ZLIB_VER)
touch -c $(STAGING_DIR)/lib/libz.so.$(ZLIB_VER)
2002-05-11 07:48:55 +02:00
$(TARGET_DIR)/lib/libz.so.$(ZLIB_VER): $(STAGING_DIR)/lib/libz.so.$(ZLIB_VER)
2003-01-19 01:57:10 +01:00
cp -dpf $(STAGING_DIR)/lib/libz.so* $(TARGET_DIR)/lib;
2002-05-11 07:48:55 +02:00
-$(STRIP) --strip-unneeded $(TARGET_DIR)/lib/libz.so*
touch -c $(TARGET_DIR)/lib/libz.so.$(ZLIB_VER)
2002-05-11 07:48:55 +02:00
$(TARGET_DIR)/usr/lib/libz.a: $(STAGING_DIR)/lib/libz.so.$(ZLIB_VER)
mkdir -p $(TARGET_DIR)/usr/include
2003-01-19 01:57:10 +01:00
cp -dpf $(STAGING_DIR)/include/zlib.h $(TARGET_DIR)/usr/include/
cp -dpf $(STAGING_DIR)/include/zconf.h $(TARGET_DIR)/usr/include/
cp -dpf $(STAGING_DIR)/lib/libz.a $(TARGET_DIR)/usr/lib/
2003-02-12 09:10:40 +01:00
rm -f $(TARGET_DIR)/lib/libz.so
(cd $(TARGET_DIR)/usr/lib; ln -fs ../../lib/libz.so.$(ZLIB_VER) libz.so)
2003-01-20 20:24:02 +01:00
touch -c $(TARGET_DIR)/usr/lib/libz.a
zlib-headers: $(TARGET_DIR)/usr/lib/libz.a
zlib: uclibc $(TARGET_DIR)/lib/libz.so.$(ZLIB_VER)
2002-05-11 07:48:55 +02:00
zlib-source: $(DL_DIR)/$(ZLIB_SOURCE)
2002-05-11 07:48:55 +02:00
zlib-clean:
rm -f $(TARGET_DIR)/lib/libz.so*
-$(MAKE) -C $(ZLIB_DIR) clean
2002-05-11 07:48:55 +02:00
zlib-dirclean:
rm -rf $(ZLIB_DIR)
#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(strip $(BR2_PACKAGE_ZLIB)),y)
TARGETS+=zlib
endif
ifeq ($(strip $(BR2_PACKAGE_ZLIB_TARGET_HEADERS)),y)
TARGETS+=zlib-headers
endif