]> git.saurik.com Git - wxWidgets.git/blame - src/png/scripts/makefile.hpgcc
Fit the generic preferences editor dialog to its pages size initially.
[wxWidgets.git] / src / png / scripts / makefile.hpgcc
CommitLineData
0272a10d 1# makefile for libpng on HP-UX using GCC with the HP ANSI/C linker.
9c0d9ce3 2# Copyright (C) 2002, 2006-2008, 2010-2011 Glenn Randers-Pehrson
0272a10d
VZ
3# Copyright (C) 2001, Laurent faillie
4# Copyright (C) 1998, 1999 Greg Roelofs
5# Copyright (C) 1996, 1997 Andreas Dilger
b61cc19c
PC
6#
7# This code is released under the libpng license.
8# For conditions of distribution and use, see the disclaimer
9# and license in png.h
0272a10d
VZ
10
11# Library name:
9c0d9ce3
DS
12LIBNAME = libpng15
13PNGMAJ = 15
0272a10d
VZ
14
15# Shared library names:
16LIBSO=$(LIBNAME).sl
17LIBSOMAJ=$(LIBNAME).sl.$(PNGMAJ)
b61cc19c 18LIBSOREL=$(LIBSOMAJ).$(RELEASE)
0272a10d 19OLDSO=libpng.sl
0272a10d
VZ
20
21# Utilities:
22CC=gcc
23LD=ld
24AR_RC=ar rc
25MKDIR_P=mkdir -p
26LN_SF=ln -sf
27RANLIB=ranlib
28RM_F=/bin/rm -f
29
9c0d9ce3
DS
30# where "make install" puts libpng.a, $(OLDSO)*, png.h, pngconf.h
31# and pnglibconf.h
0272a10d
VZ
32prefix=/usr/local
33exec_prefix=$(prefix)
34
35# Where the zlib library and include files are located
36ZLIBLIB=/opt/zlib/lib
37ZLIBINC=/opt/zlib/include
38
39# Note that if you plan to build a libpng shared library, zlib must also
40# be a shared library, which zlib's configure does not do. After running
41# zlib's configure, edit the appropriate lines of makefile to read:
42# CFLAGS=-O1 -DHAVE_UNISTD -DUSE_MAP -fPIC \
43# LDSHARED=ld -b
44# SHAREDLIB=libz.sl
45
46ALIGN=
47# for i386:
48#ALIGN=-malign-loops=2 -malign-functions=2
49
50WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
51 -Wmissing-declarations -Wtraditional -Wcast-align \
52 -Wstrict-prototypes -Wmissing-prototypes #-Wconversion
53
54# for pgcc version 2.95.1, -O3 is buggy; don't use it.
55
970f6abe 56CFLAGS=-I$(ZLIBINC) -W -Wall -O3 -funroll-loops -DPNG_NO_MMX_CODE \
0272a10d 57 $(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5
9c0d9ce3
DS
58#LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng15 -lz -lm
59LDFLAGS=-L. -L$(ZLIBLIB) -lpng15 -lz -lm
0272a10d
VZ
60
61INCPATH=$(prefix)/include
62LIBPATH=$(exec_prefix)/lib
63MANPATH=$(prefix)/man
64BINPATH=$(exec_prefix)/bin
65
66# override DESTDIR= on the make install command line to easily support
67# installing into a temporary location. Example:
68#
69# make install DESTDIR=/tmp/build/libpng
70#
71# If you're going to install into a temporary location
72# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
73# you execute make install.
74DESTDIR=
75
76DB=$(DESTDIR)$(BINPATH)
77DI=$(DESTDIR)$(INCPATH)
78DL=$(DESTDIR)$(LIBPATH)
79DM=$(DESTDIR)$(MANPATH)
80
81OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
82 pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
83 pngwtran.o pngmem.o pngerror.o pngpread.o
84
85OBJSDLL = $(OBJS:.o=.pic.o)
86
87.SUFFIXES: .c .o .pic.o
88
89.c.pic.o:
90 $(CC) -c $(CFLAGS) -fPIC -o $@ $*.c
91
92all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
93
94libpng.a: $(OBJS)
95 $(AR_RC) $@ $(OBJS)
96 $(RANLIB) $@
97
98libpng.pc:
970f6abe
VZ
99 cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
100 -e s!@exec_prefix@!$(exec_prefix)! \
101 -e s!@libdir@!$(LIBPATH)! \
102 -e s!@includedir@!$(INCPATH)! \
9c0d9ce3 103 -e s!-lpng15!-lpng15\ -lz\ -lm! > libpng.pc
0272a10d
VZ
104
105libpng-config:
106 ( cat scripts/libpng-config-head.in; \
107 echo prefix=\"$(prefix)\"; \
108 echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
9c0d9ce3 109 echo libs=\"-lpng15 -lz -lm\"; \
0272a10d
VZ
110 cat scripts/libpng-config-body.in ) > libpng-config
111 chmod +x libpng-config
112
113$(LIBSO): $(LIBSOMAJ)
114 $(LN_SF) $(LIBSOMAJ) $(LIBSO)
115
b61cc19c 116$(LIBSOMAJ): $(OBJSDLL)
0272a10d 117 $(LD) -b +s \
b61cc19c 118 +h $(LIBSOMAJ) -o $(LIBSOMAJ) $(OBJSDLL)
0272a10d
VZ
119
120pngtest: pngtest.o $(LIBSO)
121 $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
122
123test: pngtest
124 ./pngtest
125
126
9c0d9ce3 127install-headers: png.h pngconf.h pnglibconf.h
0272a10d
VZ
128 -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
129 -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
9c0d9ce3
DS
130 cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
131 chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
132 -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
0272a10d
VZ
133 -@$(RM_F) $(DI)/libpng
134 (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
135
136install-static: install-headers libpng.a
137 -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
138 cp libpng.a $(DL)/$(LIBNAME).a
139 chmod 644 $(DL)/$(LIBNAME).a
140 -@$(RM_F) $(DL)/libpng.a
141 (cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
142
b61cc19c 143install-shared: install-headers $(LIBSOMAJ) libpng.pc
0272a10d 144 -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
b61cc19c
PC
145 -@$(RM_F) $(DL)/$(LIBSO)
146 -@$(RM_F) $(DL)/$(LIBSOREL)
0272a10d 147 -@$(RM_F) $(DL)/$(OLDSO)
b61cc19c
PC
148 cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
149 chmod 755 $(DL)/$(LIBSOREL)
0272a10d 150 (cd $(DL); \
b61cc19c
PC
151 $(LN_SF) $(LIBSOREL) $(LIBSO); \
152 $(LN_SF) $(LIBSO) $(OLDSO))
0272a10d
VZ
153 -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
154 -@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
155 -@$(RM_F) $(DL)/pkgconfig/libpng.pc
156 cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
157 chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
158 (cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
159
160install-man: libpng.3 libpngpf.3 png.5
161 -@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
162 -@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
163 -@$(RM_F) $(DM)/man3/libpng.3
164 -@$(RM_F) $(DM)/man3/libpngpf.3
165 cp libpng.3 $(DM)/man3
166 cp libpngpf.3 $(DM)/man3
167 -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
168 -@$(RM_F) $(DM)/man5/png.5
169 cp png.5 $(DM)/man5
170
171install-config: libpng-config
172 -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
173 -@$(RM_F) $(DB)/libpng-config
174 -@$(RM_F) $(DB)/$(LIBNAME)-config
175 cp libpng-config $(DB)/$(LIBNAME)-config
176 chmod 755 $(DB)/$(LIBNAME)-config
177 (cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
178
179install: install-static install-shared install-man install-config
180
181# If you installed in $(DESTDIR), test-installed won't work until you
182# move the library to its final location. Use test-dd to test it
183# before then.
184
185test-dd:
186 echo
187 echo Testing installed dynamic shared library in $(DL).
188 $(CC) -I$(DI) -I$(ZLIBINC) \
189 `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
190 -L$(DL) -L$(ZLIBLIB) -Wl,-rpath,$(DL) -Wl,-rpath,$(ZLIBLIB) \
191 -o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
192 ./pngtestd pngtest.png
193
194test-installed:
195 echo
196 echo Testing installed dynamic shared library.
197 $(CC) -I$(ZLIBINC) \
198 `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
199 -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \
200 -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
201 ./pngtesti pngtest.png
202
203clean:
204 $(RM_F) *.o libpng.a pngtest pngtesti pngout.png \
205 libpng-config $(LIBSO) $(LIBSOMAJ)* \
9c0d9ce3 206 libpng.pc pnglibconf.h
0272a10d
VZ
207
208DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
209writelock:
210 chmod a-w *.[ch35] $(DOCS) scripts/*
211
212# DO NOT DELETE THIS LINE -- make depend depends on it.
213
9c0d9ce3
DS
214png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
215pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
216pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
217pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
218pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
219pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
220pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
221pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
222pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
223pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
224pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
225pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
226pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
227pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
228pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
229
230pngtest.o: png.h pngconf.h pnglibconf.h