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