]> git.saurik.com Git - wxWidgets.git/blame - src/png/scripts/makefile.sco
Merge in from trunk r64802 - r68625
[wxWidgets.git] / src / png / scripts / makefile.sco
CommitLineData
0272a10d
VZ
1# 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
b61cc19c 4# Copyright (C) 2002, 2006, 2010 Glenn Randers-Pehrson
0272a10d
VZ
5# Copyright (C) 1998 Greg Roelofs
6# Copyright (C) 1996, 1997 Andreas Dilger
b61cc19c
PC
7#
8# This code is released under the libpng license.
9# For conditions of distribution and use, see the disclaimer
10# and license in png.h
0272a10d
VZ
11
12# Library name:
b61cc19c
PC
13LIBNAME = libpng14
14PNGMAJ = 14
0272a10d
VZ
15
16# Shared library names:
17LIBSO=$(LIBNAME).so
18LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
b61cc19c 19LIBSOREL=$(LIBSOMAJ).$(RELEASE)
0272a10d 20OLDSO=libpng.so
0272a10d
VZ
21
22# Utilities:
23CC=cc
24AR_RC=ar rc
25MKDIR_P=mkdir
26LN_SF=ln -f -s
27RANLIB=echo
28RM_F=/bin/rm -f
29
30# where make install puts libpng.a, $(OLDSO)*, and png.h
31prefix=/usr/local
32exec_prefix=$(prefix)
33
34# Where the zlib library and include files are located
35#ZLIBLIB=/usr/local/lib
36#ZLIBINC=/usr/local/include
37ZLIBLIB=../zlib
38ZLIBINC=../zlib
39
b61cc19c
PC
40CFLAGS= -dy -belf -I$(ZLIBINC) -O3
41LDFLAGS=-L. -L$(ZLIBLIB) -lpng14 -lz -lm
0272a10d 42
b61cc19c 43INCPATH=$(prefix)/include
0272a10d
VZ
44LIBPATH=$(exec_prefix)/lib
45MANPATH=$(prefix)/man
46BINPATH=$(exec_prefix)/bin
47
48# override DESTDIR= on the make install command line to easily support
49# installing into a temporary location. Example:
50#
51# make install DESTDIR=/tmp/build/libpng
52#
53# If you're going to install into a temporary location
54# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
55# you execute make install.
56DESTDIR=
57
58DB=$(DESTDIR)$(BINPATH)
59DI=$(DESTDIR)$(INCPATH)
60DL=$(DESTDIR)$(LIBPATH)
61DM=$(DESTDIR)$(MANPATH)
62
63OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
64 pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
65 pngwtran.o pngmem.o pngerror.o pngpread.o
66
67OBJSDLL = $(OBJS:.o=.pic.o)
68
69.SUFFIXES: .c .o .pic.o
70
71.c.pic.o:
72 $(CC) -c $(CFLAGS) -KPIC -o $@ $*.c
73
74all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
75
76libpng.a: $(OBJS)
77 $(AR_RC) $@ $(OBJS)
78 $(RANLIB) $@
79
80libpng.pc:
970f6abe
VZ
81 cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
82 -e s!@exec_prefix@!$(exec_prefix)! \
83 -e s!@libdir@!$(LIBPATH)! \
84 -e s!@includedir@!$(INCPATH)! \
b61cc19c 85 -e s!-lpng14!-lpng14\ -lz\ -lm! > libpng.pc
0272a10d
VZ
86
87libpng-config:
88 ( cat scripts/libpng-config-head.in; \
89 echo prefix=\"$(prefix)\"; \
90 echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
91 echo ccopts=\"-belf\"; \
92 echo L_opts=\"-L$(LIBPATH)\"; \
b61cc19c 93 echo libs=\"-lpng14 -lz -lm\"; \
0272a10d
VZ
94 cat scripts/libpng-config-body.in ) > libpng-config
95 chmod +x libpng-config
96
97$(LIBSO): $(LIBSOMAJ)
98 $(LN_SF) $(LIBSOMAJ) $(LIBSO)
99
b61cc19c
PC
100$(LIBSOMAJ): $(OBJSDLL)
101 $(CC) -G -Wl,-h,$(LIBSOMAJ) -o $(LIBSOMAJ) \
0272a10d
VZ
102 $(OBJSDLL)
103
0272a10d
VZ
104pngtest: pngtest.o $(LIBSO)
105 LD_RUN_PATH=.:$(ZLIBLIB) $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
106
107test: pngtest
108 ./pngtest
109
110install-headers: png.h pngconf.h
111 -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
112 -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
113 -@$(RM_F) $(DI)/png.h
114 -@$(RM_F) $(DI)/pngconf.h
115 cp png.h pngconf.h $(DI)/$(LIBNAME)
116 chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
117 -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h
118 -@$(RM_F) $(DI)/libpng
119 (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
120
121install-static: install-headers libpng.a
122 -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
123 cp libpng.a $(DL)/$(LIBNAME).a
124 chmod 644 $(DL)/$(LIBNAME).a
125 -@$(RM_F) $(DL)/libpng.a
126 (cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
127
b61cc19c 128install-shared: install-headers $(LIBSOMAJ) libpng.pc
0272a10d 129 -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
b61cc19c
PC
130 -@$(RM_F) $(DL)/$(LIBSO)
131 -@$(RM_F) $(DL)/$(LIBSOREL)
0272a10d 132 -@$(RM_F) $(DL)/$(OLDSO)
b61cc19c
PC
133 cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
134 chmod 755 $(DL)/$(LIBSOREL)
0272a10d 135 (cd $(DL); \
b61cc19c
PC
136 $(LN_SF) $(LIBSOREL) $(LIBSO); \
137 $(LN_SF) $(LIBSO) $(OLDSO))
0272a10d
VZ
138 -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
139 -@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
140 -@$(RM_F) $(DL)/pkgconfig/libpng.pc
141 cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
142 chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
143 (cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
144
145install-man: libpng.3 libpngpf.3 png.5
146 -@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
147 -@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
148 -@$(RM_F) $(DM)/man3/libpng.3
149 -@$(RM_F) $(DM)/man3/libpngpf.3
150 cp libpng.3 $(DM)/man3
151 cp libpngpf.3 $(DM)/man3
152 -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
153 -@$(RM_F) $(DM)/man5/png.5
154 cp png.5 $(DM)/man5
155
156install-config: libpng-config
157 -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
158 -@$(RM_F) $(DB)/libpng-config
159 -@$(RM_F) $(DB)/$(LIBNAME)-config
160 cp libpng-config $(DB)/$(LIBNAME)-config
161 chmod 755 $(DB)/$(LIBNAME)-config
162 (cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
163
164install: install-static install-shared install-man install-config
165
166# If you installed in $(DESTDIR), test-installed won't work until you
167# move the library to its final location. Use test-dd to test it
168# before then.
169
170test-dd:
171 echo
172 echo Testing installed dynamic shared library in $(DL).
173 $(CC) -I$(DI) $(CFLAGS) \
174 `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
175 -L$(DL) -L$(ZLIBLIB) \
176 -o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
177 ./pngtestd pngtest.png
178
179test-installed:
180 $(CC) $(CFLAGS) \
181 `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
182 -L$(ZLIBLIB) \
183 -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
184 ./pngtesti pngtest.png
185
186clean:
187 $(RM_F) *.o libpng.a pngtest pngout.png libpng-config \
188 $(LIBSO) $(LIBSOMAJ)* pngtest-static pngtesti \
0272a10d
VZ
189 libpng.pc
190
191DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
192writelock:
193 chmod a-w *.[ch35] $(DOCS) scripts/*
194
195# DO NOT DELETE THIS LINE -- make depend depends on it.
196
b61cc19c
PC
197png.o png.pic.o: png.h pngconf.h pngpriv.h
198pngerror.o pngerror.pic.o: png.h pngconf.h pngpriv.h
199pngrio.o pngrio.pic.o: png.h pngconf.h pngpriv.h
200pngwio.o pngwio.pic.o: png.h pngconf.h pngpriv.h
201pngmem.o pngmem.pic.o: png.h pngconf.h pngpriv.h
202pngset.o pngset.pic.o: png.h pngconf.h pngpriv.h
203pngget.o pngget.pic.o: png.h pngconf.h pngpriv.h
204pngread.o pngread.pic.o: png.h pngconf.h pngpriv.h
205pngrtran.o pngrtran.pic.o: png.h pngconf.h pngpriv.h
206pngrutil.o pngrutil.pic.o: png.h pngconf.h pngpriv.h
207pngtrans.o pngtrans.pic.o: png.h pngconf.h pngpriv.h
208pngwrite.o pngwrite.pic.o: png.h pngconf.h pngpriv.h
209pngwtran.o pngwtran.pic.o: png.h pngconf.h pngpriv.h
210pngwutil.o pngwutil.pic.o: png.h pngconf.h pngpriv.h
211pngpread.o pngpread.pic.o: png.h pngconf.h pngpriv.h
0272a10d
VZ
212
213pngtest.o: png.h pngconf.h