]> git.saurik.com Git - wxWidgets.git/blame - src/png/scripts/makefile.dec
fixing the usage of hishape
[wxWidgets.git] / src / png / scripts / makefile.dec
CommitLineData
0272a10d
VZ
1# makefile for libpng on DEC Alpha Unix
2# Copyright (C) 2000-2002, 2006 Glenn Randers-Pehrson
3# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
4# For conditions of distribution and use, see copyright notice in png.h
5
6# Library name:
7PNGMAJ = 0
8PNGMIN = 1.2.20
9PNGVER = $(PNGMAJ).$(PNGMIN)
10LIBNAME = libpng12
11
12# Shared library names:
13LIBSO=$(LIBNAME).so
14LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
15LIBSOVER=$(LIBNAME).so.$(PNGVER)
16OLDSO=libpng.so
17OLDSOMAJ=libpng.so.3
18OLDSOVER=libpng.so.3.$(PNGMIN)
19
20# Utilities:
21AR_RC=ar rc
22CC=cc
23MKDIR_P=mkdir
24LN_SF=ln -f -s
25RANLIB=ranlib
26RM_F=/bin/rm -f
27
28# where make install puts libpng.a and png.h
29prefix=/usr/local
30exec_prefix=$(prefix)
31INCPATH=$(prefix)/include
32LIBPATH=$(exec_prefix)/lib
33MANPATH=$(prefix)/man
34BINPATH=$(exec_prefix)/bin
35
36# override DESTDIR= on the make install command line to easily support
37# installing into a temporary location. Example:
38#
39# make install DESTDIR=/tmp/build/libpng
40#
41# If you're going to install into a temporary location
42# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
43# you execute make install.
44DESTDIR=
45
46DB=$(DESTDIR)$(BINPATH)
47DI=$(DESTDIR)$(INCPATH)
48DL=$(DESTDIR)$(LIBPATH)
49DM=$(DESTDIR)$(MANPATH)
50
51# Where the zlib library and include files are located
52#ZLIBLIB=/usr/local/lib
53#ZLIBINC=/usr/local/include
54ZLIBLIB=../zlib
55ZLIBINC=../zlib
56
57CFLAGS=-std -w1 -I$(ZLIBINC) -O # -g -DPNG_DEBUG=1
58LDFLAGS=-L$(ZLIBLIB) -rpath $(ZLIBLIB) libpng.a -lz -lm
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
64all: $(LIBSO) libpng.a pngtest libpng.pc libpng-config
65
66libpng.a: $(OBJS)
67 $(AR_RC) $@ $(OBJS)
68 $(RANLIB) $@
69
70libpng.pc:
71 cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
72
73libpng-config:
74 ( cat scripts/libpng-config-head.in; \
75 echo prefix=\"$(prefix)\"; \
76 echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
77 echo ccopts=\"-std\"; \
78 echo L_opts=\"-L$(LIBPATH)\"; \
79 echo libs=\"-lpng12 -lz -lm\"; \
80 cat scripts/libpng-config-body.in ) > libpng-config
81 chmod +x libpng-config
82
83$(LIBSO): $(LIBSOMAJ)
84 $(LN_SF) $(LIBSOMAJ) $(LIBSO)
85
86$(LIBSOMAJ): $(LIBSOVER)
87 $(LN_SF) $(LIBSOVER) $(LIBSOMAJ)
88
89$(LIBSOVER): $(OBJS)
90 $(CC) -shared -o $@ $(OBJS) -L$(ZLIBLIB) \
91 -soname $(LIBSOMAJ)
92
93$(OLDSOVER): $(OBJS)
94 $(CC) -shared -o $@ $(OBJS) -L$(ZLIBLIB) \
95 -soname $(OLDSOMAJ)
96
97pngtest: pngtest.o libpng.a
98 $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
99
100test: pngtest
101 ./pngtest
102
103install-headers: png.h pngconf.h
104 -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
105 -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
106 cp png.h pngconf.h $(DI)/$(LIBNAME)
107 chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
108 -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h
109 -@/bin/rm -f $(DI)/libpng
110 (cd $(DI); $(LN_SF)(LIBNAME) libpng; $(LN_SF)(LIBNAME)/* .)
111
112install-static: install-headers libpng.a
113 -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
114 cp libpng.a $(DL)/$(LIBNAME).a
115 chmod 644 $(DL)/$(LIBNAME).a
116 -@/bin/rm -f $(DL)/libpng.a
117 (cd $(DL); $(LN_SF)(LIBNAME).a libpng.a)
118
119install-shared: install-headers $(LIBSOVER) libpng.pc \
120 $(OLDSOVER)
121 -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
122 -@/bin/rm -f $(DL)/$(LIBSOVER)* $(DL)/$(LIBSO)
123 -@/bin/rm -f $(DL)/$(LIBSOMAJ)
124 -@/bin/rm -f $(DL)/$(OLDSO)
125 -@/bin/rm -f $(DL)/$(OLDSOMAJ)
126 -@/bin/rm -f $(DL)/$(OLDSOVER)*
127 cp $(LIBSOVER) $(DL)
128 cp $(OLDSOVER) $(DL)
129 chmod 755 $(DL)/$(LIBSOVER)
130 chmod 755 $(DL)/$(OLDSOVER)
131 (cd $(DL); \
132 $(LN_SF) $(OLDSOVER) $(OLDSOMAJ); \
133 $(LN_SF) $(OLDSOMAJ) $(OLDSO); \
134 $(LN_SF)(LIBSOVER) $(LIBSOMAJ); \
135 $(LN_SF)(LIBSOMAJ) $(LIBSO))
136 -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
137 -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
138 -@/bin/rm -f $(DL)/pkgconfig/libpng.pc
139 cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
140 chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
141 (cd $(DL)/pkgconfig; $(LN_SF)(LIBNAME).pc libpng.pc)
142
143install-man: libpng.3 libpngpf.3 png.5
144 -@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
145 -@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
146 -@/bin/rm -f $(DM)/man3/libpng.3
147 -@/bin/rm -f $(DM)/man3/libpngpf.3
148 cp libpng.3 $(DM)/man3
149 cp libpngpf.3 $(DM)/man3
150 -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
151 -@/bin/rm -f $(DM)/man5/png.5
152 cp png.5 $(DM)/man5
153
154install-config: libpng-config
155 -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
156 -@/bin/rm -f $(DB)/libpng-config
157 -@/bin/rm -f $(DB)/$(LIBNAME)-config
158 cp libpng-config $(DB)/$(LIBNAME)-config
159 chmod 755 $(DB)/$(LIBNAME)-config
160 (cd $(DB); $(LN_SF)(LIBNAME)-config libpng-config)
161
162install: install-static install-shared install-man install-config
163
164# If you installed in $(DESTDIR), test-installed won't work until you
165# move the library to its final location. Use test-dd to test it
166# before then.
167
168test-dd:
169 echo
170 echo Testing installed dynamic shared library in $(DL).
171 $(CC) -w1 -I$(DI) -I$(ZLIBINC) \
172 `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
173 -L$(DL) -L$(ZLIBLIB) -R$(ZLIBLIB) -R$(DL) \
174 -o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
175 ./pngtestd pngtest.png
176
177test-installed:
178 echo
179 echo Testing installed dynamic shared library.
180 $(CC) -w1 -I$(ZLIBINC) \
181 `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
182 -L$(ZLIBLIB) -R$(ZLIBLIB) \
183 -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
184 ./pngtesti pngtest.png
185
186clean:
187 /bin/rm -f *.o libpng.a pngtest pngtesti pngout.png \
188 libpng-config $(LIBSO) $(LIBSOMAJ)* \
189 $(OLDSOVER) \
190 libpng.pc
191
192# DO NOT DELETE THIS LINE -- make depend depends on it.
193
194png.o: png.h pngconf.h
195pngerror.o: png.h pngconf.h
196pngrio.o: png.h pngconf.h
197pngwio.o: png.h pngconf.h
198pngmem.o: png.h pngconf.h
199pngset.o: png.h pngconf.h
200pngget.o: png.h pngconf.h
201pngread.o: png.h pngconf.h
202pngrtran.o: png.h pngconf.h
203pngrutil.o: png.h pngconf.h
204pngtest.o: png.h pngconf.h
205pngtrans.o: png.h pngconf.h
206pngwrite.o: png.h pngconf.h
207pngwtran.o: png.h pngconf.h
208pngwutil.o: png.h pngconf.h
209pngpread.o: png.h pngconf.h
210