blob: a5f754a4d6d4d080ad49de761eaff4838ce39425 [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
Glenn Randers-Pehrson98c9d732000-05-03 21:06:11 -05004# Copyright (C) 1998 Greg Roelofs
Glenn Randers-Pehrsond4366722000-06-04 14:29:29 -05005# Copyright (C) 1996, 1997 Andreas Dilger
Glenn Randers-Pehrson1d963611998-05-02 12:52:25 -05006# 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
Glenn Randers-Pehrson98c9d732000-05-03 21:06:11 -050025# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
Glenn Randers-Pehrson1d963611998-05-02 12:52:25 -050026# have to change it.
Glenn Randers-Pehrson98c9d732000-05-03 21:06:11 -050027PNGMAJ = 2
Glenn Randers-Pehrsond4366722000-06-04 14:29:29 -050028PNGMIN = 1.0.7beta16
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
Glenn Randers-Pehrson166c5a31999-12-10 09:43:02 -060080DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
81writelock:
82 chmod a-w *.[ch35] $(DOCS) scripts/*
83
Glenn Randers-Pehrson1d963611998-05-02 12:52:25 -050084# DO NOT DELETE THIS LINE -- make depend depends on it.
85
86png.o png.pic.o: png.h pngconf.h
87pngerror.o pngerror.pic.o: png.h pngconf.h
88pngrio.o pngrio.pic.o: png.h pngconf.h
89pngwio.o pngwio.pic.o: png.h pngconf.h
90pngmem.o pngmem.pic.o: png.h pngconf.h
91pngset.o pngset.pic.o: png.h pngconf.h
92pngget.o pngget.pic.o: png.h pngconf.h
93pngread.o pngread.pic.o: png.h pngconf.h
94pngrtran.o pngrtran.pic.o: png.h pngconf.h
95pngrutil.o pngrutil.pic.o: png.h pngconf.h
96pngtrans.o pngtrans.pic.o: png.h pngconf.h
97pngwrite.o pngwrite.pic.o: png.h pngconf.h
98pngwtran.o pngwtran.pic.o: png.h pngconf.h
99pngwutil.o pngwutil.pic.o: png.h pngconf.h
100pngpread.o pngpread.pic.o: png.h pngconf.h
101
102pngtest.o: png.h pngconf.h