Glenn Randers-Pehrson | d12aa50 | 1998-03-13 07:39:39 -0600 | [diff] [blame] | 1 | # makefile for libpng on Solaris 2.x with gcc |
Glenn Randers-Pehrson | bcfd15d | 1999-10-01 14:22:25 -0500 | [diff] [blame] | 2 | # Contributed by William L. Sebok, based on makefile.linux |
Andreas Dilger | 02ad0ef | 1997-01-17 01:34:35 -0600 | [diff] [blame] | 3 | # Copyright (C) 1996, 1997 Andreas Dilger |
Glenn Randers-Pehrson | c4a2ae6 | 1998-01-16 22:06:18 -0600 | [diff] [blame] | 4 | # Copyright (C) 1998 Greg Roelofs |
Guy Schalnat | 4ee97b0 | 1996-01-16 01:51:56 -0600 | [diff] [blame] | 5 | # For conditions of distribution and use, see copyright notice in png.h |
| 6 | |
| 7 | CC=gcc |
Andreas Dilger | 47a0c42 | 1997-05-16 02:46:07 -0500 | [diff] [blame] | 8 | |
Glenn Randers-Pehrson | 166c5a3 | 1999-12-10 09:43:02 -0600 | [diff] [blame^] | 9 | case "`type ld`" in *ucb*) echo " |
| 10 | # WARNING: |
| 11 | # The commands "CC" and "LD" must NOT refer to /usr/ucb/cc and |
| 12 | # /usr/ucb/ld. If they do, you need to adjust your PATH environment |
| 13 | # variable to put /usr/ccs/bin ahead of /usr/ucb. The environment |
| 14 | # variable LD_LIBRARY_PATH should not be set at all. If it is, |
| 15 | # things are likely to break because of the libucb dependency that |
| 16 | # is created. |
| 17 | " ;; |
| 18 | esac |
Glenn Randers-Pehrson | 4393a9a | 1999-09-17 12:27:26 -0500 | [diff] [blame] | 19 | |
| 20 | # Where make install puts libpng.a, libpng.so*, and png.h |
Glenn Randers-Pehrson | 5c6aeb2 | 1998-12-29 11:47:59 -0600 | [diff] [blame] | 21 | prefix=/usr/local |
| 22 | |
Andreas Dilger | 47a0c42 | 1997-05-16 02:46:07 -0500 | [diff] [blame] | 23 | # Where the zlib library and include files are located |
Glenn Randers-Pehrson | f9f2fe0 | 1998-03-15 18:20:23 -0600 | [diff] [blame] | 24 | # Changing these to ../zlib poses a security risk. If you want |
| 25 | # to have zlib in an adjacent directory, specify the full path instead of "..". |
| 26 | #ZLIBLIB=../zlib |
| 27 | #ZLIBINC=../zlib |
| 28 | |
| 29 | ZLIBLIB=/usr/local/lib |
| 30 | ZLIBINC=/usr/local/include |
Glenn Randers-Pehrson | d12aa50 | 1998-03-13 07:39:39 -0600 | [diff] [blame] | 31 | |
Andreas Dilger | 47a0c42 | 1997-05-16 02:46:07 -0500 | [diff] [blame] | 32 | WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \ |
Glenn Randers-Pehrson | 4393a9a | 1999-09-17 12:27:26 -0500 | [diff] [blame] | 33 | -Wmissing-declarations -Wtraditional -Wcast-align \ |
| 34 | -Wstrict-prototypes -Wmissing-prototypes #-Wconversion |
Glenn Randers-Pehrson | 08a3343 | 1998-03-07 06:06:55 -0600 | [diff] [blame] | 35 | CFLAGS=-I$(ZLIBINC) -Wall -O3 \ |
Glenn Randers-Pehrson | 4393a9a | 1999-09-17 12:27:26 -0500 | [diff] [blame] | 36 | # $(WARNMORE) -g -DPNG_DEBUG=5 |
Glenn Randers-Pehrson | 08a3343 | 1998-03-07 06:06:55 -0600 | [diff] [blame] | 37 | LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng -lz -lm |
Guy Schalnat | 4ee97b0 | 1996-01-16 01:51:56 -0600 | [diff] [blame] | 38 | |
Glenn Randers-Pehrson | 08a3343 | 1998-03-07 06:06:55 -0600 | [diff] [blame] | 39 | #RANLIB=ranlib |
| 40 | RANLIB=echo |
Guy Schalnat | 4ee97b0 | 1996-01-16 01:51:56 -0600 | [diff] [blame] | 41 | |
Glenn Randers-Pehrson | 08a3343 | 1998-03-07 06:06:55 -0600 | [diff] [blame] | 42 | # read libpng.txt or png.h to see why PNGMAJ is 2. You should not |
| 43 | # have to change it. |
Glenn Randers-Pehrson | 2687fcc | 1998-01-07 20:54:20 -0600 | [diff] [blame] | 44 | PNGMAJ = 2 |
Glenn Randers-Pehrson | 166c5a3 | 1999-12-10 09:43:02 -0600 | [diff] [blame^] | 45 | PNGMIN = 1.0.5h |
Andreas Dilger | 02ad0ef | 1997-01-17 01:34:35 -0600 | [diff] [blame] | 46 | PNGVER = $(PNGMAJ).$(PNGMIN) |
Guy Schalnat | 4ee97b0 | 1996-01-16 01:51:56 -0600 | [diff] [blame] | 47 | |
Andreas Dilger | 47a0c42 | 1997-05-16 02:46:07 -0500 | [diff] [blame] | 48 | INCPATH=$(prefix)/include |
| 49 | LIBPATH=$(prefix)/lib |
Guy Schalnat | 4ee97b0 | 1996-01-16 01:51:56 -0600 | [diff] [blame] | 50 | |
Andreas Dilger | 47a0c42 | 1997-05-16 02:46:07 -0500 | [diff] [blame] | 51 | 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] | 52 | pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ |
| 53 | pngwtran.o pngmem.o pngerror.o pngpread.o |
Guy Schalnat | 4ee97b0 | 1996-01-16 01:51:56 -0600 | [diff] [blame] | 54 | |
Glenn Randers-Pehrson | 2687fcc | 1998-01-07 20:54:20 -0600 | [diff] [blame] | 55 | OBJSDLL = $(OBJS:.o=.pic.o) |
| 56 | |
| 57 | .SUFFIXES: .c .o .pic.o |
| 58 | |
| 59 | .c.pic.o: |
| 60 | $(CC) -c $(CFLAGS) -fPIC -o $@ $*.c |
| 61 | |
| 62 | all: libpng.a libpng.so pngtest |
Guy Schalnat | 4ee97b0 | 1996-01-16 01:51:56 -0600 | [diff] [blame] | 63 | |
| 64 | libpng.a: $(OBJS) |
Glenn Randers-Pehrson | 2687fcc | 1998-01-07 20:54:20 -0600 | [diff] [blame] | 65 | ar rc $@ $(OBJS) |
Guy Schalnat | 4ee97b0 | 1996-01-16 01:51:56 -0600 | [diff] [blame] | 66 | $(RANLIB) $@ |
| 67 | |
Andreas Dilger | 02ad0ef | 1997-01-17 01:34:35 -0600 | [diff] [blame] | 68 | libpng.so: libpng.so.$(PNGMAJ) |
Glenn Randers-Pehrson | 4393a9a | 1999-09-17 12:27:26 -0500 | [diff] [blame] | 69 | ln -f -s libpng.so.$(PNGMAJ) libpng.so |
Guy Schalnat | 4ee97b0 | 1996-01-16 01:51:56 -0600 | [diff] [blame] | 70 | |
Andreas Dilger | 02ad0ef | 1997-01-17 01:34:35 -0600 | [diff] [blame] | 71 | libpng.so.$(PNGMAJ): libpng.so.$(PNGVER) |
Glenn Randers-Pehrson | 4393a9a | 1999-09-17 12:27:26 -0500 | [diff] [blame] | 72 | ln -f -s libpng.so.$(PNGVER) libpng.so.$(PNGMAJ) |
Guy Schalnat | 4ee97b0 | 1996-01-16 01:51:56 -0600 | [diff] [blame] | 73 | |
Glenn Randers-Pehrson | 2687fcc | 1998-01-07 20:54:20 -0600 | [diff] [blame] | 74 | libpng.so.$(PNGVER): $(OBJSDLL) |
Glenn Randers-Pehrson | d12aa50 | 1998-03-13 07:39:39 -0600 | [diff] [blame] | 75 | $(LD) -G -L$(ZLIBLIB) -R$(ZLIBLIB) -h libpng.so.$(PNGMAJ) \ |
Glenn Randers-Pehrson | 08a3343 | 1998-03-07 06:06:55 -0600 | [diff] [blame] | 76 | -o libpng.so.$(PNGVER) $(OBJSDLL) -lz |
Guy Schalnat | 4ee97b0 | 1996-01-16 01:51:56 -0600 | [diff] [blame] | 77 | |
| 78 | pngtest: pngtest.o libpng.so |
Glenn Randers-Pehrson | 2687fcc | 1998-01-07 20:54:20 -0600 | [diff] [blame] | 79 | $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) |
Guy Schalnat | 4ee97b0 | 1996-01-16 01:51:56 -0600 | [diff] [blame] | 80 | |
| 81 | test: pngtest |
| 82 | ./pngtest |
| 83 | |
Glenn Randers-Pehrson | 2687fcc | 1998-01-07 20:54:20 -0600 | [diff] [blame] | 84 | install: libpng.a libpng.so.$(PNGVER) |
Andreas Dilger | 47a0c42 | 1997-05-16 02:46:07 -0500 | [diff] [blame] | 85 | -@mkdir $(INCPATH) $(LIBPATH) |
| 86 | cp png.h pngconf.h $(INCPATH) |
| 87 | chmod 644 $(INCPATH)/png.h $(INCPATH)/pngconf.h |
Glenn Randers-Pehrson | 2687fcc | 1998-01-07 20:54:20 -0600 | [diff] [blame] | 88 | cp libpng.a libpng.so.$(PNGVER) $(LIBPATH) |
Andreas Dilger | 47a0c42 | 1997-05-16 02:46:07 -0500 | [diff] [blame] | 89 | chmod 755 $(LIBPATH)/libpng.so.$(PNGVER) |
Glenn Randers-Pehrson | 2687fcc | 1998-01-07 20:54:20 -0600 | [diff] [blame] | 90 | -@/bin/rm -f $(LIBPATH)/libpng.so.$(PNGMAJ) $(LIBPATH)/libpng.so |
Glenn Randers-Pehrson | 4393a9a | 1999-09-17 12:27:26 -0500 | [diff] [blame] | 91 | (cd $(LIBPATH); ln -f -s libpng.so.$(PNGVER) libpng.so.$(PNGMAJ); \ |
| 92 | ln -f -s libpng.so.$(PNGMAJ) libpng.so) |
Guy Schalnat | 4ee97b0 | 1996-01-16 01:51:56 -0600 | [diff] [blame] | 93 | |
| 94 | clean: |
Glenn Randers-Pehrson | 2687fcc | 1998-01-07 20:54:20 -0600 | [diff] [blame] | 95 | /bin/rm -f *.o libpng.a libpng.so* pngtest pngout.png |
Guy Schalnat | 4ee97b0 | 1996-01-16 01:51:56 -0600 | [diff] [blame] | 96 | |
Glenn Randers-Pehrson | 166c5a3 | 1999-12-10 09:43:02 -0600 | [diff] [blame^] | 97 | DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO |
| 98 | writelock: |
| 99 | chmod a-w *.[ch35] $(DOCS) scripts/* |
| 100 | |
Guy Schalnat | 4ee97b0 | 1996-01-16 01:51:56 -0600 | [diff] [blame] | 101 | # DO NOT DELETE THIS LINE -- make depend depends on it. |
| 102 | |
Glenn Randers-Pehrson | 2687fcc | 1998-01-07 20:54:20 -0600 | [diff] [blame] | 103 | png.o png.pic.o: png.h pngconf.h |
| 104 | pngerror.o pngerror.pic.o: png.h pngconf.h |
| 105 | pngrio.o pngrio.pic.o: png.h pngconf.h |
| 106 | pngwio.o pngwio.pic.o: png.h pngconf.h |
| 107 | pngmem.o pngmem.pic.o: png.h pngconf.h |
| 108 | pngset.o pngset.pic.o: png.h pngconf.h |
| 109 | pngget.o pngget.pic.o: png.h pngconf.h |
| 110 | pngread.o pngread.pic.o: png.h pngconf.h |
| 111 | pngrtran.o pngrtran.pic.o: png.h pngconf.h |
| 112 | pngrutil.o pngrutil.pic.o: png.h pngconf.h |
| 113 | pngtrans.o pngtrans.pic.o: png.h pngconf.h |
| 114 | pngwrite.o pngwrite.pic.o: png.h pngconf.h |
| 115 | pngwtran.o pngwtran.pic.o: png.h pngconf.h |
| 116 | pngwutil.o pngwutil.pic.o: png.h pngconf.h |
| 117 | pngpread.o pngpread.pic.o: png.h pngconf.h |
| 118 | |
Guy Schalnat | 4ee97b0 | 1996-01-16 01:51:56 -0600 | [diff] [blame] | 119 | pngtest.o: png.h pngconf.h |