]> git.saurik.com Git - wxWidgets.git/blame - src/png/scripts/makefile.knr
Add instructions for upgrading third party libraries.
[wxWidgets.git] / src / png / scripts / makefile.knr
CommitLineData
0272a10d 1# makefile for libpng
b61cc19c 2# Copyright (C) 2002, 2006, 2009 Glenn Randers-Pehrson
0272a10d 3# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
b61cc19c
PC
4#
5# This code is released under the libpng license.
6# For conditions of distribution and use, see the disclaimer
7# and license in png.h
8#
0272a10d
VZ
9# This makefile requires the file ansi2knr.c, which you can get
10# from the Ghostscript ftp site at ftp://ftp.cs.wisc.edu/ghost/
11# If you have libjpeg, you probably already have ansi2knr.c in the jpeg
12# source distribution.
13
14# where make install puts libpng.a and png.h
15prefix=/usr/local
16INCPATH=$(prefix)/include
17LIBPATH=$(prefix)/lib
18
19# override DESTDIR= on the make install command line to easily support
20# installing into a temporary location. Example:
21#
22# make install DESTDIR=/tmp/build/libpng
23#
24# If you're going to install into a temporary location
25# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
26# you execute make install.
27DESTDIR=
28
29CC=cc
30CFLAGS=-I../zlib -O
31LDFLAGS=-L. -L../zlib/ -lpng -lz -lm
32# flags for ansi2knr
33ANSI2KNRFLAGS=
34
35RANLIB=ranlib
36#RANLIB=echo
37
38OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
39 pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
40 pngwtran.o pngmem.o pngerror.o pngpread.o
41
42all: ansi2knr libpng.a pngtest
43
9c0d9ce3
DS
44# see scripts/pnglibconf.mak for more options
45pnglibconf.h: scripts/pnglibconf.h.prebuilt
46 cp scripts/pnglibconf.h.prebuilt $@
47
0272a10d
VZ
48# general rule to allow ansi2knr to work
49.c.o:
50 ./ansi2knr $*.c T$*.c
51 $(CC) $(CFLAGS) -c T$*.c
52 rm -f T$*.c $*.o
53 mv T$*.o $*.o
54
55ansi2knr: ansi2knr.c
56 $(CC) $(CFLAGS) $(ANSI2KNRFLAGS) -o ansi2knr ansi2knr.c
57
58libpng.a: ansi2knr $(OBJS)
59 ar rc $@ $(OBJS)
60 $(RANLIB) $@
61
62pngtest: pngtest.o libpng.a
63 $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
64
65test: pngtest
66 ./pngtest
67
9c0d9ce3 68install: libpng.a png.h pngconf.h pnglibconf.h
0272a10d
VZ
69 -@mkdir $(DESTDIR)$(INCPATH)
70 -@mkdir $(DESTDIR)$(INCPATH)/libpng
71 -@mkdir $(DESTDIR)$(LIBPATH)
72 -@rm -f $(DESTDIR)$(INCPATH)/png.h
73 -@rm -f $(DESTDIR)$(INCPATH)/pngconf.h
74 cp png.h $(DESTDIR)$(INCPATH)/libpng
75 cp pngconf.h $(DESTDIR)$(INCPATH)/libpng
9c0d9ce3 76 cp pnglibconf.h $(DESTDIR)$(INCPATH)/libpng
0272a10d
VZ
77 chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h
78 chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h
9c0d9ce3 79 chmod 644 $(DESTDIR)$(INCPATH)/libpng/pnglibconf.h
0272a10d
VZ
80 (cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .)
81 cp libpng.a $(DESTDIR)$(LIBPATH)
82 chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a
83
84clean:
9c0d9ce3 85 rm -f *.o libpng.a pngtest pngout.png ansi2knr pnglibconf.h
0272a10d
VZ
86
87DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
88writelock:
89 chmod a-w *.[ch35] $(DOCS) scripts/*
90
91# DO NOT DELETE THIS LINE -- make depend depends on it.
92
9c0d9ce3
DS
93png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
94pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
95pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
96pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
97pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
98pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
99pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
100pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
101pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
102pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
103pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
104pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
105pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
106pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
107pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
108
109pngtest.o: png.h pngconf.h pnglibconf.h