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