Glenn Randers-Pehrson | 4393a9a | 1999-09-17 12:27:26 -0500 | [diff] [blame] | 1 | # makefile for libpng on BeOS x86 ELF with gcc |
Glenn Randers-Pehrson | bcfd15d | 1999-10-01 14:22:25 -0500 | [diff] [blame] | 2 | # modified from makefile.linux by Sander Stoks |
Glenn Randers-Pehrson | 98c9d73 | 2000-05-03 21:06:11 -0500 | [diff] [blame] | 3 | # Copyright (C) 1999 Greg Roelofs |
Glenn Randers-Pehrson | d436672 | 2000-06-04 14:29:29 -0500 | [diff] [blame] | 4 | # Copyright (C) 1996, 1997 Andreas Dilger |
Glenn Randers-Pehrson | 4393a9a | 1999-09-17 12:27:26 -0500 | [diff] [blame] | 5 | # For conditions of distribution and use, see copyright notice in png.h |
| 6 | |
| 7 | CC=gcc |
| 8 | |
| 9 | # Where the zlib library and include files are located |
| 10 | ZLIBLIB=/usr/local/lib |
| 11 | ZLIBINC=/usr/local/include |
| 12 | |
Glenn Randers-Pehrson | 8b6a889 | 2001-05-18 04:54:50 -0500 | [diff] [blame] | 13 | # read libpng.txt or png.h to see why PNGMAJ is 3. You should not |
Glenn Randers-Pehrson | be9de0f | 2001-01-22 08:52:16 -0600 | [diff] [blame] | 14 | # have to change it. |
Glenn Randers-Pehrson | 8b6a889 | 2001-05-18 04:54:50 -0500 | [diff] [blame] | 15 | PNGMAJ = 3 |
Glenn Randers-Pehrson | 1ea0ff3 | 2001-08-07 22:25:59 -0500 | [diff] [blame^] | 16 | PNGMIN = 1.2.0beta5 |
Glenn Randers-Pehrson | be9de0f | 2001-01-22 08:52:16 -0600 | [diff] [blame] | 17 | PNGVER = $(PNGMAJ).$(PNGMIN) |
| 18 | |
Glenn Randers-Pehrson | 4393a9a | 1999-09-17 12:27:26 -0500 | [diff] [blame] | 19 | ALIGN= |
Glenn Randers-Pehrson | f8b008c | 1999-09-18 10:54:36 -0500 | [diff] [blame] | 20 | # For i386: |
Glenn Randers-Pehrson | 4393a9a | 1999-09-17 12:27:26 -0500 | [diff] [blame] | 21 | # ALIGN=-malign-loops=2 -malign-functions=2 |
| 22 | |
| 23 | WARNMORE=-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 |
| 29 | CFLAGS=-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 |
| 32 | LDFLAGS=-L. -Wl,-soname=libpng.so.$(PNGMAJ) -L$(ZLIBLIB) -lz -lm |
| 33 | |
| 34 | RANLIB=ranlib |
| 35 | #RANLIB=echo |
| 36 | |
Glenn Randers-Pehrson | 4393a9a | 1999-09-17 12:27:26 -0500 | [diff] [blame] | 37 | # where make install puts libpng.a, libpng.so*, and png.h |
| 38 | prefix=/usr/local |
| 39 | INCPATH=$(prefix)/include |
| 40 | LIBPATH=$(prefix)/lib |
| 41 | |
| 42 | OBJS = 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 | |
| 46 | OBJSDLL = $(OBJS) |
| 47 | |
| 48 | .SUFFIXES: .c .o |
| 49 | |
| 50 | all: libpng.a libpng.so pngtest |
| 51 | |
| 52 | libpng.a: $(OBJS) |
| 53 | ar rc $@ $(OBJS) |
| 54 | $(RANLIB) $@ |
| 55 | |
| 56 | libpng.so: libpng.so.$(PNGMAJ) |
| 57 | ln -sf libpng.so.$(PNGMAJ) libpng.so |
| 58 | cp libpng.so* /boot/home/config/lib |
| 59 | |
| 60 | libpng.so.$(PNGMAJ): libpng.so.$(PNGVER) |
| 61 | ln -sf libpng.so.$(PNGVER) libpng.so.$(PNGMAJ) |
| 62 | |
| 63 | libpng.so.$(PNGVER): $(OBJSDLL) |
| 64 | $(CC) -L$(ZLIBLIB) -lz -nostart -Wl,-soname,libpng.so.$(PNGMAJ) -o |
| 65 | libpng.so.$(PNGVER) \ |
| 66 | $(OBJSDLL) |
| 67 | |
| 68 | pngtest: pngtest.o libpng.so |
| 69 | $(CC) -L$(ZLIBLIB) -lz -lpng -o pngtest pngtest.o |
| 70 | |
| 71 | test: pngtest |
| 72 | ./pngtest |
| 73 | |
| 74 | install: 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 | |
| 84 | clean: |
| 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 | |
| 89 | png.o png.pic.o: png.h pngconf.h |
| 90 | pngerror.o pngerror.pic.o: png.h pngconf.h |
| 91 | pngrio.o pngrio.pic.o: png.h pngconf.h |
| 92 | pngwio.o pngwio.pic.o: png.h pngconf.h |
| 93 | pngmem.o pngmem.pic.o: png.h pngconf.h |
| 94 | pngset.o pngset.pic.o: png.h pngconf.h |
| 95 | pngget.o pngget.pic.o: png.h pngconf.h |
| 96 | pngread.o pngread.pic.o: png.h pngconf.h |
| 97 | pngrtran.o pngrtran.pic.o: png.h pngconf.h |
| 98 | pngrutil.o pngrutil.pic.o: png.h pngconf.h |
| 99 | pngtrans.o pngtrans.pic.o: png.h pngconf.h |
| 100 | pngwrite.o pngwrite.pic.o: png.h pngconf.h |
| 101 | pngwtran.o pngwtran.pic.o: png.h pngconf.h |
| 102 | pngwutil.o pngwutil.pic.o: png.h pngconf.h |
| 103 | pngpread.o pngpread.pic.o: png.h pngconf.h |
| 104 | pngtest.o: png.h pngconf.h |