]> git.saurik.com Git - wxWidgets.git/blame - src/png/scripts/makefile.s2x
passing CRTFLAG to subordinant makes
[wxWidgets.git] / src / png / scripts / makefile.s2x
CommitLineData
c801d85f
KB
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
6
7CC=gcc
8
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 "..".
12#ZLIBLIB=../zlib
13#ZLIBINC=../zlib
14
15ZLIBLIB=/usr/local/lib
16ZLIBINC=/usr/local/include
17
18
19WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
20 -Wmissing-declarations -Wtraditional -Wcast-align \
21 -Wstrict-prototypes -Wmissing-prototypes #-Wconversion
22CFLAGS=-I$(ZLIBINC) -Wall -O3 \
23 #$(WARNMORE) -g -DPNG_DEBUG=5
24LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng -lz -lm
25
26#RANLIB=ranlib
27RANLIB=echo
28
29# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
30# have to change it.
31PNGMAJ = 2
32PNGMIN = 1.0
33PNGVER = $(PNGMAJ).$(PNGMIN)
34
35# where make install puts libpng.a, libpng.so*, and png.h
36prefix=/usr/local
37INCPATH=$(prefix)/include
38LIBPATH=$(prefix)/lib
39
40OBJS = 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
43
44OBJSDLL = $(OBJS:.o=.pic.o)
45
46.SUFFIXES: .c .o .pic.o
47
48.c.pic.o:
49 $(CC) -c $(CFLAGS) -fPIC -o $@ $*.c
50
51all: libpng.a libpng.so pngtest
52
53libpng.a: $(OBJS)
54 ar rc $@ $(OBJS)
55 $(RANLIB) $@
56
57libpng.so: libpng.so.$(PNGMAJ)
58 ln -sf libpng.so.$(PNGMAJ) libpng.so
59
60libpng.so.$(PNGMAJ): libpng.so.$(PNGVER)
61 ln -sf libpng.so.$(PNGVER) libpng.so.$(PNGMAJ)
62
63libpng.so.$(PNGVER): $(OBJSDLL)
64 $(LD) -G -L$(ZLIBLIB) -R$(ZLIBLIB) -h libpng.so.$(PNGMAJ) \
65 -o libpng.so.$(PNGVER) $(OBJSDLL) -lz
66
67pngtest: pngtest.o libpng.so
68 $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
69
70test: pngtest
71 ./pngtest
72
73install: 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)
82
83clean:
84 /bin/rm -f *.o libpng.a libpng.so* pngtest pngout.png
85
86# DO NOT DELETE THIS LINE -- make depend depends on it.
87
88png.o png.pic.o: png.h pngconf.h
89pngerror.o pngerror.pic.o: png.h pngconf.h
90pngrio.o pngrio.pic.o: png.h pngconf.h
91pngwio.o pngwio.pic.o: png.h pngconf.h
92pngmem.o pngmem.pic.o: png.h pngconf.h
93pngset.o pngset.pic.o: png.h pngconf.h
94pngget.o pngget.pic.o: png.h pngconf.h
95pngread.o pngread.pic.o: png.h pngconf.h
96pngrtran.o pngrtran.pic.o: png.h pngconf.h
97pngrutil.o pngrutil.pic.o: png.h pngconf.h
98pngtrans.o pngtrans.pic.o: png.h pngconf.h
99pngwrite.o pngwrite.pic.o: png.h pngconf.h
100pngwtran.o pngwtran.pic.o: png.h pngconf.h
101pngwutil.o pngwutil.pic.o: png.h pngconf.h
102pngpread.o pngpread.pic.o: png.h pngconf.h
103
104pngtest.o: png.h pngconf.h