add libpng
[openwrt.git] / package / libpng / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME := libpng
6 PKG_VERSION := 1.2.8
7 PKG_RELEASE := 1
8 PKG_MD5SUM := e5a39003eed16103cbbd3b6a8bc6b1f9
9
10 PKG_SOURCE_SITE := @SF/libpng
11 PKG_SOURCE_FILE := $(PKG_NAME)-$(PKG_VERSION)-config.tar.gz
12 PKG_SOURCE_DIR := $(PKG_NAME)-$(PKG_VERSION)-config
13 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_SOURCE_DIR)
14 PKG_IPK := $(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
15 PKG_CAT := zcat
16 PKG_IPK_DIR := $(PKG_BUILD_DIR)/ipkg
17
18 $(DL_DIR)/$(PKG_SOURCE_FILE):
19 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE_FILE) $(PKG_MD5SUM) $(PKG_SOURCE_SITE)
20
21 $(PKG_BUILD_DIR)/.prepared: $(DL_DIR)/$(PKG_SOURCE_FILE)
22 $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE_FILE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
23 $(PATCH) $(PKG_BUILD_DIR) ./patches
24 touch $(PKG_BUILD_DIR)/.prepared
25
26 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
27 (cd $(PKG_BUILD_DIR); \
28 $(TARGET_CONFIGURE_OPTS) \
29 CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \
30 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
31 ./configure \
32 --target=$(GNU_TARGET_NAME) \
33 --host=$(GNU_TARGET_NAME) \
34 --build=$(GNU_HOST_NAME) \
35 --prefix=/usr \
36 --exec-prefix=/usr \
37 --bindir=/usr/bin \
38 --sbindir=/usr/sbin \
39 --libexecdir=/usr/lib \
40 --datadir=/usr/share \
41 --infodir=/usr/share/info \
42 --mandir=/usr/share/man \
43 --localstatedir=/var \
44 --sysconfdir=/etc \
45 --with-zlib=$(STAGING_DIR)/usr/ \
46 $(DISABLE_NLS) \
47 )
48 touch $(PKG_BUILD_DIR)/.configured
49
50 $(PKG_BUILD_DIR)/.libs/libpng.so: $(PKG_BUILD_DIR)/.configured
51 $(MAKE) -C $(PKG_BUILD_DIR) \
52 CC=$(TARGET_CC) \
53 CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include -L$(STAGING_DIR)/usr/lib" \
54 all
55
56 $(STAGING_DIR)/usr/lib/libpng.so: $(PKG_BUILD_DIR)/.libs/libpng.so
57 $(MAKE) -C $(PKG_BUILD_DIR) \
58 DESTDIR="$(STAGING_DIR)" \
59 install-libLTLIBRARIES install-includeHEADERS install-binSCRIPTS
60
61 $(PKG_IPK): $(PKG_BUILD_DIR)/.libs/libpng.so
62 $(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_IPK_DIR) $(PKG_NAME).control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
63 mkdir -p $(PKG_IPK_DIR)/usr/lib
64 cp -a $(PKG_BUILD_DIR)/.libs/*.so* $(PKG_IPK_DIR)/usr/lib/
65 $(STRIP) $(PKG_IPK_DIR)/usr/lib/*
66 find $(PKG_IPK_DIR) -name CVS | xargs rm -rf
67 mkdir -p $(PACKAGE_DIR)
68 $(IPKG_BUILD) $(PKG_IPK_DIR) $(PACKAGE_DIR)
69
70 $(IPKG_STATE_DIR)/info/libpng.list: $(PKG_IPK)
71 $(IPKG) install $(PKG_IPK)
72
73 source: $(DL_DIR)/$(PKG_SOURCE)
74 prepare: $(PKG_BUILD_DIR)/.prepared
75 compile: $(STAGING_DIR)/usr/lib/libpng.so $(PKG_IPK)
76 install: $(IPKG_STATE_DIR)/info/libpng.list
77
78 clean:
79 rm -rf $(PKG_BUILD_DIR)
80 rm -f $(STAGING_DIR)/usr/bin/libpng*
81 rm -f $(STAGING_DIR)/usr/lib/libpng*
82 rm -f $(PKG_IPK)
This page took 0.050957 seconds and 5 git commands to generate.