]> git.saurik.com Git - wxWidgets.git/blame - src/png/scripts/makefile.hpux
header files are not executable
[wxWidgets.git] / src / png / scripts / makefile.hpux
CommitLineData
0272a10d
VZ
1# makefile for libpng, HPUX (10.20 and 11.00) using the ANSI/C product.
2# Copyright (C) 1999-2002, 2006 Glenn Randers-Pehrson
3# Copyright (C) 1995 Guy Eric Schalnat, Group 42
4# contributed by Jim Rice and updated by Chris Schleicher, Hewlett Packard
5# For conditions of distribution and use, see copyright notice in png.h
6
7# Where the zlib library and include files are located
8ZLIBLIB=/opt/zlib/lib
9ZLIBINC=/opt/zlib/include
10
11# Note that if you plan to build a libpng shared library, zlib must also
12# be a shared library, which zlib's configure does not do. After running
13# zlib's configure, edit the appropriate lines of makefile to read:
14# CFLAGS=-O1 -DHAVE_UNISTD -DUSE_MAP -fPIC \
15# LDSHARED=ld -b
16# SHAREDLIB=libz.sl
17
18# Library name:
19LIBNAME = libpng12
20PNGMAJ = 0
21PNGMIN = 1.2.20
22PNGVER = $(PNGMAJ).$(PNGMIN)
23
24# Shared library names:
25LIBSO=$(LIBNAME).sl
26LIBSOMAJ=$(LIBNAME).sl.$(PNGMAJ)
27LIBSOVER=$(LIBNAME).sl.$(PNGVER)
28OLDSO=libpng.sl
29OLDSOMAJ=libpng.sl.3
30OLDSOVER=libpng.sl.3.$(PNGMIN)
31
32# Utilities:
33AR_RC=ar rc
34CC=cc
35MKDIR_P=mkdir -p
36LN_SF=ln -sf
37RANLIB=ranlib
38RM_F=/bin/rm -f
39
40# where make install puts libpng.a, libpng12.sl, and png.h
41prefix=/opt/libpng
42exec_prefix=$(prefix)
43INCPATH=$(prefix)/include
44LIBPATH=$(exec_prefix)/lib
45MANPATH=$(prefix)/man
46BINPATH=$(exec_prefix)/bin
47
48CFLAGS=-I$(ZLIBINC) -O -Ae +DA1.1 +DS2.0 -DPNG_NO_MMX_CODE
49# Caution: be sure you have built zlib with the same CFLAGS.
50CCFLAGS=-I$(ZLIBINC) -O -Ae +DA1.1 +DS2.0
51LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
52
53# override DESTDIR= on the make install command line to easily support
54# installing into a temporary location. Example:
55#
56# make install DESTDIR=/tmp/build/libpng
57#
58# If you're going to install into a temporary location
59# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
60# you execute make install.
61DESTDIR=
62
63DB=$(DESTDIR)$(BINPATH)
64DI=$(DESTDIR)$(INCPATH)
65DL=$(DESTDIR)$(LIBPATH)
66DM=$(DESTDIR)$(MANPATH)
67
68OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
69 pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
70 pngwtran.o pngmem.o pngerror.o pngpread.o
71
72OBJSDLL = $(OBJS:.o=.pic.o)
73
74.SUFFIXES: .c .o .pic.o
75
76.c.pic.o:
77 $(CC) -c $(CFLAGS) +z -o $@ $*.c
78
79all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
80
81libpng.a: $(OBJS)
82 $(AR_RC) $@ $(OBJS)
83 $(RANLIB) $@
84
85libpng.pc:
86 cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
87
88libpng-config:
89 ( cat scripts/libpng-config-head.in; \
90 echo prefix=\"$(prefix)\"; \
91 echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
92 echo ccopts=\"-Ae +DA1.1 +DS2.0\"; \
93 echo L_opts=\"-L$(LIBPATH)\"; \
94 echo libs=\"-lpng12 -lz -lm\"; \
95 cat scripts/libpng-config-body.in ) > libpng-config
96 chmod +x libpng-config
97
98$(LIBSO): $(LIBSOMAJ)
99 $(LN_SF) $(LIBSOMAJ) $(LIBSO)
100
101$(LIBSOMAJ): $(LIBSOVER)
102 $(LN_SF) $(LIBSOVER) $(LIBSOMAJ)
103
104$(LIBSOVER): $(OBJSDLL)
105 $(LD) -b +s \
106 +h $(LIBSOMAJ) -o $(LIBSOVER) $(OBJSDLL)
107
108$(OLDSOVER): $(OBJSDLL)
109 $(LD) -b +s \
110 +h $(OLDSOMAJ) -o $(OLDSOVER) $(OBJSDLL)
111
112pngtest: pngtest.o libpng.a
113 $(CC) -o pngtest $(CCFLAGS) pngtest.o $(LDFLAGS)
114
115test: pngtest
116 ./pngtest
117
118install-headers: png.h pngconf.h
119 -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
120 -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
121 cp png.h pngconf.h $(DI)/$(LIBNAME)
122 chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
123 -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h
124 -@$(RM_F) $(DI)/libpng
125 (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
126
127install-static: install-headers libpng.a
128 -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
129 cp libpng.a $(DL)/$(LIBNAME).a
130 chmod 644 $(DL)/$(LIBNAME).a
131 -@$(RM_F) $(DL)/libpng.a
132 (cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
133
134install-shared: install-headers $(LIBSOVER) libpng.pc \
135 $(OLDSOVER)
136 -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
137 -@$(RM_F) $(DL)/$(LIBSOVER)* $(DL)/$(LIBSO)
138 -@$(RM_F) $(DL)/$(LIBSOMAJ)
139 -@$(RM_F) $(DL)/$(OLDSO)
140 -@$(RM_F) $(DL)/$(OLDSOMAJ)
141 -@$(RM_F) $(DL)/$(OLDSOVER)*
142 cp $(LIBSOVER) $(DL)
143 cp $(OLDSOVER) $(DL)
144 chmod 755 $(DL)/$(LIBSOVER)
145 chmod 755 $(DL)/$(OLDSOVER)
146 (cd $(DL); \
147 $(LN_SF) $(OLDSOVER) $(OLDSOMAJ); \
148 $(LN_SF) $(OLDSOMAJ) $(OLDSO); \
149 $(LN_SF) $(LIBSOVER) $(LIBSOMAJ); \
150 $(LN_SF) $(LIBSOMAJ) $(LIBSO))
151 -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
152 -@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
153 -@$(RM_F) $(DL)/pkgconfig/libpng.pc
154 cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
155 chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
156 (cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
157
158install-man: libpng.3 libpngpf.3 png.5
159 -@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
160 -@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
161 -@$(RM_F) $(DM)/man3/libpng.3
162 -@$(RM_F) $(DM)/man3/libpngpf.3
163 cp libpng.3 $(DM)/man3
164 cp libpngpf.3 $(DM)/man3
165 -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
166 -@$(RM_F) $(DM)/man5/png.5
167 cp png.5 $(DM)/man5
168
169install-config: libpng-config
170 -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
171 -@$(RM_F) $(DB)/libpng-config
172 -@$(RM_F) $(DB)/$(LIBNAME)-config
173 cp libpng-config $(DB)/$(LIBNAME)-config
174 chmod 755 $(DB)/$(LIBNAME)-config
175 (cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
176
177install: install-static install-shared install-man install-config
178
179# If you installed in $(DESTDIR), test-installed won't work until you
180# move the library to its final location. Use test-dd to test it
181# before then.
182
183test-dd:
184 echo
185 echo Testing installed dynamic shared library in $(DL).
186 $(CC) -I$(DI) -I$(ZLIBINC) $(CCFLAGS) \
187 `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
188 -L$(DL) -L$(ZLIBLIB) \
189 -o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
190 ./pngtestd pngtest.png
191
192test-installed:
193 echo
194 echo Testing installed dynamic shared library.
195 $(CC) $(CCFLAGS) \
196 `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
197 -L$(ZLIBLIB) \
198 -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
199 ./pngtesti pngtest.png
200
201clean:
202 $(RM_F) *.o libpng.a pngtest pngtesti pngout.png \
203 libpng-config $(LIBSO) $(LIBSOMAJ)* \
204 $(OLDSOVER) \
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.h pngconf.h
214pngerror.o: png.h pngconf.h
215pngrio.o: png.h pngconf.h
216pngwio.o: png.h pngconf.h
217pngmem.o: png.h pngconf.h
218pngset.o: png.h pngconf.h
219pngget.o: png.h pngconf.h
220pngread.o: png.h pngconf.h
221pngrtran.o: png.h pngconf.h
222pngrutil.o: png.h pngconf.h
223pngtest.o: png.h pngconf.h
224pngtrans.o: png.h pngconf.h
225pngwrite.o: png.h pngconf.h
226pngwtran.o: png.h pngconf.h
227pngwutil.o: png.h pngconf.h
228pngpread.o: png.h pngconf.h