blob: fc572afe48cd2e79d74b9df63bcbb06807ac4d98 [file] [log] [blame]
Glenn Randers-Pehrson1d963611998-05-02 12:52:25 -05001# 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
4# Copyright (C) 1996, 1997 Andreas Dilger
5# Copyright (C) 1998 Greg Roelofs
6# For conditions of distribution and use, see copyright notice in png.h
7
8CC=cc
9
Glenn Randers-Pehrson5c6aeb21998-12-29 11:47:59 -060010# where make install puts libpng.a, libpng.so*, and png.h
11prefix=/usr/local
12
Glenn Randers-Pehrson1d963611998-05-02 12:52:25 -050013# Where the zlib library and include files are located
14#ZLIBLIB=/usr/local/lib
15#ZLIBINC=/usr/local/include
16ZLIBLIB=../zlib
17ZLIBINC=../zlib
18
19CFLAGS= -dy -belf -I$(ZLIBINC) -O3
20LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
21
22#RANLIB=ranlib
23RANLIB=echo
24
25# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
26# have to change it.
27PNGMAJ = 2
Glenn Randers-Pehrson074af5e1999-11-28 23:32:18 -060028PNGMIN = 1.0.5d
Glenn Randers-Pehrson1d963611998-05-02 12:52:25 -050029PNGVER = $(PNGMAJ).$(PNGMIN)
30
Glenn Randers-Pehrson1d963611998-05-02 12:52:25 -050031INCPATH=$(prefix)/include
32LIBPATH=$(prefix)/lib
33
34OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
Glenn Randers-Pehrson4393a9a1999-09-17 12:27:26 -050035 pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
36 pngwtran.o pngmem.o pngerror.o pngpread.o
Glenn Randers-Pehrson1d963611998-05-02 12:52:25 -050037
38OBJSDLL = $(OBJS:.o=.pic.o)
39
40.SUFFIXES: .c .o .pic.o
41
42.c.pic.o:
43 $(CC) -c $(CFLAGS) -KPIC -o $@ $*.c
44
45all: libpng.a libpng.so pngtest
46
47libpng.a: $(OBJS)
48 ar rc $@ $(OBJS)
49 $(RANLIB) $@
50
51libpng.so: libpng.so.$(PNGMAJ)
Glenn Randers-Pehrson4393a9a1999-09-17 12:27:26 -050052 ln -f -s libpng.so.$(PNGMAJ) libpng.so
Glenn Randers-Pehrson1d963611998-05-02 12:52:25 -050053
54libpng.so.$(PNGMAJ): libpng.so.$(PNGVER)
Glenn Randers-Pehrson4393a9a1999-09-17 12:27:26 -050055 ln -f -s libpng.so.$(PNGVER) libpng.so.$(PNGMAJ)
Glenn Randers-Pehrson1d963611998-05-02 12:52:25 -050056
57libpng.so.$(PNGVER): $(OBJSDLL)
58 $(CC) -G -Wl,-h,libpng.so.$(PNGMAJ) -o libpng.so.$(PNGVER) \
59 $(OBJSDLL)
60
61pngtest: pngtest.o libpng.so
62 LD_RUN_PATH=.:$(ZLIBLIB) $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
63
64test: pngtest
65 ./pngtest
66
67install: 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-Pehrson4393a9a1999-09-17 12:27:26 -050074 (cd $(LIBPATH); ln -f -s libpng.so.$(PNGVER) libpng.so.$(PNGMAJ); \
75 ln -f -s libpng.so.$(PNGMAJ) libpng.so)
Glenn Randers-Pehrson1d963611998-05-02 12:52:25 -050076
77clean:
78 /bin/rm -f *.o libpng.a libpng.so* pngtest pngout.png
79
80# DO NOT DELETE THIS LINE -- make depend depends on it.
81
82png.o png.pic.o: png.h pngconf.h
83pngerror.o pngerror.pic.o: png.h pngconf.h
84pngrio.o pngrio.pic.o: png.h pngconf.h
85pngwio.o pngwio.pic.o: png.h pngconf.h
86pngmem.o pngmem.pic.o: png.h pngconf.h
87pngset.o pngset.pic.o: png.h pngconf.h
88pngget.o pngget.pic.o: png.h pngconf.h
89pngread.o pngread.pic.o: png.h pngconf.h
90pngrtran.o pngrtran.pic.o: png.h pngconf.h
91pngrutil.o pngrutil.pic.o: png.h pngconf.h
92pngtrans.o pngtrans.pic.o: png.h pngconf.h
93pngwrite.o pngwrite.pic.o: png.h pngconf.h
94pngwtran.o pngwtran.pic.o: png.h pngconf.h
95pngwutil.o pngwutil.pic.o: png.h pngconf.h
96pngpread.o pngpread.pic.o: png.h pngconf.h
97
98pngtest.o: png.h pngconf.h