Glenn Randers-Pehrson | 1d96361 | 1998-05-02 12:52:25 -0500 | [diff] [blame] | 1 | # makefile for SCO OSr5 ELF and Unixware 7 with Native cc |
| 2 | # Contributed by Mike Hopkirk (hops@sco.com) modified from Makefile.lnx |
| 3 | # force ELF build dynamic linking, SONAME setting in lib and RPATH in app |
Glenn Randers-Pehrson | 98c9d73 | 2000-05-03 21:06:11 -0500 | [diff] [blame] | 4 | # Copyright (C) 1998 Greg Roelofs |
Glenn Randers-Pehrson | d436672 | 2000-06-04 14:29:29 -0500 | [diff] [blame^] | 5 | # Copyright (C) 1996, 1997 Andreas Dilger |
Glenn Randers-Pehrson | 1d96361 | 1998-05-02 12:52:25 -0500 | [diff] [blame] | 6 | # For conditions of distribution and use, see copyright notice in png.h |
| 7 | |
| 8 | CC=cc |
| 9 | |
Glenn Randers-Pehrson | 5c6aeb2 | 1998-12-29 11:47:59 -0600 | [diff] [blame] | 10 | # where make install puts libpng.a, libpng.so*, and png.h |
| 11 | prefix=/usr/local |
| 12 | |
Glenn Randers-Pehrson | 1d96361 | 1998-05-02 12:52:25 -0500 | [diff] [blame] | 13 | # Where the zlib library and include files are located |
| 14 | #ZLIBLIB=/usr/local/lib |
| 15 | #ZLIBINC=/usr/local/include |
| 16 | ZLIBLIB=../zlib |
| 17 | ZLIBINC=../zlib |
| 18 | |
| 19 | CFLAGS= -dy -belf -I$(ZLIBINC) -O3 |
| 20 | LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm |
| 21 | |
| 22 | #RANLIB=ranlib |
| 23 | RANLIB=echo |
| 24 | |
Glenn Randers-Pehrson | 98c9d73 | 2000-05-03 21:06:11 -0500 | [diff] [blame] | 25 | # read libpng.txt or png.h to see why PNGMAJ is 2. You should not |
Glenn Randers-Pehrson | 1d96361 | 1998-05-02 12:52:25 -0500 | [diff] [blame] | 26 | # have to change it. |
Glenn Randers-Pehrson | 98c9d73 | 2000-05-03 21:06:11 -0500 | [diff] [blame] | 27 | PNGMAJ = 2 |
Glenn Randers-Pehrson | d436672 | 2000-06-04 14:29:29 -0500 | [diff] [blame^] | 28 | PNGMIN = 1.0.7beta16 |
Glenn Randers-Pehrson | 1d96361 | 1998-05-02 12:52:25 -0500 | [diff] [blame] | 29 | PNGVER = $(PNGMAJ).$(PNGMIN) |
| 30 | |
Glenn Randers-Pehrson | 1d96361 | 1998-05-02 12:52:25 -0500 | [diff] [blame] | 31 | INCPATH=$(prefix)/include |
| 32 | LIBPATH=$(prefix)/lib |
| 33 | |
| 34 | OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ |
Glenn Randers-Pehrson | 4393a9a | 1999-09-17 12:27:26 -0500 | [diff] [blame] | 35 | pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ |
| 36 | pngwtran.o pngmem.o pngerror.o pngpread.o |
Glenn Randers-Pehrson | 1d96361 | 1998-05-02 12:52:25 -0500 | [diff] [blame] | 37 | |
| 38 | OBJSDLL = $(OBJS:.o=.pic.o) |
| 39 | |
| 40 | .SUFFIXES: .c .o .pic.o |
| 41 | |
| 42 | .c.pic.o: |
| 43 | $(CC) -c $(CFLAGS) -KPIC -o $@ $*.c |
| 44 | |
| 45 | all: libpng.a libpng.so pngtest |
| 46 | |
| 47 | libpng.a: $(OBJS) |
| 48 | ar rc $@ $(OBJS) |
| 49 | $(RANLIB) $@ |
| 50 | |
| 51 | libpng.so: libpng.so.$(PNGMAJ) |
Glenn Randers-Pehrson | 4393a9a | 1999-09-17 12:27:26 -0500 | [diff] [blame] | 52 | ln -f -s libpng.so.$(PNGMAJ) libpng.so |
Glenn Randers-Pehrson | 1d96361 | 1998-05-02 12:52:25 -0500 | [diff] [blame] | 53 | |
| 54 | libpng.so.$(PNGMAJ): libpng.so.$(PNGVER) |
Glenn Randers-Pehrson | 4393a9a | 1999-09-17 12:27:26 -0500 | [diff] [blame] | 55 | ln -f -s libpng.so.$(PNGVER) libpng.so.$(PNGMAJ) |
Glenn Randers-Pehrson | 1d96361 | 1998-05-02 12:52:25 -0500 | [diff] [blame] | 56 | |
| 57 | libpng.so.$(PNGVER): $(OBJSDLL) |
| 58 | $(CC) -G -Wl,-h,libpng.so.$(PNGMAJ) -o libpng.so.$(PNGVER) \ |
| 59 | $(OBJSDLL) |
| 60 | |
| 61 | pngtest: pngtest.o libpng.so |
| 62 | LD_RUN_PATH=.:$(ZLIBLIB) $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) |
| 63 | |
| 64 | test: pngtest |
| 65 | ./pngtest |
| 66 | |
| 67 | install: libpng.a libpng.so.$(PNGVER) |
| 68 | -@mkdir $(INCPATH) $(LIBPATH) |
| 69 | cp png.h pngconf.h $(INCPATH) |
| 70 | chmod 644 $(INCPATH)/png.h $(INCPATH)/pngconf.h |
| 71 | cp libpng.a libpng.so.$(PNGVER) $(LIBPATH) |
| 72 | chmod 755 $(LIBPATH)/libpng.so.$(PNGVER) |
| 73 | -@/bin/rm -f $(LIBPATH)/libpng.so.$(PNGMAJ) $(LIBPATH)/libpng.so |
Glenn Randers-Pehrson | 4393a9a | 1999-09-17 12:27:26 -0500 | [diff] [blame] | 74 | (cd $(LIBPATH); ln -f -s libpng.so.$(PNGVER) libpng.so.$(PNGMAJ); \ |
| 75 | ln -f -s libpng.so.$(PNGMAJ) libpng.so) |
Glenn Randers-Pehrson | 1d96361 | 1998-05-02 12:52:25 -0500 | [diff] [blame] | 76 | |
| 77 | clean: |
| 78 | /bin/rm -f *.o libpng.a libpng.so* pngtest pngout.png |
| 79 | |
Glenn Randers-Pehrson | 166c5a3 | 1999-12-10 09:43:02 -0600 | [diff] [blame] | 80 | DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO |
| 81 | writelock: |
| 82 | chmod a-w *.[ch35] $(DOCS) scripts/* |
| 83 | |
Glenn Randers-Pehrson | 1d96361 | 1998-05-02 12:52:25 -0500 | [diff] [blame] | 84 | # DO NOT DELETE THIS LINE -- make depend depends on it. |
| 85 | |
| 86 | png.o png.pic.o: png.h pngconf.h |
| 87 | pngerror.o pngerror.pic.o: png.h pngconf.h |
| 88 | pngrio.o pngrio.pic.o: png.h pngconf.h |
| 89 | pngwio.o pngwio.pic.o: png.h pngconf.h |
| 90 | pngmem.o pngmem.pic.o: png.h pngconf.h |
| 91 | pngset.o pngset.pic.o: png.h pngconf.h |
| 92 | pngget.o pngget.pic.o: png.h pngconf.h |
| 93 | pngread.o pngread.pic.o: png.h pngconf.h |
| 94 | pngrtran.o pngrtran.pic.o: png.h pngconf.h |
| 95 | pngrutil.o pngrutil.pic.o: png.h pngconf.h |
| 96 | pngtrans.o pngtrans.pic.o: png.h pngconf.h |
| 97 | pngwrite.o pngwrite.pic.o: png.h pngconf.h |
| 98 | pngwtran.o pngwtran.pic.o: png.h pngconf.h |
| 99 | pngwutil.o pngwutil.pic.o: png.h pngconf.h |
| 100 | pngpread.o pngpread.pic.o: png.h pngconf.h |
| 101 | |
| 102 | pngtest.o: png.h pngconf.h |