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