]> git.ipfire.org Git - thirdparty/cups.git/blob - scheduler/Makefile
Merge changes from CUPS 1.5svn-r8849.
[thirdparty/cups.git] / scheduler / Makefile
1 #
2 # "$Id: Makefile 7875 2008-08-27 22:53:31Z mike $"
3 #
4 # Scheduler Makefile for the Common UNIX Printing System (CUPS).
5 #
6 # Copyright 2007-2009 by Apple Inc.
7 # Copyright 1997-2007 by Easy Software Products, all rights reserved.
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
16 include ../Makedefs
17
18 CUPSDOBJS = \
19 auth.o \
20 banners.o \
21 cert.o \
22 classes.o \
23 client.o \
24 conf.o \
25 dirsvc.o \
26 env.o \
27 main.o \
28 ipp.o \
29 listen.o \
30 job.o \
31 log.o \
32 network.o \
33 policy.o \
34 printers.o \
35 process.o \
36 quotas.o \
37 removefile.o \
38 select.o \
39 server.o \
40 statbuf.o \
41 subscriptions.o \
42 sysman.o
43 LIBOBJS = \
44 filter.o \
45 mime.o \
46 type.o
47 COBJS = \
48 $(CUPSDOBJS) \
49 $(LIBOBJS) \
50 cupsfilter.o \
51 cups-deviced.o \
52 cups-lpd.o \
53 cups-polld.o \
54 testdirsvc.o \
55 testlpd.o \
56 testmime.o \
57 testspeed.o \
58 testsub.o \
59 util.o
60 CXXOBJS = \
61 cups-driverd.o
62 OBJS = \
63 $(COBJS) \
64 $(CXXOBJS)
65 LIBTARGETS = \
66 $(LIBCUPSMIME) \
67 libcupsmime.a
68
69 UNITTARGETS = \
70 testdirsvc \
71 testlpd \
72 testmime \
73 testspeed \
74 testsub
75
76 TARGETS = \
77 $(LIBTARGETS) \
78 cupsd \
79 cupsfilter \
80 cups-deviced \
81 cups-driverd \
82 cups-lpd \
83 cups-polld \
84
85
86 #
87 # Make everything...
88 #
89
90 all: $(TARGETS)
91
92
93 #
94 # Make library targets...
95 #
96
97 libs: $(LIBTARGETS)
98
99
100 #
101 # Make unit tests...
102 #
103
104 unittests: $(UNITTARGETS)
105
106
107 #
108 # Clean all object files...
109 #
110
111 clean:
112 $(RM) $(OBJS)
113 $(RM) $(TARGETS) $(UNITTARGETS) convert
114 $(RM) libcupsmime.so libcupsmime.sl libcupsmime.dylib
115
116
117 #
118 # Update dependencies (without system header dependencies...)
119 #
120
121 depend:
122 makedepend -Y -I.. -fDependencies $(COBJS:.o=.c) \
123 $(CXXOBJS:.o=.cxx) >/dev/null 2>&1
124
125
126 #
127 # Install all targets...
128 #
129
130 install: all install-data install-headers install-libs install-exec
131
132
133 #
134 # Install data files...
135 #
136
137 install-data:
138 echo Creating $(SERVERBIN)/driver...
139 $(INSTALL_DIR) -m 755 $(SERVERBIN)/driver
140 echo Creating $(SERVERROOT)...
141 $(INSTALL_DIR) -m 755 -g $(CUPS_GROUP) $(SERVERROOT)
142 echo Creating $(SERVERROOT)/interfaces...
143 $(INSTALL_DIR) -m 755 -g $(CUPS_GROUP) $(SERVERROOT)/interfaces
144 echo Creating $(SERVERROOT)/ppd...
145 $(INSTALL_DIR) -m 755 -g $(CUPS_GROUP) $(SERVERROOT)/ppd
146 if test "x`uname`" != xDarwin; then \
147 echo Creating $(SERVERROOT)/ssl...; \
148 $(INSTALL_DIR) -m 700 -g $(CUPS_GROUP) $(SERVERROOT)/ssl; \
149 fi
150 if test "$(STATEDIR)" != "$(SERVERROOT)"; then \
151 echo Creating $(STATEDIR)...; \
152 $(INSTALL_DIR) -m 755 $(STATEDIR); \
153 fi
154 echo Creating $(STATEDIR)/certs...
155 $(INSTALL_DIR) -m 511 -o $(CUPS_USER) -g $(CUPS_PRIMARY_SYSTEM_GROUP) \
156 $(STATEDIR)/certs
157 echo Creating $(LOGDIR)...
158 $(INSTALL_DIR) -m 755 $(LOGDIR)
159 echo Creating $(REQUESTS)...
160 $(INSTALL_DIR) -m 710 -g $(CUPS_GROUP) $(REQUESTS)
161 echo Creating $(REQUESTS)/tmp...
162 $(INSTALL_DIR) -m 1770 -g $(CUPS_GROUP) $(REQUESTS)/tmp
163 echo Creating $(CACHEDIR)...
164 $(INSTALL_DIR) -m 775 -g $(CUPS_GROUP) $(CACHEDIR)
165 if test "x$(INITDIR)" != x; then \
166 echo Installing init scripts...; \
167 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/init.d; \
168 $(INSTALL_SCRIPT) cups.sh $(BUILDROOT)$(INITDIR)/init.d/cups; \
169 for level in $(RCLEVELS); do \
170 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc$${level}.d; \
171 $(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/S$(RCSTART)cups; \
172 if test `uname` = HP-UX; then \
173 level=`expr $$level - 1`; \
174 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc$${level}.d; \
175 fi; \
176 $(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/K$(RCSTOP)cups; \
177 done; \
178 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc0.d; \
179 $(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc0.d/K$(RCSTOP)cups; \
180 fi
181 if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \
182 $(INSTALL_DIR) $(BUILDROOT)$(INITDDIR); \
183 if test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
184 echo Installing LaunchDaemons configuration files...; \
185 $(INSTALL_DATA) org.cups.cupsd.plist $(BUILDROOT)$(DEFAULT_LAUNCHD_CONF); \
186 $(INSTALL_DATA) org.cups.cups-lpd.plist $(BUILDROOT)/System/Library/LaunchDaemons; \
187 else \
188 echo Installing RC script...; \
189 $(INSTALL_SCRIPT) cups.sh $(BUILDROOT)$(INITDDIR)/cups; \
190 fi \
191 fi
192 if test "x$(SMFMANIFESTDIR)" != x; then \
193 echo Installing SMF manifest in $(SMFMANIFESTDIR)...;\
194 $(INSTALL_DIR) $(BUILDROOT)/$(SMFMANIFESTDIR); \
195 $(INSTALL_SCRIPT) cups.xml $(BUILDROOT)$(SMFMANIFESTDIR)/cups.xml; \
196 fi
197 if test "x$(XINETD)" != x; then \
198 echo Installing xinetd configuration file for cups-lpd...; \
199 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(XINETD); \
200 $(INSTALL_DATA) cups-lpd.xinetd $(BUILDROOT)$(XINETD)/cups-lpd; \
201 fi
202
203
204 #
205 # Install programs...
206 #
207
208 install-exec:
209 echo Installing programs in $(SBINDIR)...
210 $(INSTALL_DIR) -m 755 $(SBINDIR)
211 $(INSTALL_BIN) -m 500 cupsd $(SBINDIR)
212 $(INSTALL_BIN) cupsfilter $(SBINDIR)
213 -if test "x`uname`" = xDarwin; then \
214 $(INSTALL_DIR) $(BUILDROOT)/System/Library/Printers/Libraries; \
215 $(LN) $(sbindir)/cupsfilter $(BUILDROOT)/System/Library/Printers/Libraries/convert; \
216 fi
217 echo Installing programs in $(SERVERBIN)/daemon...
218 $(INSTALL_DIR) -m 755 $(SERVERBIN)
219 $(INSTALL_DIR) -m 755 $(SERVERBIN)/daemon
220 $(INSTALL_BIN) cups-deviced $(SERVERBIN)/daemon
221 $(INSTALL_BIN) cups-driverd $(SERVERBIN)/daemon
222 $(INSTALL_BIN) cups-lpd $(SERVERBIN)/daemon
223 $(INSTALL_BIN) cups-polld $(SERVERBIN)/daemon
224 if test "x$(SYMROOT)" != "x"; then \
225 $(INSTALL_DIR) $(SYMROOT); \
226 for file in $(TARGETS); do \
227 cp $$file $(SYMROOT); \
228 done \
229 fi
230
231
232 #
233 # Install headers...
234 #
235
236 install-headers:
237 echo Installing header files in $(INCLUDEDIR)/cups...
238 $(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups
239 $(INSTALL_DATA) mime.h $(INCLUDEDIR)/cups
240
241
242 #
243 # Install libraries...
244 #
245
246 install-libs: $(INSTALLSTATIC)
247 echo Installing libraries in $(LIBDIR)...
248 $(INSTALL_DIR) -m 755 $(LIBDIR)
249 $(INSTALL_LIB) $(LIBCUPSMIME) $(LIBDIR)
250 if test $(LIBCUPSMIME) = "libcupsmime.so.1" -o $(LIBCUPSMIME) = "libcupsmime.sl.1"; then \
251 $(RM) $(LIBDIR)/`basename $(LIBCUPSMIME) .1`; \
252 $(LN) $(LIBCUPSMIME) $(LIBDIR)/`basename $(LIBCUPSMIME) .1`; \
253 fi
254 if test $(LIBCUPSMIME) = "libcupsmime.1.dylib"; then \
255 $(RM) $(LIBDIR)/libcupsmime.dylib; \
256 $(LN) $(LIBCUPSMIME) $(LIBDIR)/libcupsmime.dylib; \
257 fi
258 if test "x$(SYMROOT)" != "x"; then \
259 $(INSTALL_DIR) $(SYMROOT); \
260 cp $(LIBCUPSMIME) $(SYMROOT); \
261 fi
262
263 installstatic:
264 $(INSTALL_DIR) -m 755 $(LIBDIR)
265 $(INSTALL_LIB) -m 755 libcupsmime.a $(LIBDIR)
266 $(RANLIB) $(LIBDIR)/libcupsmime.a
267 $(CHMOD) 555 $(LIBDIR)/libcupsmime.a
268
269
270 #
271 # Uninstall the scheduler...
272 #
273
274 uninstall:
275 $(RM) $(SBINDIR)/cupsd
276 $(RM) $(SBINDIR)/cupsfilter
277 $(RM) $(SERVERBIN)/daemon/cups-deviced
278 $(RM) $(SERVERBIN)/daemon/cups-driverd
279 $(RM) $(SERVERBIN)/daemon/cups-lpd
280 $(RM) $(SERVERBIN)/daemon/cups-polld
281 $(RM) $(BUILDROOT)/System/Library/Printers/Libraries/convert
282 -$(RMDIR) $(STATEDIR)/certs
283 -$(RMDIR) $(STATEDIR)
284 -$(RMDIR) $(SERVERROOT)/ppd
285 -$(RMDIR) $(SERVERROOT)/interfaces
286 -$(RMDIR) $(SERVERROOT)
287 -$(RMDIR) $(SERVERBIN)/driver
288 -$(RMDIR) $(SERVERBIN)/daemon
289 -$(RMDIR) $(SERVERBIN)
290 -$(RMDIR) $(SBINDIR)
291 -$(RMDIR) $(REQUESTS)/tmp
292 -$(RMDIR) $(REQUESTS)
293 -$(RMDIR) $(LOGDIR)
294 -$(RMDIR) $(CACHEDIR)
295 $(RM) $(LIBDIR)/libcupsmime.1.dylib
296 $(RM) $(LIBDIR)/libcupsmime.a
297 $(RM) $(LIBDIR)/libcupsmime.dylib
298 $(RM) $(LIBDIR)/libcupsmime_s.a
299 $(RM) $(LIBDIR)/libcupsmime.sl
300 $(RM) $(LIBDIR)/libcupsmime.sl.1
301 $(RM) $(LIBDIR)/libcupsmime.so
302 $(RM) $(LIBDIR)/libcupsmime.so.1
303 -$(RMDIR) $(LIBDIR)
304 $(RM) $(INCLUDEDIR)/cups/mime.h
305 -$(RMDIR) $(INCLUDEDIR)/cups
306 echo Uninstalling startup script...
307 if test "x$(INITDIR)" != x; then \
308 $(RM) $(BUILDROOT)$(INITDIR)/init.d/cups; \
309 $(RMDIR) $(BUILDROOT)$(INITDIR)/init.d; \
310 $(RM) $(BUILDROOT)$(INITDIR)/rc0.d/K00cups; \
311 $(RMDIR) $(BUILDROOT)$(INITDIR)/rc0.d; \
312 $(RM) $(BUILDROOT)$(INITDIR)/rc2.d/S99cups; \
313 $(RMDIR) $(BUILDROOT)$(INITDIR)/rc2.d; \
314 $(RM) $(BUILDROOT)$(INITDIR)/rc3.d/S99cups; \
315 $(RMDIR) $(BUILDROOT)$(INITDIR)/rc3.d; \
316 $(RM) $(BUILDROOT)$(INITDIR)/rc5.d/S99cups; \
317 $(RMDIR) $(BUILDROOT)$(INITDIR)/rc5.d; \
318 fi
319 if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \
320 if test "$(INITDDIR)" = "/System/Library/StartupItems/PrintingServices"; then \
321 $(RM) $(BUILDROOT)$(INITDDIR)/PrintingServices; \
322 $(RM) $(BUILDROOT)$(INITDDIR)/StartupParameters.plist; \
323 $(RM) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj/Localizable.strings; \
324 $(RMDIR) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \
325 elif test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
326 $(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cupsd.plist; \
327 $(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cups-lpd.plist; \
328 $(RMDIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices; \
329 else \
330 $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \
331 fi \
332 $(RMDIR) $(BUILDROOT)$(INITDDIR); \
333 fi
334 if test "x$(SMFMANIFESTDIR)" != x; then \
335 echo Uninstalling SMF manifest in $(SMFMANIFESTDIR)...;\
336 $(RM) $(BUILDROOT)$(SMFMANIFESTDIR)/cups.xml; \
337 fi
338 if test "x$(XINETD)" != x; then \
339 echo Uninstalling xinetd configuration file for cups-lpd...; \
340 $(RM) $(BUILDROOT)$(XINETD)/cups-lpd; \
341 fi
342
343
344 #
345 # Automatic API help files...
346 #
347
348 apihelp:
349 mxmldoc --section "Programming" \
350 --title "MIME API" \
351 --css ../doc/cups-printable.css \
352 --header api-mime.header --intro api-mime.shtml \
353 mime.h $(LIBOBJS:.o=.c) >../doc/help/api-mime.html
354 mxmldoc --tokens help/api-mime.html api-mime.xml >../doc/help/api-mime.tokens
355 $(RM) api-mime.xml
356
357 framedhelp:
358 mxmldoc --framed api-mime \
359 --section "Programming" \
360 --title "MIME API" \
361 --css ../doc/cups-printable.css \
362 --header api-mime.header --intro api-mime.shtml \
363 mime.h $(LIBOBJS:.o=.c)
364
365
366 #
367 # Make the scheduler executable, "cupsd".
368 #
369
370 cupsd: $(CUPSDOBJS) $(LIBCUPSMIME) ../cups/$(LIBCUPS)
371 echo Linking $@...
372 $(CC) $(LDFLAGS) -o cupsd $(CUPSDOBJS) -L. -lcupsmime \
373 $(LIBZ) $(SSLLIBS) $(LIBSLP) $(LIBLDAP) $(PAMLIBS) \
374 $(LIBPAPER) $(LIBMALLOC) $(CUPSDLIBS) $(DNSSDLIBS) $(LIBS) \
375 $(LIBGSSAPI) $(LIBWRAP)
376
377 cupsd-static: $(CUPSDOBJS) libcupsmime.a ../cups/libcups.a
378 echo Linking $@...
379 $(CC) $(LDFLAGS) -o cupsd-static $(CUPSDOBJS) libcupsmime.a \
380 $(LIBZ) $(SSLLIBS) $(LIBSLP) $(LIBLDAP) $(PAMLIBS) \
381 ../cups/libcups.a $(COMMONLIBS) $(LIBZ) $(LIBPAPER) \
382 $(LIBMALLOC) $(CUPSDLIBS) $(DNSSDLIBS) $(LIBGSSAPI) \
383 $(LIBWRAP)
384
385
386 #
387 # Make the cupsfilter utility.
388 #
389
390 cupsfilter: cupsfilter.o $(LIBCUPSMIME) ../cups/$(LIBCUPS)
391 echo Linking $@...
392 $(CC) $(LDFLAGS) -o cupsfilter cupsfilter.o -L. -lcupsmime $(LIBS)
393 $(RM) convert
394 $(LN) cupsfilter convert
395
396
397 #
398 # Make the device daemon, "cups-deviced".
399 #
400
401 cups-deviced: cups-deviced.o util.o ../cups/$(LIBCUPS)
402 echo Linking $@...
403 $(CC) $(LDFLAGS) -o cups-deviced cups-deviced.o util.o $(LIBS)
404
405
406 #
407 # Make the driver daemon, "cups-driverd".
408 #
409
410 cups-driverd: cups-driverd.o util.o ../cups/$(LIBCUPS) ../ppdc/$(LIBCUPSPPDC)
411 echo Linking $@...
412 $(CXX) $(LDFLAGS) -o cups-driverd cups-driverd.o util.o \
413 -L../ppdc -lcupsppdc $(LIBS)
414
415
416 #
417 # Make the line printer daemon, "cups-lpd".
418 #
419
420 cups-lpd: cups-lpd.o ../cups/$(LIBCUPS)
421 echo Linking $@...
422 $(CC) $(LDFLAGS) -o cups-lpd cups-lpd.o $(LIBS)
423
424
425 #
426 # Make the polling daemon, "cups-polld".
427 #
428
429 cups-polld: cups-polld.o ../cups/$(LIBCUPS)
430 echo Linking $@...
431 $(CC) $(LDFLAGS) -o cups-polld cups-polld.o $(LIBS)
432
433
434 #
435 # libcupsmime.so.1, libcupsmime.sl.1
436 #
437
438 libcupsmime.so.1 libcupsmime.sl.1: $(LIBOBJS)
439 echo Linking $@...
440 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBS)
441 $(RM) `basename $@ .1`
442 $(LN) $@ `basename $@ .1`
443
444
445 #
446 # libcupsmime.1.dylib
447 #
448
449 libcupsmime.1.dylib: $(LIBOBJS) libcupsmime.exp
450 echo Linking $@...
451 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
452 -install_name $(libdir)/$@ \
453 -current_version 1.0.0 \
454 -compatibility_version 1.0.0 \
455 -exported_symbols_list libcupsmime.exp \
456 $(LIBOBJS) $(LIBS)
457 $(RM) libcupsmime.dylib
458 $(LN) $@ libcupsmime.dylib
459
460
461 #
462 # libcupsmime_s.a
463 #
464
465 libcupsmime_s.a: $(LIBOBJS)
466 echo Creating $@...
467 $(DSO) $(DSOFLAGS) -o libcupsmime_s.o $(LIBOBJS) $(LIBS)
468 $(RM) $@
469 $(AR) $(ARFLAGS) $@ libcupsmime_s.o
470
471
472 #
473 # libcupsmime.la
474 #
475
476 libcupsmime.la: $(LIBOBJS)
477 echo Linking $@...
478 $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
479 -version-info 1:0 $(LIBS)
480
481
482 #
483 # libcupsmime.a
484 #
485
486 libcupsmime.a: $(LIBOBJS)
487 echo Archiving $@...
488 $(RM) $@
489 $(AR) $(ARFLAGS) $@ $(LIBOBJS)
490 $(RANLIB) $@
491
492
493 #
494 # Make the test program, "testdirsvc".
495 #
496
497 testdirsvc: testdirsvc.o
498 echo Linking $@...
499 $(CC) $(LDFLAGS) -o testdirsvc testdirsvc.o $(COMMONLIBS) $(NETLIBS)
500
501
502 #
503 # Make the test program, "testlpd".
504 #
505
506 testlpd: testlpd.o ../cups/libcups.a cups-lpd
507 echo Linking $@...
508 $(CC) $(LDFLAGS) -o testlpd testlpd.o ../cups/libcups.a \
509 $(COMMONLIBS) $(LIBZ) $(SSLLIBS) $(DNSSDLIBS) $(LIBGSSAPI)
510
511
512 #
513 # testmime
514 #
515
516 testmime: testmime.o libcupsmime.a ../cups/libcups.a
517 echo Linking $@...
518 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testmime.o libcupsmime.a \
519 ../cups/libcups.a $(COMMONLIBS) $(LIBZ) $(SSLLIBS) \
520 $(DNSSDLIBS) $(LIBGSSAPI)
521 echo Running MIME tests...
522 ./testmime
523
524
525 #
526 # Make the test program, "testspeed".
527 #
528
529 testspeed: testspeed.o ../cups/libcups.a
530 echo Linking $@...
531 $(CC) $(LDFLAGS) -o testspeed testspeed.o ../cups/libcups.a \
532 $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ) $(LIBGSSAPI)
533
534
535 #
536 # Make the test program, "testsub".
537 #
538
539 testsub: testsub.o ../cups/libcups.a
540 echo Linking $@...
541 $(CC) $(LDFLAGS) -o testsub testsub.o ../cups/libcups.a \
542 $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ) $(LIBGSSAPI)
543
544
545 #
546 # Dependencies...
547 #
548
549 include Dependencies
550
551
552 #
553 # End of "$Id: Makefile 7875 2008-08-27 22:53:31Z mike $".
554 #