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