]> git.saurik.com Git - wxWidgets.git/blame - src/png/scripts/makefile.sggcc
support for Mac Help Button added (wxID_HELP) is automatically translated
[wxWidgets.git] / src / png / scripts / makefile.sggcc
CommitLineData
c6b71bff
GD
1# makefile for libpng.a and libpng12.so, SGI IRIX with 'cc'
2# Copyright (C) 2001-2002 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# Where make install puts libpng.a, libpng12.so, and libpng12/png.h
7# Prefix must be a full pathname.
8
9prefix=/usr/local
10
11# Where the zlib library and include files are located
12#ZLIBLIB=/usr/local/lib32
13#ZLIBINC=/usr/local/include
14#ZLIBLIB=/usr/local/lib
15#ZLIBINC=/usr/local/include
16ZLIBLIB=../zlib
17ZLIBINC=../zlib
18
19LIBNAME=libpng12
20PNGMAJ = 0
21PNGMIN = 1.2.4
22PNGVER = $(PNGMAJ).$(PNGMIN)
23CC=gcc
24
25# ABI can be blank to use default for your system, -32, -o32, -n32, or -64
26# See "man abi". zlib must be built with the same ABI.
27ABI=
28
29WARNMORE= # -g -DPNG_DEBUG=5
30CFLAGS=$(ABI) -I$(ZLIBINC) -O2 $(WARNMORE) -fPIC -mabi=n32
31LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm
32LDSHARED=cc $(ABI) -shared -soname $(LIBNAME).so.$(PNGMAJ)
33# See "man dso" for info about shared objects
34
35RANLIB=echo
36#RANLIB=ranlib
37
38INCPATH=$(prefix)/include
39LIBPATH=$(prefix)/lib
40#LIBPATH=$(prefix)/lib32
41MANPATH=$(prefix)/man
42BINPATH=$(prefix)/bin
43
44# override DESTDIR= on the make install command line to easily support
45# installing into a temporary location. Example:
46#
47# make install DESTDIR=/tmp/build/libpng
48#
49# If you're going to install into a temporary location
50# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
51# you execute make install.
52DESTDIR=
53
54DB=$(DESTDIR)$(BINPATH)
55DI=$(DESTDIR)$(INCPATH)
56DL=$(DESTDIR)$(LIBPATH)
57DM=$(DESTDIR)$(MANPATH)
58
59OBJS = pnggccrd.o png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
60 pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
61 pngwtran.o pngmem.o pngerror.o pngpread.o
62
63all: libpng.a pngtest shared libpng.pc libpng-config
64
65libpng.a: $(OBJS)
66 ar rc $@ $(OBJS)
67 $(RANLIB) $@
68
69shared: $(LIBNAME).so.$(PNGVER)
70
71libpng.pc:
72 cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > \
73 libpng.pc
74
75libpng-config:
76 ( cat scripts/libpng-config-head.in; \
77 echo prefix=\"$(prefix)\"; \
78 echo cppflags=\"-I$(INCPATH)/$(LIBNAME) -DPNG_USE_PNGGCCRD \
79 -DPNG_NO_ASSEMBLER_CODE\"; \
80 echo cflags=\"$(ABI)\"; \
81 echo ldflags=\"-L$(LIBPATH)\"; \
82 echo rpath=\"$(LIBPATH)\"; \
83 echo libs=\"-lpng12 -lz -lm\"; \
84 cat scripts/libpng-config-body.in ) > libpng-config
85 chmod +x libpng-config
86
87$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
88 ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
89
90$(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER)
91 ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ)
92
93$(LIBNAME).so.$(PNGVER): $(OBJS)
94 $(LDSHARED) -o $@ $(OBJS)
95 rm -f $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)
96
97pngtest: pngtest.o libpng.a
98 $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
99
100test: pngtest
101 echo
102 echo Testing local static library.
103 ./pngtest
104
105install-headers: png.h pngconf.h
106 -@if [ ! -d $(DI) ]; then mkdir $(DI); fi
107 -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
108 cp png.h pngconf.h $(DI)/$(LIBNAME)
109 chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
110 -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h
111 -@/bin/rm -f $(DI)/libpng
112 (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .)
113
114install-static: install-headers libpng.a
115 -@if [ ! -d $(DL) ]; then mkdir $(DL); fi
116 cp libpng.a $(DL)/$(LIBNAME).a
117 chmod 644 $(DL)/$(LIBNAME).a
118 -@/bin/rm -f $(DL)/libpng.a
119 (cd $(DL); ln -sf $(LIBNAME).a libpng.a)
120
121install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc
122 -@if [ ! -d $(DL) ]; then mkdir $(DL); fi
123 -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ)* $(DL)/$(LIBNAME).so
124 -@/bin/rm -f $(DL)/libpng.so
125 -@/bin/rm -f $(DL)/libpng.so.3
126 -@/bin/rm -f $(DL)/libpng.so.3.*
127 cp $(LIBNAME).so.$(PNGVER) $(DL)
128 chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER)
129 (cd $(DL); \
130 ln -sf $(LIBNAME).so.$(PNGVER) libpng.so; \
131 ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.3; \
132 ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.3.$(PNGMIN); \
133 ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
134 ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
135 -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
136 -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
137 -@/bin/rm -f $(DL)/pkgconfig/libpng.pc
138 cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
139 chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
140 (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc)
141
142install-man: libpng.3 libpngpf.3 png.5
143 -@if [ ! -d $(DM) ]; then mkdir $(DM); fi
144 -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
145 -@/bin/rm -f $(DM)/man3/libpng.3
146 -@/bin/rm -f $(DM)/man3/libpngpf.3
147 cp libpng.3 $(DM)/man3
148 cp libpngpf.3 $(DM)/man3
149 -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
150 -@/bin/rm -f $(DM)/man5/png.5
151 cp png.5 $(DM)/man5
152
153install-config: libpng-config
154 -@if [ ! -d $(DB) ]; then mkdir $(DB); fi
155 -@/bin/rm -f $(DB)/libpng-config
156 -@/bin/rm -f $(DB)/$(LIBNAME)-config
157 cp libpng-config $(DB)/$(LIBNAME)-config
158 chmod 755 $(DB)/$(LIBNAME)-config
159 (cd $(DB); ln -sf $(LIBNAME)-config libpng-config)
160
161install: install-static install-shared install-man install-config
162
163# If you installed in $(DESTDIR), test-installed won't work until you
164# move the library to its final location.
165
166test-installed:
167 $(CC) -I$(ZLIBINC) \
168 `$(BINPATH)/libpng12-config --cppflags --cflags` pngtest.c \
169 -L$(ZLIBLIB) -rpath $(ZLIBLIB):`$(BINPATH)/libpng12-config --rpath` \
170 -o pngtesti `$(BINPATH)/libpng12-config --ldflags --libs`
171 echo
172 echo Testing installed dynamic shared library.
173 ./pngtesti pngtest.png
174
175clean:
176 rm -f *.o libpng.a pngtest pngout.png libpng.pc libpng-config \
177 $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* so_locations
178
179DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
180writelock:
181 chmod a-w *.[ch35] $(DOCS) scripts/*
182
183# DO NOT DELETE THIS LINE -- make depend depends on it.
184
185png.o: png.h pngconf.h
186pngerror.o: png.h pngconf.h
187pngrio.o: png.h pngconf.h
188pngwio.o: png.h pngconf.h
189pngmem.o: png.h pngconf.h
190pngset.o: png.h pngconf.h
191pngget.o: png.h pngconf.h
192pngread.o: png.h pngconf.h
193pngrtran.o: png.h pngconf.h
194pngrutil.o: png.h pngconf.h
195pngtest.o: png.h pngconf.h
196pngtrans.o: png.h pngconf.h
197pngwrite.o: png.h pngconf.h
198pngwtran.o: png.h pngconf.h
199pngwutil.o: png.h pngconf.h
200pngpread.o: png.h pngconf.h
201pnggccrd.o: png.h pngconf.h
202