]> git.saurik.com Git - wxWidgets.git/blame - src/png/scripts/makefile.hpgcc
Restore proper set and kill focus handling for user pane controls under wxMac.
[wxWidgets.git] / src / png / scripts / makefile.hpgcc
CommitLineData
c6b71bff
GD
1# makefile for libpng on HP-UX using GCC
2# Copyright (C) 2002, Glenn Randers-Pehrson
3# Copyright (C) 2001, Laurent faillie
4# Copyright (C) 1998, 1999 Greg Roelofs
5# Copyright (C) 1996, 1997 Andreas Dilger
6# For conditions of distribution and use, see copyright notice in png.h
7
8CC=gcc
9
10# where "make install" puts libpng.a, libpng.so*, png.h and pngconf.h
11prefix=/usr/local
12
13# Where the zlib library and include files are located
14ZLIBLIB=/opt/zlib/lib
15ZLIBINC=/opt/zlib/include
16
17ALIGN=
18# for i386:
19#ALIGN=-malign-loops=2 -malign-functions=2
20
21WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
22 -Wmissing-declarations -Wtraditional -Wcast-align \
23 -Wstrict-prototypes -Wmissing-prototypes #-Wconversion
24
25# for pgcc version 2.95.1, -O3 is buggy; don't use it.
26
27CFLAGS=-I$(ZLIBINC) -Wall -O3 -funroll-loops \
28 $(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5
29#LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng12 -lz -lm
30LDFLAGS=-L. -L$(ZLIBLIB) -lpng12 -lz -lm
31
32RANLIB=ranlib
33#RANLIB=echo
34
35PNGMAJ = 0
36PNGMIN = 1.2.4
37PNGVER = $(PNGMAJ).$(PNGMIN)
38LIBNAME = libpng12
39
40INCPATH=$(prefix)/include
41LIBPATH=$(prefix)/lib
42MANPATH=$(prefix)/man
43BINPATH=$(prefix)/bin
44
45# override DESTDIR= on the make install command line to easily support
46# installing into a temporary location. Example:
47#
48# make install DESTDIR=/tmp/build/libpng
49#
50# If you're going to install into a temporary location
51# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
52# you execute make install.
53DESTDIR=
54
55DB=$(DESTDIR)$(BINPATH)
56DI=$(DESTDIR)$(INCPATH)
57DL=$(DESTDIR)$(LIBPATH)
58DM=$(DESTDIR)$(MANPATH)
59
60OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
61 pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
62 pngwtran.o pngmem.o pngerror.o pngpread.o
63
64OBJSDLL = $(OBJS:.o=.pic.o)
65
66.SUFFIXES: .c .o .pic.o
67
68.c.pic.o:
69 $(CC) -c $(CFLAGS) -fPIC -o $@ $*.c
70
71all: libpng.a $(LIBNAME).sl pngtest libpng.pc libpng-config
72
73libpng.a: $(OBJS)
74 ar rc $@ $(OBJS)
75 $(RANLIB) $@
76
77libpng.pc:
78 cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
79
80libpng-config:
81 ( cat scripts/libpng-config-head.in; \
82 echo prefix=\"$(prefix)\"; \
83 echo cppflags=\"-I$(INCPATH)/$(LIBNAME)\"; \
84 echo cflags=\"\"; \
85 echo ldflags=\"\"; \
86 echo libs=\"-lpng12 -lz -lm\"; \
87 cat scripts/libpng-config-body.in ) > libpng-config
88 chmod +x libpng-config
89
90$(LIBNAME).sl: $(LIBNAME).sl.$(PNGMAJ)
91 ln -f -s $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl
92
93$(LIBNAME).sl.$(PNGMAJ): $(LIBNAME).sl.$(PNGVER)
94 ln -f -s $(LIBNAME).sl.$(PNGVER) $(LIBNAME).sl.$(PNGMAJ)
95
96$(LIBNAME).sl.$(PNGVER): $(OBJSDLL)
97 $(LD) -b -L$(ZLIBLIB) +s +b $(ZLIBLIB) \
98 +h libpng.sl.$(PNGMAJ) -o libpng.sl.$(PNGVER) $(OBJSDLL) -lz
99
100pngtest: pngtest.o $(LIBNAME).sl
101 $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
102
103test: pngtest
104 ./pngtest
105
106
107install-headers: png.h pngconf.h
108 -@if [ ! -d $(DI) ]; then mkdir $(DI); fi
109 -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
110 cp png.h pngconf.h $(DI)/$(LIBNAME)
111 chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
112 -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h
113 -@/bin/rm -f $(DI)/libpng
114 (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .)
115
116install-static: install-headers libpng.a
117 -@if [ ! -d $(DL) ]; then mkdir $(DL); fi
118 cp libpng.a $(DL)/$(LIBNAME).a
119 chmod 644 $(DL)/$(LIBNAME).a
120 -@/bin/rm -f $(DL)/libpng.a
121 (cd $(DL); ln -sf $(LIBNAME).a libpng.a)
122
123install-shared: install-headers $(LIBNAME).sl.$(PNGVER) libpng.pc
124 -@if [ ! -d $(DL) ]; then mkdir $(DL); fi
125 -@/bin/rm -f $(DL)/$(LIBNAME).sl.$(PNGMAJ)* $(DL)/$(LIBNAME).sl
126 -@/bin/rm -f $(DL)/libpng.so
127 -@/bin/rm -f $(DL)/libpng.so.3
128 -@/bin/rm -f $(DL)/libpng.so.3.*
129 cp $(LIBNAME).sl.$(PNGVER) $(DL)
130 chmod 755 $(DL)/$(LIBNAME).sl.$(PNGVER)
131 (cd $(DL); \
132 ln -sf $(LIBNAME).so.$(PNGVER) libpng.so; \
133 ln -sf $(LIBNAME).sl.$(PNGVER) libpng.sl.3; \
134 ln -sf $(LIBNAME).sl.$(PNGVER) libpng.sl.3.$(PNGMIN); \
135 ln -sf $(LIBNAME).sl.$(PNGVER) $(LIBNAME).sl.$(PNGMAJ); \
136 ln -sf $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl)
137 -@if [ ! -d $(DL)/pkgconfig ]; then mkdir \
138 $(DL)/pkgconfig; fi
139 -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
140 -@/bin/rm -f $(DL)/pkgconfig/libpng.pc
141 cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
142 chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
143 (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc)
144
145install-man: libpng.3 libpngpf.3 png.5
146 -@if [ ! -d $(DM) ]; then mkdir $(DM); fi
147 -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
148 -@/bin/rm -f $(DM)/man3/libpng.3
149 -@/bin/rm -f $(DM)/man3/libpngpf.3
150 cp libpng.3 $(DM)/man3
151 cp libpngpf.3 $(DM)/man3
152 -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
153 -@/bin/rm -f $(DM)/man5/png.5
154 cp png.5 $(DM)/man5
155
156install-config: libpng-config
157 -@if [ ! -d $(DB) ]; then mkdir $(DB); fi
158 -@/bin/rm -f $(DB)/libpng-config
159 -@/bin/rm -f $(DB)/$(LIBNAME)-config
160 cp libpng-config $(DB)/$(LIBNAME)-config
161 chmod 755 $(DB)/$(LIBNAME)-config
162 (cd $(DB); ln -sf $(LIBNAME)-config libpng-config)
163
164install: install-static install-shared install-man install-config
165
166# If you installed in $(DESTDIR), test-installed won't work until you
167# move the library to its final location.
168
169test-installed:
170 echo
171 echo Testing installed dynamic shared library.
172 $(CC) -I$(ZLIBINC) \
173 `$(BINPATH)/libpng12-config --cppflags --cflags` pngtest.c \
174 -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \
175 -o pngtesti `$(BINPATH)/libpng12-config --ldflags --libs`
176 ./pngtesti pngtest.png
177
178clean:
179 /bin/rm -f *.o libpng.a pngtest pngtesti pngout.png libpng.pc \
180 libpng-config $(LIBNAME).sl $(LIBNAME).sl.$(PNGMAJ)*
181
182clean:
183 /bin/rm -f *.o libpng.a $(SHAREDLIB).sl $(SHAREDLIB).sl.$(PNGMAJ)* \
184 pngtest pngout.png
185
186DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
187writelock:
188 chmod a-w *.[ch35] $(DOCS) scripts/*
189
190# DO NOT DELETE THIS LINE -- make depend depends on it.
191
192png.o png.pic.o: png.h pngconf.h
193pngerror.o pngerror.pic.o: png.h pngconf.h
194pngrio.o pngrio.pic.o: png.h pngconf.h
195pngwio.o pngwio.pic.o: png.h pngconf.h
196pngmem.o pngmem.pic.o: png.h pngconf.h
197pngset.o pngset.pic.o: png.h pngconf.h
198pngget.o pngget.pic.o: png.h pngconf.h
199pngread.o pngread.pic.o: png.h pngconf.h
200pngrtran.o pngrtran.pic.o: png.h pngconf.h
201pngrutil.o pngrutil.pic.o: png.h pngconf.h
202pngtrans.o pngtrans.pic.o: png.h pngconf.h
203pngwrite.o pngwrite.pic.o: png.h pngconf.h
204pngwtran.o pngwtran.pic.o: png.h pngconf.h
205pngwutil.o pngwutil.pic.o: png.h pngconf.h
206pngpread.o pngpread.pic.o: png.h pngconf.h
207
208pngtest.o: png.h pngconf.h