]> git.ipfire.org Git - thirdparty/cups.git/blame - cups/Makefile
Load cups into easysw/current.
[thirdparty/cups.git] / cups / Makefile
CommitLineData
ef416fc2 1#
09a101d6 2# "$Id: Makefile 6603 2007-06-22 22:23:21Z 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 \
f7deaa1a 66 sidechannel.o \
ef416fc2 67 snprintf.o \
68 string.o \
69 tempfile.o \
70 transcode.o \
71 usersys.o \
72 util.o
e1d6a774 73LIB32OBJS = $(LIBOBJS:.o=.32.o)
74LIB64OBJS = $(LIBOBJS:.o=.64.o)
ef416fc2 75OBJS = \
76 $(LIBOBJS) \
e1d6a774 77 $(LIB32OBJS) \
78 $(LIB64OBJS) \
757d2cad 79 testadmin.o \
ef416fc2 80 testarray.o \
09a101d6 81 testcups.o \
ef416fc2 82 testfile.o \
83 testhttp.o \
84 testi18n.o \
85 testipp.o \
86 testlang.o \
fa73b229 87 testppd.o \
ef416fc2 88 php_cups_wrap.o
89
90
91#
92# Header files to install...
93#
94
95HEADERS = \
757d2cad 96 adminutil.h \
ef416fc2 97 array.h \
d09495fa 98 backend.h \
ef416fc2 99 cups.h \
100 dir.h \
101 file.h \
102 http.h \
103 i18n.h \
104 ipp.h \
105 language.h \
ef416fc2 106 ppd.h \
f7deaa1a 107 sidechannel.h \
ef416fc2 108 transcode.h
109
110
111#
112# Targets in this directory...
113#
114
115TARGETS = \
116 $(LIBCUPS) \
e1d6a774 117 $(LIB32CUPS) \
118 $(LIB64CUPS) \
ef416fc2 119 libcups.a \
757d2cad 120 testadmin \
ef416fc2 121 testarray \
09a101d6 122 testcups \
ef416fc2 123 testfile \
124 testhttp \
125 testi18n \
126 testipp \
fa73b229 127 testlang \
128 testppd
ef416fc2 129
130
131#
132# Make all targets...
133#
134
135all: $(TARGETS)
136
137
138#
139# Remove object and target files...
140#
141
142clean:
e1d6a774 143 $(RM) $(OBJS) $(TARGETS)
f301802f 144 $(RM) libcups.so libcups.sl libcups.dylib
ed486911 145 $(RM) -r 32bit 64bit
ef416fc2 146
147
148#
149# Update dependencies (without system header dependencies...)
150#
151
152depend:
e1d6a774 153 touch Dependencies.tmp
154 makedepend -Y -I.. -fDependencies.tmp $(OBJS:.o=.c) >/dev/null 2>&1
155 $(RM) Dependencies
156 cp Dependencies.tmp Dependencies
157 sed -r -e '1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp >>Dependencies
158 sed -r -e '1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp >>Dependencies
159 $(RM) Dependencies.tmp
ef416fc2 160
161
162#
163# Install object and target files...
164#
165
e1d6a774 166install: all installhdrs $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64)
bd7854cb 167 $(INSTALL_DIR) -m 755 $(LIBDIR)
ef416fc2 168 $(INSTALL_LIB) $(LIBCUPS) $(LIBDIR)
169 if test $(LIBCUPS) = "libcups.so.2" -o $(LIBCUPS) = "libcups.sl.2"; then \
170 $(RM) $(LIBDIR)/`basename $(LIBCUPS) .2`; \
171 $(LN) $(LIBCUPS) $(LIBDIR)/`basename $(LIBCUPS) .2`; \
172 fi
173 if test $(LIBCUPS) = "libcups.2.dylib"; then \
174 $(STRIP) -x $(LIBDIR)/$(LIBCUPS); \
175 $(RM) $(LIBDIR)/libcups.dylib; \
176 $(LN) $(LIBCUPS) $(LIBDIR)/libcups.dylib; \
177 fi
09a101d6 178 if test "x$(SYMROOT)" != "x"; then \
179 $(INSTALL_DIR) $(SYMROOT); \
180 for file in $(TARGETS); do \
181 cp $$file $(SYMROOT); \
182 done \
183 fi
923edb68 184
185installstatic:
186 $(INSTALL_DIR) -m 755 $(LIBDIR)
d6ae789d 187 $(INSTALL_LIB) libcups.a $(LIBDIR)
188 $(RANLIB) $(LIBDIR)/libcups.a
ef416fc2 189
190installhdrs:
bd7854cb 191 $(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups
ef416fc2 192 for file in $(HEADERS); do \
193 $(INSTALL_DATA) $$file $(INCLUDEDIR)/cups; \
194 done
195
e1d6a774 196install32bit:
197 $(INSTALL_DIR) -m 755 $(LIB32DIR)
f301802f 198 $(INSTALL_LIB) 32bit/libcups.so.2 $(LIB32DIR)/libcups.so.2
ed486911 199 $(LN) libcups.so.2 $(LIB32DIR)/libcups.so
e1d6a774 200
201install64bit:
202 $(INSTALL_DIR) -m 755 $(LIB64DIR)
f301802f 203 $(INSTALL_LIB) 64bit/libcups.so.2 $(LIB64DIR)/libcups.so.2
ed486911 204 $(LN) libcups.so.2 $(LIB64DIR)/libcups.so
e1d6a774 205
ef416fc2 206
757d2cad 207#
208# Uninstall object and target files...
209#
210
e1d6a774 211uninstall: $(UNINSTALL32) $(UNINSTALL64)
757d2cad 212 $(RM) $(LIBDIR)/libcups.2.dylib
213 $(RM) $(LIBDIR)/libcups.a
214 $(RM) $(LIBDIR)/libcups.dylib
215 $(RM) $(LIBDIR)/libcups_s.a
216 $(RM) $(LIBDIR)/libcups.sl
217 $(RM) $(LIBDIR)/libcups.sl.2
218 $(RM) $(LIBDIR)/libcups.so
219 $(RM) $(LIBDIR)/libcups.so.2
220 -$(RMDIR) $(LIBDIR)
221 for file in $(HEADERS); do \
222 $(RM) $(INCLUDEDIR)/cups/$$file; \
223 done
224 -$(RMDIR) $(INCLUDEDIR)/cups
225
e1d6a774 226uninstall32bit:
227 $(RM) $(LIB32DIR)/libcups.so
228 $(RM) $(LIB32DIR)/libcups.so.2
229 -$(RMDIR) $(LIB32DIR)
230
231uninstall64bit:
232 $(RM) $(LIB64DIR)/libcups.so
233 $(RM) $(LIB64DIR)/libcups.so.2
234 -$(RMDIR) $(LIB64DIR)
235
757d2cad 236
ef416fc2 237#
238# libcups.so.2, libcups.sl.2
239#
240
241libcups.so.2 libcups.sl.2: $(LIBOBJS)
242 echo Linking $@...
f7deaa1a 243 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 244 $(RM) `basename $@ .2`
245 $(LN) $@ `basename $@ .2`
246
247
e1d6a774 248#
f301802f 249# 32bit/libcups.so.2
e1d6a774 250#
251
f301802f 25232bit/libcups.so.2: $(LIB32OBJS)
e1d6a774 253 echo Linking 32-bit $@...
f301802f 254 -mkdir 32bit
f7deaa1a 255 $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(LIB32OBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
f301802f 256 $(RM) 32bit/libcups.so
257 $(LN) libcups.so.2 32bit/libcups.so
e1d6a774 258
259
260#
f301802f 261# 64bit/libcups.so.2
e1d6a774 262#
263
f301802f 26464bit/libcups.so.2: $(LIB64OBJS)
e1d6a774 265 echo Linking 64-bit $@...
f301802f 266 -mkdir 64bit
f7deaa1a 267 $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(LIB64OBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
f301802f 268 $(RM) 64bit/libcups.so
269 $(LN) libcups.so.2 64bit/libcups.so
e1d6a774 270
271
ef416fc2 272#
273# libcups.2.dylib
274#
275
09a101d6 276libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER)
ef416fc2 277 echo Linking $@...
e1d6a774 278 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
fa73b229 279 -install_name $(libdir)/$@ \
f7deaa1a 280 -current_version 2.8.0 \
ef416fc2 281 -compatibility_version 2.0.0 \
09a101d6 282 -exported_symbols_list libcups.exp \
283 -sectorder __TEXT __text $(LIBCUPSORDER) \
f7deaa1a 284 $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 285 $(RM) libcups.dylib
286 $(LN) $@ libcups.dylib
287
288
289#
290# libcups_s.a
291#
292
a74454a7 293libcups_s.a: $(LIBOBJS) libcups_s.exp
ef416fc2 294 echo Creating $@...
f7deaa1a 295 $(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) -lm
ef416fc2 296 $(RM) $@
297 $(AR) $(ARFLAGS) $@ libcups_s.o
298
299
300#
301# libcups.la
302#
303
304libcups.la: $(LIBOBJS)
305 echo Linking $@...
e1d6a774 306 $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
f7deaa1a 307 -version-info 2:8 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 308
309
310#
311# libcups.a
312#
313
314libcups.a: $(LIBOBJS)
315 echo Archiving $@...
316 $(RM) $@
317 $(AR) $(ARFLAGS) $@ $(LIBOBJS)
318 $(RANLIB) $@
319
320
321#
322# CUPS language bindings for various scripting languages...
323#
757d2cad 324# NOTE: Not currently used or functional - see the scripting/php directory
325# for the hand-written bindings...
326#
ef416fc2 327
328phpcups.so: $(LIBCUPS) php_cups_wrap.o
329 echo Linking $@...
330 if test `uname` = Darwin; then \
331 DSOFLAGS="-bundle -flat_namespace -undefined suppress"; \
332 else \
333 DSOFLAGS="$(DSOFLAGS)"; \
334 fi; \
335 $(DSO) $$DSOFLAGS -o $@ php_cups_wrap.o $(LIBS) `php-config --ldflags --libs`
336
337php_cups_wrap.o: php_cups_wrap.c
338 echo Compiling $<...
339 $(CC) $(CFLAGS) `php-config --includes` -c $<
340php_cups_wrap.c: cups.h
341 echo Creating $< using SWIG...
342 swig -php -o $@ -module cups cups.h
343
344
757d2cad 345#
346# testadmin (dependency on static CUPS library is intentional)
347#
348
349testadmin: testadmin.o libcups.a
350 echo Linking $@...
351 $(CC) $(LDFLAGS) -o $@ testadmin.o libcups.a \
f7deaa1a 352 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
757d2cad 353
354
ef416fc2 355#
356# testarray (dependency on static CUPS library is intentional)
357#
358
359testarray: testarray.o libcups.a
360 echo Linking $@...
361 $(CC) $(LDFLAGS) -o $@ testarray.o libcups.a \
f7deaa1a 362 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 363
364
09a101d6 365#
366# testcups (dependency on static CUPS library is intentional)
367#
368
369testcups: testcups.o libcups.a
370 echo Linking $@...
371 $(CC) $(LDFLAGS) -o $@ testcups.o libcups.a \
372 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
373
374
ef416fc2 375#
376# testfile (dependency on static CUPS library is intentional)
377#
378
379testfile: testfile.o libcups.a
380 echo Linking $@...
381 $(CC) $(LDFLAGS) -o $@ testfile.o libcups.a \
f7deaa1a 382 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 383
384
385#
386# testhttp (dependency on static CUPS library is intentional)
387#
388
389testhttp: testhttp.o libcups.a
390 echo Linking $@...
391 $(CC) $(LDFLAGS) -o $@ testhttp.o libcups.a \
f7deaa1a 392 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 393
394
395#
396# testipp (dependency on static CUPS library is intentional)
397#
398
399testipp: testipp.o libcups.a
400 echo Linking $@...
401 $(CC) $(LDFLAGS) -o $@ testipp.o libcups.a \
f7deaa1a 402 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 403
404
405#
406# testi18n (dependency on static CUPS library is intentional)
407#
408
409testi18n: testi18n.o libcups.a
410 echo Linking $@...
411 $(CC) $(LDFLAGS) -o $@ testi18n.o libcups.a \
f7deaa1a 412 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 413
414
415#
416# testlang (dependency on static CUPS library is intentional)
417#
418
419testlang: testlang.o libcups.a
420 echo Linking $@...
421 $(CC) $(LDFLAGS) -o $@ testlang.o libcups.a \
f7deaa1a 422 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 423
424
fa73b229 425#
426# testppd (dependency on static CUPS library is intentional)
427#
428
429testppd: testppd.o libcups.a
430 echo Linking $@...
431 $(CC) $(LDFLAGS) -o $@ testppd.o libcups.a \
f7deaa1a 432 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
fa73b229 433
434
ef416fc2 435#
436# Automatic API help files...
437#
438
439apihelp:
440 echo Generating CUPS API help files...
441 mxmldoc --section "Programming" --title "Array API" \
442 --intro api-array.shtml \
443 array.h array.c >../doc/help/api-array.html
444 mxmldoc --section "Programming" --title "CUPS API" \
445 --intro api-cups.shtml \
f7deaa1a 446 cups.h dest.c getputfile.c language.c notify.c \
ef416fc2 447 options.c tempfile.c usersys.c \
448 util.c >../doc/help/api-cups.html
449 mxmldoc --section "Programming" --title "File and Directory APIs" \
450 --intro api-filedir.shtml \
451 file.h file.c dir.h dir.c >../doc/help/api-filedir.html
452 mxmldoc --section "Programming" --title "PPD API" \
453 --intro api-ppd.shtml \
89d46774 454 ppd.h attr.c custom.c emit.c localize.c mark.c page.c \
ef416fc2 455 ppd.c >../doc/help/api-ppd.html
456 mxmldoc --section "Programming" --title "HTTP and IPP APIs" \
457 --intro api-httpipp.shtml \
ecdc0628 458 http.h ipp.h auth.c encode.c http.c http-addr.c \
459 http-support.c ipp.c ipp-support.c md5passwd.c \
460 request.c >../doc/help/api-httpipp.html
ef416fc2 461 mxmldoc --section "Programming" --title "Filter and Backend APIs" \
462 --intro api-filter.shtml \
f7deaa1a 463 backchannel.c sidechannel.c sidechannel.h >../doc/help/api-filter.html
ef416fc2 464
465
466#
467# Dependencies...
468#
469
470include Dependencies
471
472
473#
09a101d6 474# End of "$Id: Makefile 6603 2007-06-22 22:23:21Z mike $".
ef416fc2 475#