]> git.ipfire.org Git - thirdparty/cups.git/blame - cups/Makefile
Load cups into easysw/current.
[thirdparty/cups.git] / cups / Makefile
CommitLineData
ef416fc2 1#
f7faf1f5 2# "$Id: Makefile 5628 2006-06-05 15:25:23Z mike $"
ef416fc2 3#
4# API library Makefile for the Common UNIX Printing System (CUPS).
5#
6# Copyright 1997-2006 by Easy Software Products, all rights reserved.
7#
8# These coded instructions, statements, and computer programs are the
9# property of Easy Software Products and are protected by Federal
10# copyright law. Distribution and use rights are outlined in the file
11# "LICENSE.txt" which should have been included with this file. If this
12# file is missing or damaged please contact Easy Software Products
13# at:
14#
15# Attn: CUPS Licensing Information
16# Easy Software Products
17# 44141 Airport View Drive, Suite 204
18# Hollywood, Maryland 20636 USA
19#
20# Voice: (301) 373-9600
21# EMail: cups-info@cups.org
22# WWW: http://www.cups.org
23#
24# This file is subject to the Apple OS-Developed Software exception.
25#
26
27include ../Makedefs
28
29#
30# Object files...
31#
32
33LIBOBJS = \
757d2cad 34 adminutil.o \
ef416fc2 35 array.o \
36 attr.o \
37 auth.o \
38 backchannel.o \
a4d04587 39 backend.o \
fa73b229 40 custom.o \
ef416fc2 41 dest.o \
42 dir.o \
43 emit.o \
44 encode.o \
45 file.o \
89d46774 46 getifaddrs.o \
ef416fc2 47 getputfile.o \
48 globals.o \
49 http.o \
50 http-addr.o \
51 http-addrlist.o \
52 http-support.o \
53 ipp.o \
54 ipp-support.o \
55 langprintf.o \
56 language.o \
fa73b229 57 localize.o \
ef416fc2 58 mark.o \
59 md5.o \
60 md5passwd.o \
fa73b229 61 notify.o \
ef416fc2 62 options.o \
63 page.o \
64 ppd.o \
ecdc0628 65 request.o \
ef416fc2 66 snprintf.o \
67 string.o \
68 tempfile.o \
69 transcode.o \
70 usersys.o \
71 util.o
e1d6a774 72LIB32OBJS = $(LIBOBJS:.o=.32.o)
73LIB64OBJS = $(LIBOBJS:.o=.64.o)
ef416fc2 74OBJS = \
75 $(LIBOBJS) \
e1d6a774 76 $(LIB32OBJS) \
77 $(LIB64OBJS) \
757d2cad 78 testadmin.o \
ef416fc2 79 testarray.o \
80 testfile.o \
81 testhttp.o \
82 testi18n.o \
83 testipp.o \
84 testlang.o \
fa73b229 85 testppd.o \
ef416fc2 86 php_cups_wrap.o
87
88
89#
90# Header files to install...
91#
92
93HEADERS = \
757d2cad 94 adminutil.h \
ef416fc2 95 array.h \
96 cups.h \
97 dir.h \
98 file.h \
99 http.h \
100 i18n.h \
101 ipp.h \
102 language.h \
103 md5.h \
ef416fc2 104 ppd.h \
105 transcode.h
106
107
108#
109# Targets in this directory...
110#
111
112TARGETS = \
113 $(LIBCUPS) \
e1d6a774 114 $(LIB32CUPS) \
115 $(LIB64CUPS) \
ef416fc2 116 libcups.a \
757d2cad 117 testadmin \
ef416fc2 118 testarray \
119 testfile \
120 testhttp \
121 testi18n \
122 testipp \
fa73b229 123 testlang \
124 testppd
ef416fc2 125
126
127#
128# Make all targets...
129#
130
131all: $(TARGETS)
132
133
134#
135# Remove object and target files...
136#
137
138clean:
e1d6a774 139 $(RM) $(OBJS) $(TARGETS)
f301802f 140 $(RM) libcups.so libcups.sl libcups.dylib
ed486911 141 $(RM) -r 32bit 64bit
ef416fc2 142
143
144#
145# Update dependencies (without system header dependencies...)
146#
147
148depend:
e1d6a774 149 touch Dependencies.tmp
150 makedepend -Y -I.. -fDependencies.tmp $(OBJS:.o=.c) >/dev/null 2>&1
151 $(RM) Dependencies
152 cp Dependencies.tmp Dependencies
153 sed -r -e '1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp >>Dependencies
154 sed -r -e '1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp >>Dependencies
155 $(RM) Dependencies.tmp
ef416fc2 156
157
158#
159# Install object and target files...
160#
161
e1d6a774 162install: all installhdrs $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64)
bd7854cb 163 $(INSTALL_DIR) -m 755 $(LIBDIR)
ef416fc2 164 $(INSTALL_LIB) $(LIBCUPS) $(LIBDIR)
165 if test $(LIBCUPS) = "libcups.so.2" -o $(LIBCUPS) = "libcups.sl.2"; then \
166 $(RM) $(LIBDIR)/`basename $(LIBCUPS) .2`; \
167 $(LN) $(LIBCUPS) $(LIBDIR)/`basename $(LIBCUPS) .2`; \
168 fi
169 if test $(LIBCUPS) = "libcups.2.dylib"; then \
170 $(STRIP) -x $(LIBDIR)/$(LIBCUPS); \
171 $(RM) $(LIBDIR)/libcups.dylib; \
172 $(LN) $(LIBCUPS) $(LIBDIR)/libcups.dylib; \
173 fi
923edb68 174
175installstatic:
176 $(INSTALL_DIR) -m 755 $(LIBDIR)
d6ae789d 177 $(INSTALL_LIB) libcups.a $(LIBDIR)
178 $(RANLIB) $(LIBDIR)/libcups.a
ef416fc2 179
180installhdrs:
bd7854cb 181 $(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups
ef416fc2 182 for file in $(HEADERS); do \
183 $(INSTALL_DATA) $$file $(INCLUDEDIR)/cups; \
184 done
185
e1d6a774 186install32bit:
187 $(INSTALL_DIR) -m 755 $(LIB32DIR)
f301802f 188 $(INSTALL_LIB) 32bit/libcups.so.2 $(LIB32DIR)/libcups.so.2
ed486911 189 $(LN) libcups.so.2 $(LIB32DIR)/libcups.so
e1d6a774 190
191install64bit:
192 $(INSTALL_DIR) -m 755 $(LIB64DIR)
f301802f 193 $(INSTALL_LIB) 64bit/libcups.so.2 $(LIB64DIR)/libcups.so.2
ed486911 194 $(LN) libcups.so.2 $(LIB64DIR)/libcups.so
e1d6a774 195
ef416fc2 196
757d2cad 197#
198# Uninstall object and target files...
199#
200
e1d6a774 201uninstall: $(UNINSTALL32) $(UNINSTALL64)
757d2cad 202 $(RM) $(LIBDIR)/libcups.2.dylib
203 $(RM) $(LIBDIR)/libcups.a
204 $(RM) $(LIBDIR)/libcups.dylib
205 $(RM) $(LIBDIR)/libcups_s.a
206 $(RM) $(LIBDIR)/libcups.sl
207 $(RM) $(LIBDIR)/libcups.sl.2
208 $(RM) $(LIBDIR)/libcups.so
209 $(RM) $(LIBDIR)/libcups.so.2
210 -$(RMDIR) $(LIBDIR)
211 for file in $(HEADERS); do \
212 $(RM) $(INCLUDEDIR)/cups/$$file; \
213 done
214 -$(RMDIR) $(INCLUDEDIR)/cups
215
e1d6a774 216uninstall32bit:
217 $(RM) $(LIB32DIR)/libcups.so
218 $(RM) $(LIB32DIR)/libcups.so.2
219 -$(RMDIR) $(LIB32DIR)
220
221uninstall64bit:
222 $(RM) $(LIB64DIR)/libcups.so
223 $(RM) $(LIB64DIR)/libcups.so.2
224 -$(RMDIR) $(LIB64DIR)
225
757d2cad 226
ef416fc2 227#
228# libcups.so.2, libcups.sl.2
229#
230
231libcups.so.2 libcups.sl.2: $(LIBOBJS)
232 echo Linking $@...
e1d6a774 233 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 234 $(RM) `basename $@ .2`
235 $(LN) $@ `basename $@ .2`
236
237
e1d6a774 238#
f301802f 239# 32bit/libcups.so.2
e1d6a774 240#
241
f301802f 24232bit/libcups.so.2: $(LIB32OBJS)
e1d6a774 243 echo Linking 32-bit $@...
f301802f 244 -mkdir 32bit
245 $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(LIB32OBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
246 $(RM) 32bit/libcups.so
247 $(LN) libcups.so.2 32bit/libcups.so
e1d6a774 248
249
250#
f301802f 251# 64bit/libcups.so.2
e1d6a774 252#
253
f301802f 25464bit/libcups.so.2: $(LIB64OBJS)
e1d6a774 255 echo Linking 64-bit $@...
f301802f 256 -mkdir 64bit
257 $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(LIB64OBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
258 $(RM) 64bit/libcups.so
259 $(LN) libcups.so.2 64bit/libcups.so
e1d6a774 260
261
ef416fc2 262#
263# libcups.2.dylib
264#
265
266libcups.2.dylib: $(LIBOBJS)
267 echo Linking $@...
e1d6a774 268 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
fa73b229 269 -install_name $(libdir)/$@ \
ef416fc2 270 -current_version 2.7.0 \
271 -compatibility_version 2.0.0 \
272 $(LIBOBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
273 $(RM) libcups.dylib
274 $(LN) $@ libcups.dylib
275
276
277#
278# libcups_s.a
279#
280
a74454a7 281libcups_s.a: $(LIBOBJS) libcups_s.exp
ef416fc2 282 echo Creating $@...
283 $(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o $(LIBOBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) -lm
284 $(RM) $@
285 $(AR) $(ARFLAGS) $@ libcups_s.o
286
287
288#
289# libcups.la
290#
291
292libcups.la: $(LIBOBJS)
293 echo Linking $@...
e1d6a774 294 $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
ef416fc2 295 -version-info 2:7 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
296
297
298#
299# libcups.a
300#
301
302libcups.a: $(LIBOBJS)
303 echo Archiving $@...
304 $(RM) $@
305 $(AR) $(ARFLAGS) $@ $(LIBOBJS)
306 $(RANLIB) $@
307
308
309#
310# CUPS language bindings for various scripting languages...
311#
757d2cad 312# NOTE: Not currently used or functional - see the scripting/php directory
313# for the hand-written bindings...
314#
ef416fc2 315
316phpcups.so: $(LIBCUPS) php_cups_wrap.o
317 echo Linking $@...
318 if test `uname` = Darwin; then \
319 DSOFLAGS="-bundle -flat_namespace -undefined suppress"; \
320 else \
321 DSOFLAGS="$(DSOFLAGS)"; \
322 fi; \
323 $(DSO) $$DSOFLAGS -o $@ php_cups_wrap.o $(LIBS) `php-config --ldflags --libs`
324
325php_cups_wrap.o: php_cups_wrap.c
326 echo Compiling $<...
327 $(CC) $(CFLAGS) `php-config --includes` -c $<
328php_cups_wrap.c: cups.h
329 echo Creating $< using SWIG...
330 swig -php -o $@ -module cups cups.h
331
332
757d2cad 333#
334# testadmin (dependency on static CUPS library is intentional)
335#
336
337testadmin: testadmin.o libcups.a
338 echo Linking $@...
339 $(CC) $(LDFLAGS) -o $@ testadmin.o libcups.a \
340 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
341
342
ef416fc2 343#
344# testarray (dependency on static CUPS library is intentional)
345#
346
347testarray: testarray.o libcups.a
348 echo Linking $@...
349 $(CC) $(LDFLAGS) -o $@ testarray.o libcups.a \
350 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
351
352
353#
354# testfile (dependency on static CUPS library is intentional)
355#
356
357testfile: testfile.o libcups.a
358 echo Linking $@...
359 $(CC) $(LDFLAGS) -o $@ testfile.o libcups.a \
360 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
361
362
363#
364# testhttp (dependency on static CUPS library is intentional)
365#
366
367testhttp: testhttp.o libcups.a
368 echo Linking $@...
369 $(CC) $(LDFLAGS) -o $@ testhttp.o libcups.a \
370 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
371
372
373#
374# testipp (dependency on static CUPS library is intentional)
375#
376
377testipp: testipp.o libcups.a
378 echo Linking $@...
379 $(CC) $(LDFLAGS) -o $@ testipp.o libcups.a \
380 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
381
382
383#
384# testi18n (dependency on static CUPS library is intentional)
385#
386
387testi18n: testi18n.o libcups.a
388 echo Linking $@...
389 $(CC) $(LDFLAGS) -o $@ testi18n.o libcups.a \
390 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
391
392
393#
394# testlang (dependency on static CUPS library is intentional)
395#
396
397testlang: testlang.o libcups.a
398 echo Linking $@...
399 $(CC) $(LDFLAGS) -o $@ testlang.o libcups.a \
400 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
401
402
fa73b229 403#
404# testppd (dependency on static CUPS library is intentional)
405#
406
407testppd: testppd.o libcups.a
408 echo Linking $@...
409 $(CC) $(LDFLAGS) -o $@ testppd.o libcups.a \
410 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
411
412
ef416fc2 413#
414# Automatic API help files...
415#
416
417apihelp:
418 echo Generating CUPS API help files...
419 mxmldoc --section "Programming" --title "Array API" \
420 --intro api-array.shtml \
421 array.h array.c >../doc/help/api-array.html
422 mxmldoc --section "Programming" --title "CUPS API" \
423 --intro api-cups.shtml \
ecdc0628 424 cups.h dest.c getputfile.c language.c \
ef416fc2 425 options.c tempfile.c usersys.c \
426 util.c >../doc/help/api-cups.html
427 mxmldoc --section "Programming" --title "File and Directory APIs" \
428 --intro api-filedir.shtml \
429 file.h file.c dir.h dir.c >../doc/help/api-filedir.html
430 mxmldoc --section "Programming" --title "PPD API" \
431 --intro api-ppd.shtml \
89d46774 432 ppd.h attr.c custom.c emit.c localize.c mark.c page.c \
ef416fc2 433 ppd.c >../doc/help/api-ppd.html
434 mxmldoc --section "Programming" --title "HTTP and IPP APIs" \
435 --intro api-httpipp.shtml \
ecdc0628 436 http.h ipp.h auth.c encode.c http.c http-addr.c \
437 http-support.c ipp.c ipp-support.c md5passwd.c \
438 request.c >../doc/help/api-httpipp.html
ef416fc2 439 mxmldoc --section "Programming" --title "Filter and Backend APIs" \
440 --intro api-filter.shtml \
441 backchannel.c >../doc/help/api-filter.html
442
443
444#
445# Dependencies...
446#
447
448include Dependencies
449
450
451#
f7faf1f5 452# End of "$Id: Makefile 5628 2006-06-05 15:25:23Z mike $".
ef416fc2 453#