1
# makefile for libpng on BeOS x86 ELF with gcc
2
# modified from makefile.linux by Sander Stoks
3
# Copyright (C) 2002 Glenn Randers-Pehrson
4
# Copyright (C) 1999 Greg Roelofs
5
# Copyright (C) 1996, 1997 Andreas Dilger
6
# For conditions of distribution and use, see copyright notice in png.h
10
# Where the zlib library and include files are located
11
ZLIBLIB=/usr/local/lib
12
ZLIBINC=/usr/local/include
16
PNGVER = $(PNGMAJ).$(PNGMIN)
20
# ALIGN=-malign-loops=2 -malign-functions=2
22
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
23
-Wmissing-declarations -Wtraditional -Wcast-align \
24
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
26
# On BeOS, -O1 is actually better than -O3. This is a known bug but it's
28
CFLAGS=-I$(ZLIBINC) -Wall -O1 -funroll-loops \
29
$(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5
30
# LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng -lz -lm
31
LDFLAGS=-L. -Wl,-soname=$(LIBNAME).so.$(PNGMAJ) -L$(ZLIBLIB) -lz -lm
36
# where make install puts libpng.a, libpng12.so*, and png.h
38
INCPATH=$(prefix)/include
43
# override DESTDIR= on the make install command line to easily support
44
# installing into a temporary location. Example:
46
# make install DESTDIR=/tmp/build/libpng
48
# If you're going to install into a temporary location
49
# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
50
# you execute make install.
53
DB=$(DESTDIR)$(BINPATH)
54
DI=$(DESTDIR)$(INCPATH)
55
DL=$(DESTDIR)$(LIBPATH)
56
DM=$(DESTDIR)$(MANPATH)
60
OBJS = 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
68
all: libpng.a $(LIBNAME).so pngtest libpng.pc libpng-config
75
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
78
( cat scripts/libpng-config-head.in; \
79
echo prefix=\"$(prefix)\"; \
80
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
81
echo libs=\"-lpng12 -lz -lm\"; \
82
cat scripts/libpng-config-body.in ) > libpng-config
83
chmod +x libpng-config
85
$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
86
ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
87
cp $(LIBNAME).so* /boot/home/config/lib
89
$(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER)
90
ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ)
92
$(LIBNAME).so.$(PNGVER): $(OBJSDLL)
93
$(CC) -nostart -Wl,-soname,$(LIBNAME).so.$(PNGMAJ) -o \
94
$(LIBNAME).so.$(PNGVER) $(OBJSDLL)
96
libpng.so.3.$(PNGMIN): $(OBJSDLL)
97
$(CC) -nostart -Wl,-soname,libpng.so.3 -o \
98
libpng.so.3.$(PNGMIN) $(OBJSDLL)
100
pngtest: pngtest.o $(LIBNAME).so
101
$(CC) -L$(ZLIBLIB) -lz -lpng12 -o pngtest pngtest.o
106
install-headers: png.h pngconf.h
107
-@if [ ! -d $(DI) ]; then mkdir $(DI); fi
108
-@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
109
cp png.h pngconf.h $(DI)/$(LIBNAME)
110
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
111
-@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h
112
-@/bin/rm -f $(DI)/libpng
113
(cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .)
115
install-static: install-headers libpng.a
116
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
117
cp libpng.a $(DL)/$(LIBNAME).a
118
chmod 644 $(DL)/$(LIBNAME).a
119
-@/bin/rm -f $(DL)/libpng.a
120
(cd $(DL); ln -sf $(LIBNAME).a libpng.a)
122
install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \
123
libpng.so.3.$(PNGMIN)
124
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
125
-@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so
126
-@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ)
127
-@/bin/rm -f $(DL)/libpng.so
128
-@/bin/rm -f $(DL)/libpng.so.3
129
-@/bin/rm -f $(DL)/libpng.so.3.$(PNGMIN)*
130
cp $(LIBNAME).so.$(PNGVER) $(DL)
131
cp libpng.so.3.$(PNGMIN) $(DL)
132
chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER)
133
chmod 755 $(DL)/libpng.so.3.$(PNGMIN)
135
ln -sf libpng.so.3.$(PNGMIN) libpng.so.3; \
136
ln -sf libpng.so.3 libpng.so; \
137
ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
138
ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
139
-@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
140
-@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
141
-@/bin/rm -f $(DL)/pkgconfig/libpng.pc
142
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
143
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
144
(cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc)
146
install-man: libpng.3 libpngpf.3 png.5
147
-@if [ ! -d $(DM) ]; then mkdir $(DM); fi
148
-@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
149
-@/bin/rm -f $(DM)/man3/libpng.3
150
-@/bin/rm -f $(DM)/man3/libpngpf.3
151
cp libpng.3 $(DM)/man3
152
cp libpngpf.3 $(DM)/man3
153
-@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
154
-@/bin/rm -f $(DM)/man5/png.5
157
install-config: libpng-config
158
-@if [ ! -d $(DB) ]; then mkdir $(DB); fi
159
-@/bin/rm -f $(DB)/libpng-config
160
-@/bin/rm -f $(DB)/$(LIBNAME)-config
161
cp libpng-config $(DB)/$(LIBNAME)-config
162
chmod 755 $(DB)/$(LIBNAME)-config
163
(cd $(DB); ln -sf $(LIBNAME)-config libpng-config)
165
install: install-static install-shared install-man install-config
167
# If you installed in $(DESTDIR), test-installed won't work until you
168
# move the library to its final location. Use test-dd to test it
173
echo Testing installed dynamic shared library in $(DL).
174
$(CC) -I$(DI) $(CFLAGS) \
175
`$(BINPATH)/libpng12-config --cflags` pngtest.c \
176
-L$(DL) -L$(ZLIBLIB) -W1,-rpath $(ZLIBLIB):$(DL) \
177
-o pngtestd `$(BINPATH)/libpng12-config --ldflags`
178
./pngtestd pngtest.png
182
`$(BINPATH)/libpng12-config --cflags` pngtest.c \
183
-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \
184
-o pngtesti `$(BINPATH)/libpng12-config --ldflags`
185
./pngtesti pngtest.png
188
/bin/rm -f *.o libpng.a pngtest pngout.png libpng-config \
189
$(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* pngtesti \
190
libpng.so.3.$(PNGMIN) \
193
# DO NOT DELETE THIS LINE -- make depend depends on it.
195
png.o png.pic.o: png.h pngconf.h
196
pngerror.o pngerror.pic.o: png.h pngconf.h
197
pngrio.o pngrio.pic.o: png.h pngconf.h
198
pngwio.o pngwio.pic.o: png.h pngconf.h
199
pngmem.o pngmem.pic.o: png.h pngconf.h
200
pngset.o pngset.pic.o: png.h pngconf.h
201
pngget.o pngget.pic.o: png.h pngconf.h
202
pngread.o pngread.pic.o: png.h pngconf.h
203
pngrtran.o pngrtran.pic.o: png.h pngconf.h
204
pngrutil.o pngrutil.pic.o: png.h pngconf.h
205
pngtrans.o pngtrans.pic.o: png.h pngconf.h
206
pngwrite.o pngwrite.pic.o: png.h pngconf.h
207
pngwtran.o pngwtran.pic.o: png.h pngconf.h
208
pngwutil.o pngwutil.pic.o: png.h pngconf.h
209
pngpread.o pngpread.pic.o: png.h pngconf.h
210
pngtest.o: png.h pngconf.h