1#
2# "$Id: Makefile 9120 2010-04-23 18:56:34Z mike $"
3#
4#   Filter makefile for the Common UNIX Printing System (CUPS).
5#
6#   Copyright 2007-2010 by Apple Inc.
7#   Copyright 1997-2006 by Easy Software Products.
8#
9#   These coded instructions, statements, and computer programs are the
10#   property of Apple Inc. and are protected by Federal copyright
11#   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
12#   which should have been included with this file.  If this file is
13#   file is missing or damaged, see the license at "http://www.cups.org/".
14#
15#   This file is subject to the Apple OS-Developed Software exception.
16#
17
18include ../Makedefs
19
20
21LIBTARGETS =	\
22		$(LIBCUPSIMAGE) \
23		libcupsimage.a \
24		$(LIB32CUPSIMAGE) \
25		$(LIB64CUPSIMAGE)
26TARGETS	=	\
27		$(LIBTARGETS) \
28
29IMAGEOBJS =	image-bmp.o image-colorspace.o image-gif.o image-jpeg.o \
30		image-photocd.o image-pix.o image-png.o image-pnm.o \
31		image-sgi.o image-sgilib.o image-sun.o image-tiff.o \
32		image-zoom.o image.o error.o interpret.o raster.o
33IMAGE32OBJS =	$(IMAGEOBJS:.o=.32.o)
34IMAGE64OBJS =	$(IMAGEOBJS:.o=.64.o)
35OBJS	=	$(IMAGEOBJS)
36
37
38#
39# Make all targets...
40#
41
42all:	$(TARGETS)
43
44
45#
46# Make library targets...
47#
48
49libs:		$(LIBTARGETS)
50
51
52#
53# Clean all object files...
54#
55
56clean:
57	$(RM) $(OBJS) $(TARGETS)
58	$(RM) libcupsimage.so libcupsimage.sl libcupsimage.dylib
59	$(RM) -r 32bit 64bit
60
61
62#
63# Update dependencies (without system header dependencies...)
64#
65
66depend:
67	touch Dependencies.tmp
68	makedepend -Y -I.. -fDependencies.tmp $(OBJS:.o=.c) >/dev/null 2>&1
69	$(RM) Dependencies
70	cp Dependencies.tmp Dependencies
71	sed -E -e '1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp >>Dependencies
72	sed -E -e '1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp >>Dependencies
73	$(RM) Dependencies.tmp
74
75
76#
77# Install all targets...
78#
79
80install:	all install-data install-headers install-libs install-exec
81
82
83#
84# Install data files...
85#
86
87install-data:
88
89
90#
91# Install programs...
92#
93
94install-exec:
95
96
97#
98# Install headers...
99#
100
101install-headers:
102	$(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups
103	$(INSTALL_DATA) image.h $(INCLUDEDIR)/cups
104
105
106#
107# Install libraries...
108#
109
110install-libs: $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64)
111	$(INSTALL_DIR) -m 755 $(LIBDIR)
112	$(INSTALL_LIB) $(LIBCUPSIMAGE) $(LIBDIR)
113	-if test $(LIBCUPSIMAGE) = "libcupsimage.so.2" -o $(LIBCUPSIMAGE) = "libcupsimage.sl.2"; then \
114		$(RM) $(LIBDIR)/`basename $(LIBCUPSIMAGE) .2`; \
115		$(LN) $(LIBCUPSIMAGE) $(LIBDIR)/`basename $(LIBCUPSIMAGE) .2`; \
116	fi
117	-if test $(LIBCUPSIMAGE) = "libcupsimage.2.dylib"; then \
118		$(RM) $(LIBDIR)/libcupsimage.dylib; \
119		$(LN) $(LIBCUPSIMAGE) $(LIBDIR)/libcupsimage.dylib; \
120	fi
121	if test "x$(SYMROOT)" != "x"; then \
122		$(INSTALL_DIR) $(SYMROOT); \
123		cp $(LIBCUPSIMAGE) $(SYMROOT); \
124	fi
125
126installstatic:
127	$(INSTALL_DIR) -m 755 $(LIBDIR)
128	$(INSTALL_LIB) -m 755 libcupsimage.a $(LIBDIR)
129	$(RANLIB) $(LIBDIR)/libcupsimage.a
130	$(CHMOD) 555 $(LIBDIR)/libcupsimage.a
131
132install32bit:
133	$(INSTALL_DIR) -m 755 $(LIB32DIR)
134	$(INSTALL_LIB) 32bit/libcupsimage.so.2 $(LIB32DIR)/libcupsimage.so.2
135	$(LN) libcupsimage.so.2 $(LIB32DIR)/libcupsimage.so
136
137install64bit:
138	$(INSTALL_DIR) -m 755 $(LIB64DIR)
139	$(INSTALL_LIB) 64bit/libcupsimage.so.2 $(LIB64DIR)/libcupsimage.so.2
140	$(LN) libcupsimage.so.2 $(LIB64DIR)/libcupsimage.so
141
142
143#
144# Uninstall all targets...
145#
146
147uninstall: $(UNINSTALL32) $(UNINSTALL64)
148	$(RM) $(LIBDIR)/libcupsimage.2.dylib
149	$(RM) $(LIBDIR)/libcupsimage.a
150	$(RM) $(LIBDIR)/libcupsimage.dylib
151	$(RM) $(LIBDIR)/libcupsimage_s.a
152	$(RM) $(LIBDIR)/libcupsimage.sl
153	$(RM) $(LIBDIR)/libcupsimage.sl.2
154	$(RM) $(LIBDIR)/libcupsimage.so
155	$(RM) $(LIBDIR)/libcupsimage.so.2
156	-$(RMDIR) $(LIBDIR)
157	$(RM) $(INCLUDEDIR)/cups/image.h
158	-$(RMDIR) $(INCLUDEDIR)/cups
159
160uninstall32bit:
161	$(RM) $(LIB32DIR)/libcupsimage.so
162	$(RM) $(LIB32DIR)/libcupsimage.so.2
163	-$(RMDIR) $(LIB32DIR)
164
165uninstall64bit:
166	$(RM) $(LIB64DIR)/libcupsimage.so
167	$(RM) $(LIB64DIR)/libcupsimage.so.2
168	-$(RMDIR) $(LIB64DIR)
169
170
171#
172# libcupsimage.so.2, libcupsimage.sl.2
173#
174
175libcupsimage.so.2 libcupsimage.sl.2:	$(IMAGEOBJS)
176	echo Linking $@...
177	$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS) $(DSOLIBS) \
178		-L../cups $(LINKCUPS) -lm
179	$(RM) `basename $@ .2`
180	$(LN) $@ `basename $@ .2`
181
182
183#
184# 32bit/libcupsimage.so.2
185#
186
18732bit/libcupsimage.so.2:	$(IMAGE32OBJS)
188	echo Linking 32-bit $@...
189	-mkdir 32bit
190	$(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(IMAGE32OBJS) $(DSOLIBS) \
191		-L../cups/32bit $(LINKCUPS) -lm
192
193
194#
195# 64bit/libcupsimage.so.2
196#
197
19864bit/libcupsimage.so.2:	$(IMAGE64OBJS)
199	echo Linking 64-bit $@...
200	-mkdir 64bit
201	$(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(IMAGE64OBJS) $(DSOLIBS) \
202		-L../cups/64bit $(LINKCUPS) -lm
203
204
205#
206# libcupsimage.2.dylib
207#
208
209libcupsimage.2.dylib:	$(IMAGEOBJS) $(LIBCUPSIMAGEORDER)
210	echo Linking $@...
211	$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
212		-install_name $(libdir)/$@ \
213		-current_version 2.3.0 \
214		-compatibility_version 2.0.0 \
215		-sectorder __TEXT __text $(LIBCUPSIMAGEORDER) \
216		$(IMAGEOBJS) $(DSOLIBS) -L../cups $(LINKCUPS) -lm
217	$(RM) libcupsimage.dylib
218	$(LN) $@ libcupsimage.dylib
219
220
221#
222# libcupsimage_s.a
223#
224
225libcupsimage_s.a:	$(IMAGEOBJS) libcupsimage_s.exp
226	echo Linking $@...
227	$(DSO) $(DSOFLAGS) -Wl,-berok,-bexport:libcupsimage_s.exp \
228		-o libcupsimage_s.o $(IMAGEOBJS) $(DSOLIBS) -lm
229	$(RM) $@
230	$(AR) $(ARFLAGS) $@ libcupsimage_s.o
231
232
233#
234# libcupsimage.la
235#
236
237libcupsimage.la:       $(IMAGEOBJS)
238	echo Linking $@...
239	$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS:.o=.lo) $(DSOLIBS) \
240		-L../cups $(LINKCUPS) \
241		-rpath $(LIBDIR) -version-info 2:3
242
243
244#
245# libcupsimage.a
246#
247
248libcupsimage.a:	$(IMAGEOBJS)
249	echo Archiving $@...
250	$(RM) $@
251	$(AR) $(ARFLAGS) $@ $(IMAGEOBJS)
252	$(RANLIB) $@
253
254
255#
256# Dependencies...
257#
258
259include Dependencies
260
261
262#
263# End of "$Id: Makefile 9120 2010-04-23 18:56:34Z mike $".
264#
265