VirtualBox

source: vbox/trunk/src/libs/libpng-1.2.8/scripts/makefile.sggcc@ 43968

最後變更 在這個檔案從43968是 6395,由 vboxsync 提交於 17 年 前

export libpng and zlib so Windows and OS/2 build cleanly.

  • 屬性 svn:eol-style 設為 native
檔案大小: 6.6 KB
 
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.8
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 -set_version sgi$(PNGMAJ).0
34LDLEGACY=cc $(ABI) -shared -soname libpng.so.3 \
35 -set_version sgi$3.0
36# See "man dso" for info about shared objects
37
38RANLIB=echo
39#RANLIB=ranlib
40
41INCPATH=$(prefix)/include
42LIBPATH=$(prefix)/lib
43#LIBPATH=$(prefix)/lib32
44MANPATH=$(prefix)/man
45BINPATH=$(prefix)/bin
46
47# override DESTDIR= on the make install command line to easily support
48# installing into a temporary location. Example:
49#
50# make install DESTDIR=/tmp/build/libpng
51#
52# If you're going to install into a temporary location
53# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
54# you execute make install.
55DESTDIR=
56
57DB=$(DESTDIR)$(BINPATH)
58DI=$(DESTDIR)$(INCPATH)
59DL=$(DESTDIR)$(LIBPATH)
60DM=$(DESTDIR)$(MANPATH)
61
62OBJS = pnggccrd.o png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
63 pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
64 pngwtran.o pngmem.o pngerror.o pngpread.o
65
66all: libpng.a pngtest shared libpng.pc libpng-config
67
68libpng.a: $(OBJS)
69 ar rc $@ $(OBJS)
70 $(RANLIB) $@
71
72shared: $(LIBNAME).so.$(PNGVER)
73
74libpng.pc:
75 cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
76
77libpng-config:
78 ( cat scripts/libpng-config-head.in; \
79 echo prefix=\"$(prefix)\"; \
80 echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
81 echo ccopts=\"$(ABI)\"; \
82 echo ldopts=\"$(ABI)\"; \
83 echo L_opts=\"-L$(LIBPATH)\"; \
84 echo libdir=\"$(LIBPATH)\"; \
85 echo libs=\"-lpng12 -lz -lm\"; \
86 cat scripts/libpng-config-body.in ) > libpng-config
87 chmod +x libpng-config
88
89$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
90 ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
91
92$(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER)
93 ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ)
94
95$(LIBNAME).so.$(PNGVER): $(OBJS)
96 $(LDSHARED) -o $@ $(OBJS)
97 rm -f $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)
98
99libpng.so.3.$(PNGMIN): $(OBJS)
100 $(LDLEGACY) -o $@ $(OBJS)
101
102pngtest: pngtest.o libpng.a
103 $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
104
105test: pngtest
106 echo
107 echo Testing local static library.
108 ./pngtest
109
110install-headers: png.h pngconf.h
111 -@if [ ! -d $(DI) ]; then mkdir $(DI); fi
112 -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
113 cp png.h pngconf.h $(DI)/$(LIBNAME)
114 chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
115 -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h
116 -@/bin/rm -f $(DI)/libpng
117 (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .)
118
119install-static: install-headers libpng.a
120 -@if [ ! -d $(DL) ]; then mkdir $(DL); fi
121 cp libpng.a $(DL)/$(LIBNAME).a
122 chmod 644 $(DL)/$(LIBNAME).a
123 -@/bin/rm -f $(DL)/libpng.a
124 (cd $(DL); ln -sf $(LIBNAME).a libpng.a)
125
126install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \
127 libpng.so.3.$(PNGMIN)
128 -@if [ ! -d $(DL) ]; then mkdir $(DL); fi
129 -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so
130 -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ)
131 -@/bin/rm -f $(DL)/libpng.so
132 -@/bin/rm -f $(DL)/libpng.so.3
133 -@/bin/rm -f $(DL)/libpng.so.3.$(PNGMIN)*
134 cp $(LIBNAME).so.$(PNGVER) $(DL)
135 cp libpng.so.3.$(PNGMIN) $(DL)
136 chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER)
137 chmod 755 $(DL)/libpng.so.3.$(PNGMIN)
138 (cd $(DL); \
139 ln -sf libpng.so.3.$(PNGMIN) libpng.so.3; \
140 ln -sf libpng.so.3 libpng.so; \
141 ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
142 ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
143 -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
144 -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
145 -@/bin/rm -f $(DL)/pkgconfig/libpng.pc
146 cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
147 chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
148 (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc)
149
150install-man: libpng.3 libpngpf.3 png.5
151 -@if [ ! -d $(DM) ]; then mkdir $(DM); fi
152 -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
153 -@/bin/rm -f $(DM)/man3/libpng.3
154 -@/bin/rm -f $(DM)/man3/libpngpf.3
155 cp libpng.3 $(DM)/man3
156 cp libpngpf.3 $(DM)/man3
157 -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
158 -@/bin/rm -f $(DM)/man5/png.5
159 cp png.5 $(DM)/man5
160
161install-config: libpng-config
162 -@if [ ! -d $(DB) ]; then mkdir $(DB); fi
163 -@/bin/rm -f $(DB)/libpng-config
164 -@/bin/rm -f $(DB)/$(LIBNAME)-config
165 cp libpng-config $(DB)/$(LIBNAME)-config
166 chmod 755 $(DB)/$(LIBNAME)-config
167 (cd $(DB); ln -sf $(LIBNAME)-config libpng-config)
168
169install: install-static install-shared install-man install-config
170
171# If you installed in $(DESTDIR), test-installed won't work until you
172# move the library to its final location. Use test-dd to test it
173# before then.
174
175test-dd:
176 echo
177 echo Testing installed dynamic shared library in $(DL).
178 $(CC) -I$(DI) -I$(ZLIBINC) \
179 `$(BINPATH)/libpng12-config --cflags` pngtest.c \
180 -L$(DL) -L$(ZLIBLIB) \
181 -rpath $(ZLIBLIB):$(DL)\
182 -o pngtestd `$(BINPATH)/libpng12-config --ldflags`
183 ./pngtestd pngtest.png
184
185test-installed:
186 echo
187 echo Testing installed dynamic shared library.
188 $(CC) -I$(ZLIBINC) \
189 `$(BINPATH)/libpng12-config --cflags` pngtest.c \
190 -L$(ZLIBLIB) \
191 -rpath $(ZLIBLIB):`$(BINPATH)/libpng12-config --libdir` \
192 -o pngtesti `$(BINPATH)/libpng12-config --ldflags`
193 ./pngtesti pngtest.png
194
195clean:
196 rm -f *.o libpng.a pngtest pngtesti pngout.png libpng.pc libpng-config \
197 $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \
198 libpng.so.3.$(PNGMIN) \
199 so_locations
200
201DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
202writelock:
203 chmod a-w *.[ch35] $(DOCS) scripts/*
204
205# DO NOT DELETE THIS LINE -- make depend depends on it.
206
207png.o: png.h pngconf.h
208pngerror.o: png.h pngconf.h
209pngrio.o: png.h pngconf.h
210pngwio.o: png.h pngconf.h
211pngmem.o: png.h pngconf.h
212pngset.o: png.h pngconf.h
213pngget.o: png.h pngconf.h
214pngread.o: png.h pngconf.h
215pngrtran.o: png.h pngconf.h
216pngrutil.o: png.h pngconf.h
217pngtest.o: png.h pngconf.h
218pngtrans.o: png.h pngconf.h
219pngwrite.o: png.h pngconf.h
220pngwtran.o: png.h pngconf.h
221pngwutil.o: png.h pngconf.h
222pngpread.o: png.h pngconf.h
223pnggccrd.o: png.h pngconf.h
224
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette