Andreas Dilger | 47a0c42 | 1997-05-16 02:46:07 -0500 | [diff] [blame] | 1 | # makefile for libpng |
| 2 | # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. |
| 3 | # For conditions of distribution and use, see copyright notice in png.h |
| 4 | |
Glenn Randers-Pehrson | 5c6aeb2 | 1998-12-29 11:47:59 -0600 | [diff] [blame] | 5 | # where make install puts libpng.a and png.h |
| 6 | prefix=/usr/local |
| 7 | |
Andreas Dilger | 47a0c42 | 1997-05-16 02:46:07 -0500 | [diff] [blame] | 8 | # Where the zlib library and include files are located |
| 9 | #ZLIBLIB=/usr/local/lib |
| 10 | #ZLIBINC=/usr/local/include |
| 11 | ZLIBLIB=../zlib |
| 12 | ZLIBINC=../zlib |
| 13 | |
| 14 | |
| 15 | WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow -Wconversion \ |
Glenn Randers-Pehrson | 4393a9a | 1999-09-17 12:27:26 -0500 | [diff] [blame] | 16 | -Wmissing-declarations -Wtraditional -Wcast-align \ |
| 17 | -Wstrict-prototypes -Wmissing-prototypes |
Andreas Dilger | 47a0c42 | 1997-05-16 02:46:07 -0500 | [diff] [blame] | 18 | CC=gcc |
Glenn Randers-Pehrson | 896239b | 1998-04-21 15:03:57 -0500 | [diff] [blame] | 19 | CFLAGS=-I$(ZLIBINC) -O # $(WARNMORE) -DPNG_DEBUG=5 |
Andreas Dilger | 47a0c42 | 1997-05-16 02:46:07 -0500 | [diff] [blame] | 20 | LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm |
| 21 | |
| 22 | RANLIB=ranlib |
| 23 | #RANLIB=echo |
| 24 | |
Andreas Dilger | 47a0c42 | 1997-05-16 02:46:07 -0500 | [diff] [blame] | 25 | OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ |
| 26 | pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ |
| 27 | pngwtran.o pngmem.o pngerror.o pngpread.o |
| 28 | |
| 29 | all: libpng.a pngtest |
| 30 | |
| 31 | libpng.a: $(OBJS) |
| 32 | ar rc $@ $(OBJS) |
| 33 | $(RANLIB) $@ |
| 34 | |
| 35 | pngtest: pngtest.o libpng.a |
Glenn Randers-Pehrson | ea3bcd7 | 1998-03-07 14:33:00 -0600 | [diff] [blame] | 36 | $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) |
Andreas Dilger | 47a0c42 | 1997-05-16 02:46:07 -0500 | [diff] [blame] | 37 | |
| 38 | test: pngtest |
| 39 | ./pngtest |
| 40 | |
| 41 | install: libpng.a |
| 42 | -@mkdir $(prefix)/include |
| 43 | -@mkdir $(prefix)/lib |
| 44 | cp png.h $(prefix)/include |
| 45 | cp pngconf.h $(prefix)/include |
| 46 | chmod 644 $(prefix)/include/png.h |
| 47 | chmod 644 $(prefix)/include/pngconf.h |
| 48 | cp libpng.a $(prefix)/lib |
| 49 | chmod 644 $(prefix)/lib/libpng.a |
| 50 | |
| 51 | clean: |
| 52 | rm -f *.o libpng.a pngtest pngout.png |
| 53 | |
| 54 | # DO NOT DELETE THIS LINE -- make depend depends on it. |
| 55 | |
| 56 | png.o: png.h pngconf.h |
| 57 | pngerror.o: png.h pngconf.h |
| 58 | pngrio.o: png.h pngconf.h |
| 59 | pngwio.o: png.h pngconf.h |
| 60 | pngmem.o: png.h pngconf.h |
| 61 | pngset.o: png.h pngconf.h |
| 62 | pngget.o: png.h pngconf.h |
| 63 | pngread.o: png.h pngconf.h |
| 64 | pngrtran.o: png.h pngconf.h |
| 65 | pngrutil.o: png.h pngconf.h |
| 66 | pngtest.o: png.h pngconf.h |
| 67 | pngtrans.o: png.h pngconf.h |
| 68 | pngwrite.o: png.h pngconf.h |
| 69 | pngwtran.o: png.h pngconf.h |
| 70 | pngwutil.o: png.h pngconf.h |
| 71 | pngpread.o: png.h pngconf.h |
| 72 | |