blob: d19419892fa9c230cf3b6758d92285632fb4e553 [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
Glenn Randers-Pehrson8b6a8892001-05-18 04:54:50 -050013# read libpng.txt or png.h to see why PNGMAJ is 3. You should not
Glenn Randers-Pehrsonbe9de0f2001-01-22 08:52:16 -060014# have to change it.
Glenn Randers-Pehrson8b6a8892001-05-18 04:54:50 -050015PNGMAJ = 3
Glenn Randers-Pehrsonae498dc2001-11-24 14:53:31 -060016PNGMIN = 1.2.1rc1
Glenn Randers-Pehrsonbe9de0f2001-01-22 08:52:16 -060017PNGVER = $(PNGMAJ).$(PNGMIN)
18
Glenn Randers-Pehrson4393a9a1999-09-17 12:27:26 -050019ALIGN=
Glenn Randers-Pehrsonf8b008c1999-09-18 10:54:36 -050020# For i386:
Glenn Randers-Pehrson4393a9a1999-09-17 12:27:26 -050021# ALIGN=-malign-loops=2 -malign-functions=2
22
23WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
24 -Wmissing-declarations -Wtraditional -Wcast-align \
25 -Wstrict-prototypes -Wmissing-prototypes #-Wconversion
26
27# On BeOS, -O1 is actually better than -O3. This is a known bug but it's
28# still here in R4.5
29CFLAGS=-I$(ZLIBINC) -Wall -O1 -funroll-loops \
30 $(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5
31# LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng -lz -lm
32LDFLAGS=-L. -Wl,-soname=libpng.so.$(PNGMAJ) -L$(ZLIBLIB) -lz -lm
33
34RANLIB=ranlib
35#RANLIB=echo
36
Glenn Randers-Pehrson4393a9a1999-09-17 12:27:26 -050037# 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:
Glenn Randers-Pehrsonae498dc2001-11-24 14:53:31 -060085 /bin/rm -f *.o libpng.a libpng.so libpng.so.$(PNGMAJ)* pngtest pngout.png
Glenn Randers-Pehrson4393a9a1999-09-17 12:27:26 -050086
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