1 # makefile for libpng on Solaris 2.x with gcc
2 # Contributed by William L. Sebok, based on makefile.lnx
3 # Copyright (C) 1996, 1997 Andreas Dilger
4 # Copyright (C) 1998 Greg Roelofs
5 # For conditions of distribution and use, see copyright notice in png.h
9 # Where the zlib library and include files are located
10 # Changing these to ../zlib poses a security risk. If you want
11 # to have zlib in an adjacent directory, specify the full path instead of "..".
15 ZLIBLIB=/usr/local/lib
16 ZLIBINC=/usr/local/include
19 WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
20 -Wmissing-declarations -Wtraditional -Wcast-align \
21 -Wstrict-prototypes -Wmissing-prototypes #-Wconversion
22 CFLAGS=-I$(ZLIBINC) -Wall -O3 \
23 #$(WARNMORE) -g -DPNG_DEBUG=5
24 LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng -lz -lm
29 # read libpng.txt or png.h to see why PNGMAJ is 2. You should not
33 PNGVER = $(PNGMAJ).$(PNGMIN)
35 # where make install puts libpng.a, libpng.so*, and png.h
37 INCPATH=$(prefix)/include
40 OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
41 pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
42 pngwtran.o pngmem.o pngerror.o pngpread.o
44 OBJSDLL = $(OBJS:.o=.pic.o)
46 .SUFFIXES: .c .o .pic.o
49 $(CC) -c $(CFLAGS) -fPIC -o $@ $*.c
51 all: libpng.a libpng.so pngtest
57 libpng.so: libpng.so.$(PNGMAJ)
58 ln -sf libpng.so.$(PNGMAJ) libpng.so
60 libpng.so.$(PNGMAJ): libpng.so.$(PNGVER)
61 ln -sf libpng.so.$(PNGVER) libpng.so.$(PNGMAJ)
63 libpng.so.$(PNGVER): $(OBJSDLL)
64 $(LD) -G -L$(ZLIBLIB) -R$(ZLIBLIB) -h libpng.so.$(PNGMAJ) \
65 -o libpng.so.$(PNGVER) $(OBJSDLL) -lz
67 pngtest: pngtest.o libpng.so
68 $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
73 install: libpng.a libpng.so.$(PNGVER)
74 -@mkdir $(INCPATH) $(LIBPATH)
75 cp png.h pngconf.h $(INCPATH)
76 chmod 644 $(INCPATH)/png.h $(INCPATH)/pngconf.h
77 cp libpng.a libpng.so.$(PNGVER) $(LIBPATH)
78 chmod 755 $(LIBPATH)/libpng.so.$(PNGVER)
79 -@/bin/rm -f $(LIBPATH)/libpng.so.$(PNGMAJ) $(LIBPATH)/libpng.so
80 (cd $(LIBPATH); ln -sf libpng.so.$(PNGVER) libpng.so.$(PNGMAJ); \
81 ln -sf libpng.so.$(PNGMAJ) libpng.so)
84 /bin/rm -f *.o libpng.a libpng.so* pngtest pngout.png
86 # DO NOT DELETE THIS LINE -- make depend depends on it.
88 png.o png.pic.o: png.h pngconf.h
89 pngerror.o pngerror.pic.o: png.h pngconf.h
90 pngrio.o pngrio.pic.o: png.h pngconf.h
91 pngwio.o pngwio.pic.o: png.h pngconf.h
92 pngmem.o pngmem.pic.o: png.h pngconf.h
93 pngset.o pngset.pic.o: png.h pngconf.h
94 pngget.o pngget.pic.o: png.h pngconf.h
95 pngread.o pngread.pic.o: png.h pngconf.h
96 pngrtran.o pngrtran.pic.o: png.h pngconf.h
97 pngrutil.o pngrutil.pic.o: png.h pngconf.h
98 pngtrans.o pngtrans.pic.o: png.h pngconf.h
99 pngwrite.o pngwrite.pic.o: png.h pngconf.h
100 pngwtran.o pngwtran.pic.o: png.h pngconf.h
101 pngwutil.o pngwutil.pic.o: png.h pngconf.h
102 pngpread.o pngpread.pic.o: png.h pngconf.h
104 pngtest.o: png.h pngconf.h