blob: 3163354e978452ae4442e0392be43c02b96a2b24 [file] [log] [blame]
Glenn Randers-Pehrson4393a9a1999-09-17 12:27:26 -05001# makefile for libpng on BeOS x86 ELF with gcc
Glenn Randers-Pehrsonbcfd15d1999-10-01 14:22:25 -05002# modified from makefile.linux by Sander Stoks
Glenn Randers-Pehrson98c9d732000-05-03 21:06:11 -05003# Copyright (C) 1999 Greg Roelofs
Glenn Randers-Pehrsond4366722000-06-04 14:29:29 -05004# Copyright (C) 1996, 1997 Andreas Dilger
Glenn Randers-Pehrson4393a9a1999-09-17 12:27:26 -05005# For conditions of distribution and use, see copyright notice in png.h
6
7CC=gcc
8
9# Where the zlib library and include files are located
10ZLIBLIB=/usr/local/lib
11ZLIBINC=/usr/local/include
12
13ALIGN=
Glenn Randers-Pehrsonf8b008c1999-09-18 10:54:36 -050014# For i386:
Glenn Randers-Pehrson4393a9a1999-09-17 12:27:26 -050015# ALIGN=-malign-loops=2 -malign-functions=2
16
17WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
18 -Wmissing-declarations -Wtraditional -Wcast-align \
19 -Wstrict-prototypes -Wmissing-prototypes #-Wconversion
20
21# On BeOS, -O1 is actually better than -O3. This is a known bug but it's
22# still here in R4.5
23CFLAGS=-I$(ZLIBINC) -Wall -O1 -funroll-loops \
24 $(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5
25# LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng -lz -lm
26LDFLAGS=-L. -Wl,-soname=libpng.so.$(PNGMAJ) -L$(ZLIBLIB) -lz -lm
27
28RANLIB=ranlib
29#RANLIB=echo
30
Glenn Randers-Pehrson98c9d732000-05-03 21:06:11 -050031# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
32# have to change it.
33PNGMAJ = 2
Glenn Randers-Pehrsonff9c9472000-07-11 07:12:36 -050034PNGMIN = 1.0.8beta3
Glenn Randers-Pehrson98c9d732000-05-03 21:06:11 -050035PNGVER = $(PNGMAJ).$(PNGMIN)
Glenn Randers-Pehrson4393a9a1999-09-17 12:27:26 -050036
37# where make install puts libpng.a, libpng.so*, and png.h
38prefix=/usr/local
39INCPATH=$(prefix)/include
40LIBPATH=$(prefix)/lib
41
42OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
43 pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
44 pngwtran.o pngmem.o pngerror.o pngpread.o
45
46OBJSDLL = $(OBJS)
47
48.SUFFIXES: .c .o
49
50all: libpng.a libpng.so pngtest
51
52libpng.a: $(OBJS)
53 ar rc $@ $(OBJS)
54 $(RANLIB) $@
55
56libpng.so: libpng.so.$(PNGMAJ)
57 ln -sf libpng.so.$(PNGMAJ) libpng.so
58 cp libpng.so* /boot/home/config/lib
59
60libpng.so.$(PNGMAJ): libpng.so.$(PNGVER)
61 ln -sf libpng.so.$(PNGVER) libpng.so.$(PNGMAJ)
62
63libpng.so.$(PNGVER): $(OBJSDLL)
64 $(CC) -L$(ZLIBLIB) -lz -nostart -Wl,-soname,libpng.so.$(PNGMAJ) -o
65libpng.so.$(PNGVER) \
66 $(OBJSDLL)
67
68pngtest: pngtest.o libpng.so
69 $(CC) -L$(ZLIBLIB) -lz -lpng -o pngtest pngtest.o
70
71test: pngtest
72 ./pngtest
73
74install: libpng.a libpng.so.$(PNGVER)
75 -@mkdir $(INCPATH) $(LIBPATH)
76 cp png.h pngconf.h $(INCPATH)
77 chmod 644 $(INCPATH)/png.h $(INCPATH)/pngconf.h
78 cp libpng.a libpng.so.$(PNGVER) $(LIBPATH)
79 chmod 755 $(LIBPATH)/libpng.so.$(PNGVER)
80 -@/bin/rm -f $(LIBPATH)/libpng.so.$(PNGMAJ) $(LIBPATH)/libpng.so
81 (cd $(LIBPATH); ln -sf libpng.so.$(PNGVER) libpng.so.$(PNGMAJ); \
82 ln -sf libpng.so.$(PNGMAJ) libpng.so)
83
84clean:
85 /bin/rm -f *.o libpng.a libpng.so* pngtest pngout.png
86
87# DO NOT DELETE THIS LINE -- make depend depends on it.
88
89png.o png.pic.o: png.h pngconf.h
90pngerror.o pngerror.pic.o: png.h pngconf.h
91pngrio.o pngrio.pic.o: png.h pngconf.h
92pngwio.o pngwio.pic.o: png.h pngconf.h
93pngmem.o pngmem.pic.o: png.h pngconf.h
94pngset.o pngset.pic.o: png.h pngconf.h
95pngget.o pngget.pic.o: png.h pngconf.h
96pngread.o pngread.pic.o: png.h pngconf.h
97pngrtran.o pngrtran.pic.o: png.h pngconf.h
98pngrutil.o pngrutil.pic.o: png.h pngconf.h
99pngtrans.o pngtrans.pic.o: png.h pngconf.h
100pngwrite.o pngwrite.pic.o: png.h pngconf.h
101pngwtran.o pngwtran.pic.o: png.h pngconf.h
102pngwutil.o pngwutil.pic.o: png.h pngconf.h
103pngpread.o pngpread.pic.o: png.h pngconf.h
104pngtest.o: png.h pngconf.h