kumquat-buildroot/package/zlib/zlib.mk

100 lines
2.9 KiB
Makefile
Raw Normal View History

2002-05-11 07:48:55 +02:00
#############################################################
#
# zlib
#
#############################################################
ZLIB_VERSION:=1.2.3
ZLIB_SOURCE:=zlib-$(ZLIB_VERSION).tar.bz2
2006-11-17 16:43:51 +01:00
ZLIB_CAT:=$(BZCAT)
2007-06-29 10:18:13 +02:00
ZLIB_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/libpng
ZLIB_DIR:=$(BUILD_DIR)/zlib-$(ZLIB_VERSION)
2002-05-11 07:48:55 +02:00
$(DL_DIR)/$(ZLIB_SOURCE):
2009-01-16 12:42:52 +01:00
$(call DOWNLOAD,$(ZLIB_SITE),$(ZLIB_SOURCE))
2002-05-11 07:48:55 +02:00
$(ZLIB_DIR)/.patched: $(DL_DIR)/$(ZLIB_SOURCE)
2006-11-17 16:43:51 +01:00
$(ZLIB_CAT) $(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
$(CONFIG_UPDATE) $(@D)
touch $@
2002-05-11 07:48:55 +02:00
ifneq ($(BR2_PREFER_STATIC_LIB),y)
ZLIB_PIC := -fPIC
ZLIB_SHARED := --shared
ZLIB_TARGET := $(TARGET_DIR)/usr/lib/libz.so
else
ZLIB_PIC :=
ZLIB_SHARED :=
ZLIB_TARGET := $(STAGING_DIR)/usr/lib/libz.a
endif
$(ZLIB_DIR)/.configured: $(ZLIB_DIR)/.patched
2007-08-22 11:56:41 +02:00
(cd $(ZLIB_DIR); rm -rf config.cache; \
$(TARGET_CONFIGURE_ARGS) \
2005-08-31 00:46:58 +02:00
$(TARGET_CONFIGURE_OPTS) \
CFLAGS="$(TARGET_CFLAGS) $(ZLIB_PIC)" \
./configure \
$(ZLIB_SHARED) \
--prefix=/usr \
--exec-prefix=$(STAGING_DIR)/usr/bin \
--libdir=$(STAGING_DIR)/usr/lib \
--includedir=$(STAGING_DIR)/usr/include \
2007-06-29 10:18:13 +02:00
)
touch $@
2002-05-11 07:48:55 +02:00
$(ZLIB_DIR)/libz.a: $(ZLIB_DIR)/.configured
2005-08-31 00:46:58 +02:00
$(MAKE) -C $(ZLIB_DIR) all libz.a
2008-07-17 15:19:54 +02:00
touch -c $@
2002-05-11 07:48:55 +02:00
$(STAGING_DIR)/usr/lib/libz.a: $(ZLIB_DIR)/libz.a
$(INSTALL) -D $(ZLIB_DIR)/libz.a $(STAGING_DIR)/usr/lib/libz.a
$(INSTALL) -D $(ZLIB_DIR)/zlib.h $(STAGING_DIR)/usr/include/zlib.h
$(INSTALL) $(ZLIB_DIR)/zconf.h $(STAGING_DIR)/usr/include/
touch -c $@
$(STAGING_DIR)/usr/lib/libz.so: $(STAGING_DIR)/usr/lib/libz.a
cp -dpf $(ZLIB_DIR)/libz.so* $(STAGING_DIR)/usr/lib/
touch -c $@
2002-05-11 07:48:55 +02:00
2008-07-17 15:19:54 +02:00
$(TARGET_DIR)/usr/lib/libz.so: $(STAGING_DIR)/usr/lib/libz.so
mkdir -p $(TARGET_DIR)/usr/lib
cp -dpf $(STAGING_DIR)/usr/lib/libz.so* $(TARGET_DIR)/usr/lib
2008-07-17 15:19:54 +02:00
-$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $@
touch -c $@
2002-05-11 07:48:55 +02:00
$(TARGET_DIR)/usr/lib/libz.a: $(STAGING_DIR)/usr/lib/libz.a
$(INSTALL) -D $(STAGING_DIR)/usr/include/zlib.h $(TARGET_DIR)/usr/include/zlib.h
$(INSTALL) $(STAGING_DIR)/usr/include/zconf.h $(TARGET_DIR)/usr/include/
$(INSTALL) -D $(STAGING_DIR)/usr/lib/libz.a $(TARGET_DIR)/usr/lib/libz.a
touch -c $@
zlib-headers: $(TARGET_DIR)/usr/lib/libz.a
zlib: $(ZLIB_TARGET)
2002-05-11 07:48:55 +02:00
zlib-source: $(DL_DIR)/$(ZLIB_SOURCE)
2002-05-11 07:48:55 +02:00
zlib-clean:
2008-07-17 15:19:54 +02:00
rm -f $(TARGET_DIR)/usr/lib/libz.* \
$(TARGET_DIR)/usr/include/zlib.h \
$(TARGET_DIR)/usr/include/zconf.h \
$(STAGING_DIR)/usr/include/zlib.h \
$(STAGING_DIR)/usr/include/zconf.h \
$(STAGING_DIR)/usr/lib/libz.*
-$(MAKE) -C $(ZLIB_DIR) clean
2002-05-11 07:48:55 +02:00
zlib-dirclean:
rm -rf $(ZLIB_DIR)
#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(BR2_PACKAGE_ZLIB),y)
TARGETS+=zlib
endif
ifeq ($(BR2_PACKAGE_ZLIB_TARGET_HEADERS),y)
TARGETS+=zlib-headers
endif