]> git.saurik.com Git - wxWidgets.git/blame - src/png/scripts/makefile.std
Select the entire spin control contents when changing its value.
[wxWidgets.git] / src / png / scripts / makefile.std
CommitLineData
0272a10d
VZ
1# makefile for libpng
2# Copyright (C) 2002, 2006 Glenn Randers-Pehrson
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
0272a10d
VZ
8
9# where make install puts libpng.a and png.h
10prefix=/usr/local
11INCPATH=$(prefix)/include
12LIBPATH=$(prefix)/lib
13
14# override DESTDIR= on the make install command line to easily support
15# installing into a temporary location. Example:
16#
17# make install DESTDIR=/tmp/build/libpng
18#
19# If you're going to install into a temporary location
20# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
21# you execute make install.
22DESTDIR=
23
24# Where the zlib library and include files are located
25#ZLIBLIB=/usr/local/lib
26#ZLIBINC=/usr/local/include
27ZLIBLIB=../zlib
28ZLIBINC=../zlib
29
30CC=cc
31AR_RC=ar rc
32MKDIR_P=mkdir
33LN_SF=ln -sf
34RANLIB=ranlib
35RM_F=rm -f
9c0d9ce3
DS
36AWK = awk
37SED = sed
38CPP = $(CC) -E
39ECHO = echo
0272a10d 40
9c0d9ce3 41DFNFLAGS = # DFNFLAGS contains -D options to use in the libpng build
0272a10d
VZ
42CFLAGS=-I$(ZLIBINC) -O # -g -DPNG_DEBUG=5
43LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
44
45OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
46 pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
47 pngwtran.o pngmem.o pngerror.o pngpread.o
48
49all: libpng.a pngtest
50
9c0d9ce3
DS
51# The standard pnglibconf.h exists as scripts/pnglibconf.h.prebuilt,
52# copy this if the following doesn't work.
72281370 53pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk pngconf.h
9c0d9ce3 54 $(RM_F) $@ dfn?.out
72281370 55 $(AWK) -f scripts/options.awk out=dfn1.out version=search pngconf.h\
9c0d9ce3
DS
56 scripts/pnglibconf.dfa $(DFA_XTRA) 1>&2
57 $(AWK) -f scripts/options.awk out=dfn2.out dfn1.out 1>&2
58 cp dfn2.out $@
59 $(RM_F) dfn?.out
60
61pnglibconf.h: pnglibconf.dfn
62 $(RM_F) $@ dfn.c dfn?.out
63 $(ECHO) '#include "pnglibconf.dfn"' >dfn.c
64 $(CPP) $(DFNFLAGS) dfn.c >dfn1.out
72281370 65 $(SED) -n -e 's|^.*PNG_DEFN_MAGIC *-\(.*\)- *PNG_DEFN_END.*$$|\1|p'\
9c0d9ce3 66 dfn1.out >dfn2.out
72281370 67 $(SED) -e 's| *PNG_JOIN *||g' -e 's| *$$||' dfn2.out >dfn3.out
9c0d9ce3
DS
68 cp dfn3.out $@
69 $(RM_F) dfn.c dfn?.out
70
0272a10d
VZ
71libpng.a: $(OBJS)
72 $(AR_RC) $@ $(OBJS)
73 $(RANLIB) $@
74
75pngtest: pngtest.o libpng.a
76 $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
77
78test: pngtest
79 ./pngtest
80
9c0d9ce3 81install: libpng.a pnglibconf.h
0272a10d
VZ
82 -@$(MKDIR_P) $(DESTDIR)$(INCPATH)
83 -@$(MKDIR_P) $(DESTDIR)$(INCPATH)/libpng
84 -@$(MKDIR_P) $(DESTDIR)$(LIBPATH)
85 -@$(RM_F) $(DESTDIR)$(INCPATH)/png.h
86 -@$(RM_F) $(DESTDIR)$(INCPATH)/pngconf.h
9c0d9ce3 87 -@$(RM_F) $(DESTDIR)$(INCPATH)/pnglibconf.h
0272a10d
VZ
88 cp png.h $(DESTDIR)$(INCPATH)/libpng
89 cp pngconf.h $(DESTDIR)$(INCPATH)/libpng
9c0d9ce3 90 cp pnglibconf.h $(DESTDIR)$(INCPATH)/libpng
0272a10d
VZ
91 chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h
92 chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h
9c0d9ce3 93 chmod 644 $(DESTDIR)$(INCPATH)/libpng/pnglibconf.h
0272a10d
VZ
94 (cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .)
95 cp libpng.a $(DESTDIR)$(LIBPATH)
96 chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a
97
98clean:
9c0d9ce3 99 $(RM_F) *.o libpng.a pngtest pngout.png pnglibconf.* dfn.c dfn?.out
0272a10d
VZ
100
101DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
102writelock:
103 chmod a-w *.[ch35] $(DOCS) scripts/*
104
105# DO NOT DELETE THIS LINE -- make depend depends on it.
106
9c0d9ce3
DS
107png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
108pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
109pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
110pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
111pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
112pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
113pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
114pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
115pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
116pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
117pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
118pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
119pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
120pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
121pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
122
123pngtest.o: png.h pngconf.h pnglibconf.h