Tcl installs private headers. Also, make installation nicer.
[gumsense-br.git] / package / libpng / libpng.mk
blob0fc98df83aa2d47c8a3d9d39c7ea5eec67b4e063
1 #############################################################
3 # libpng (Portable Network Graphic library)
5 #############################################################
6 # Copyright (C) 2001-2003 by Erik Andersen <andersen@codepoet.org>
7 # Copyright (C) 2002 by Tim Riker <Tim@Rikers.org>
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU Library General Public License as
11 # published by the Free Software Foundation; either version 2 of the
12 # License, or (at your option) any later version.
14 # This program is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # Library General Public License for more details.
19 # You should have received a copy of the GNU Library General Public
20 # License along with this program; if not, write to the Free Software
21 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 # USA
24 LIBPNG_VER:=1.2.8
25 LIBPNG_DIR:=$(BUILD_DIR)/libpng-$(LIBPNG_VER)
26 LIBPNG_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/libpng
27 LIBPNG_SOURCE:=libpng-$(LIBPNG_VER).tar.bz2
28 LIBPNG_CAT:=bzcat
30 $(DL_DIR)/$(LIBPNG_SOURCE):
31 $(WGET) -P $(DL_DIR) $(LIBPNG_SITE)/$(LIBPNG_SOURCE)
33 libpng-source: $(DL_DIR)/$(LIBPNG_SOURCE)
35 $(LIBPNG_DIR)/.unpacked: $(DL_DIR)/$(LIBPNG_SOURCE)
36 $(LIBPNG_CAT) $(DL_DIR)/$(LIBPNG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
37 touch $(LIBPNG_DIR)/.unpacked
39 $(LIBPNG_DIR)/.configured: $(LIBPNG_DIR)/.unpacked
40 ( \
41 cd $(LIBPNG_DIR) ; \
42 cp scripts/makefile.linux Makefile ; \
43 $(SED) 's~prefix=/usr/local/~$(STAGING_DIR)~' Makefile ; \
44 $(SED) 's~gcc~${TARGET_CC}~' Makefile ; \
45 $(SED) "s~-O3 -funroll-loops~${TARGET_CFLAGS}~" Makefile ; \
47 touch $(LIBPNG_DIR)/.configured
49 $(LIBPNG_DIR)/.compiled: $(LIBPNG_DIR)/.configured
50 $(MAKE) -C $(LIBPNG_DIR)
51 touch $(LIBPNG_DIR)/.compiled
53 $(STAGING_DIR)/lib/libpng.so: $(LIBPNG_DIR)/.compiled
54 $(MAKE) \
55 -C $(LIBPNG_DIR) \
56 prefix=$(STAGING_DIR) \
57 exec_prefix=$(STAGING_DIR) \
58 bindir=$(STAGING_DIR)/bin \
59 datadir=$(STAGING_DIR)/share \
60 install
61 touch -c $(STAGING_DIR)/lib/libpng.so
63 $(TARGET_DIR)/usr/lib/libpng.so: $(STAGING_DIR)/lib/libpng.so
64 cp -dpf $(STAGING_DIR)/lib/libpng.so* $(TARGET_DIR)/usr/lib/
65 -$(STRIP) $(TARGET_DIR)/usr/lib/libpng.so
67 png libpng: uclibc zlib $(TARGET_DIR)/usr/lib/libpng.so
69 libpng-clean:
70 -$(MAKE) -C $(LIBPNG_DIR) clean
72 libpng-dirclean:
73 rm -rf $(LIBPNG_DIR)
75 #############################################################
77 # Toplevel Makefile options
79 #############################################################
80 ifeq ($(strip $(BR2_PACKAGE_LIBPNG)),y)
81 TARGETS+=libpng
82 endif