]> git.ipfire.org Git - thirdparty/cups.git/blob - scheduler/Makefile
Use interactive priority for cupsd now.
[thirdparty/cups.git] / scheduler / Makefile
1 #
2 # Scheduler Makefile for CUPS.
3 #
4 # Copyright © 2007-2018 by Apple Inc.
5 # Copyright © 1997-2007 by Easy Software Products, all rights reserved.
6 #
7 # Licensed under Apache License v2.0. See the file "LICENSE" for more
8 # information.
9 #
10
11 include ../Makedefs
12
13 CUPSDOBJS = \
14 auth.o \
15 banners.o \
16 cert.o \
17 classes.o \
18 client.o \
19 colorman.o \
20 conf.o \
21 dirsvc.o \
22 env.o \
23 file.o \
24 main.o \
25 ipp.o \
26 listen.o \
27 job.o \
28 log.o \
29 network.o \
30 policy.o \
31 printers.o \
32 process.o \
33 quotas.o \
34 select.o \
35 server.o \
36 statbuf.o \
37 subscriptions.o \
38 sysman.o
39 LIBOBJS = \
40 filter.o \
41 mime.o \
42 type.o
43 COBJS = \
44 $(CUPSDOBJS) \
45 $(LIBOBJS) \
46 cupsfilter.o \
47 cups-deviced.o \
48 cups-exec.o \
49 cups-lpd.o \
50 testlpd.o \
51 testmime.o \
52 testspeed.o \
53 testsub.o \
54 util.o
55 CXXOBJS = \
56 cups-driverd.o
57 OBJS = \
58 $(COBJS) \
59 $(CXXOBJS)
60 LIBTARGETS = \
61 libcupsmime.a
62
63 UNITTARGETS = \
64 testlpd \
65 testmime \
66 testspeed \
67 testsub
68
69 PROGRAMS = \
70 cupsd \
71 cupsfilter \
72 cups-deviced \
73 cups-driverd \
74 cups-exec \
75 cups-lpd
76
77 TARGETS = \
78 $(LIBTARGETS) \
79 $(PROGRAMS)
80
81
82 #
83 # Make everything...
84 #
85
86 all: $(TARGETS)
87
88
89 #
90 # Make library targets...
91 #
92
93 libs:
94
95
96 #
97 # Make unit tests...
98 #
99
100 unittests: $(UNITTARGETS)
101
102
103 #
104 # Clean all object files...
105 #
106
107 clean:
108 $(RM) $(OBJS)
109 $(RM) $(TARGETS) $(UNITTARGETS) convert
110
111
112 #
113 # Update dependencies (without system header dependencies...)
114 #
115
116 depend:
117 $(CC) -MM $(ALL_CFLAGS) $(COBJS:.o=.c) >Dependencies
118 $(CXX) -MM $(ALL_CXXFLAGS) $(CXXOBJS:.o=.cxx) >>Dependencies
119
120
121 #
122 # Run oclint to check code coverage...
123 #
124
125 oclint:
126 oclint -o=oclint.html -html $(CUPSDOBJS:.o=.c) $(LIBOBJS:.o=.c) -- $(ALL_CFLAGS)
127
128
129 #
130 # Install all targets...
131 #
132
133 install: all install-data install-headers install-libs install-exec
134
135
136 #
137 # Install data files...
138 #
139
140 install-data:
141 echo Creating $(SERVERBIN)/driver...
142 $(INSTALL_DIR) -m 755 $(SERVERBIN)/driver
143 echo Creating $(SERVERROOT)...
144 $(INSTALL_DIR) -m 755 -g $(CUPS_GROUP) $(SERVERROOT)
145 echo Creating $(SERVERROOT)/ppd...
146 $(INSTALL_DIR) -m 755 -g $(CUPS_GROUP) $(SERVERROOT)/ppd
147 if test "x`uname`" != xDarwin; then \
148 echo Creating $(SERVERROOT)/ssl...; \
149 $(INSTALL_DIR) -m 700 -g $(CUPS_GROUP) $(SERVERROOT)/ssl; \
150 fi
151 if test "$(STATEDIR)" != "$(SERVERROOT)"; then \
152 echo Creating $(STATEDIR)...; \
153 $(INSTALL_DIR) -m 755 $(STATEDIR); \
154 fi
155 echo Creating $(STATEDIR)/certs...
156 $(INSTALL_DIR) -m 511 -o $(CUPS_USER) -g $(CUPS_PRIMARY_SYSTEM_GROUP) \
157 $(STATEDIR)/certs
158 echo Creating $(LOGDIR)...
159 $(INSTALL_DIR) -m 755 $(LOGDIR)
160 echo Creating $(REQUESTS)...
161 $(INSTALL_DIR) -m 710 -g $(CUPS_GROUP) $(REQUESTS)
162 echo Creating $(REQUESTS)/tmp...
163 $(INSTALL_DIR) -m 1770 -g $(CUPS_GROUP) $(REQUESTS)/tmp
164 echo Creating $(CACHEDIR)...
165 $(INSTALL_DIR) -m 770 -g $(CUPS_GROUP) $(CACHEDIR)
166 if test "x$(INITDIR)" != x; then \
167 echo Installing init scripts...; \
168 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/init.d; \
169 $(INSTALL_SCRIPT) cups.sh $(BUILDROOT)$(INITDIR)/init.d/cups; \
170 for level in $(RCLEVELS); do \
171 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc$${level}.d; \
172 $(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/S$(RCSTART)cups; \
173 $(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/K$(RCSTOP)cups; \
174 done; \
175 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc0.d; \
176 $(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc0.d/K$(RCSTOP)cups; \
177 fi
178 if test "x$(INITDDIR)" != x; then \
179 echo Installing init script...; \
180 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDDIR); \
181 $(INSTALL_SCRIPT) cups.sh $(BUILDROOT)$(INITDDIR); \
182 fi
183 if test "x$(LAUNCHD_DIR)" != x; then \
184 echo Installing launchd configuration files...; \
185 $(INSTALL_DIR) $(BUILDROOT)$(LAUNCHD_DIR); \
186 $(INSTALL_DATA) org.cups.cupsd.plist $(BUILDROOT)$(LAUNCHD_DIR); \
187 $(INSTALL_DATA) org.cups.cups-lpd.plist $(BUILDROOT)$(LAUNCHD_DIR); \
188 fi
189 if test "x$(SMFMANIFESTDIR)" != x; then \
190 echo Installing SMF manifest in $(SMFMANIFESTDIR)...;\
191 $(INSTALL_DIR) $(BUILDROOT)/$(SMFMANIFESTDIR); \
192 $(INSTALL_SCRIPT) cups.xml $(BUILDROOT)$(SMFMANIFESTDIR)/cups.xml; \
193 fi
194 if test "x$(SYSTEMD_DIR)" != x; then \
195 echo Installing systemd configuration files...; \
196 $(INSTALL_DIR) $(BUILDROOT)$(SYSTEMD_DIR); \
197 $(INSTALL_DATA) org.cups.cupsd.path $(BUILDROOT)$(SYSTEMD_DIR); \
198 $(INSTALL_DATA) org.cups.cupsd.service $(BUILDROOT)$(SYSTEMD_DIR); \
199 $(INSTALL_DATA) org.cups.cupsd.socket $(BUILDROOT)$(SYSTEMD_DIR); \
200 $(INSTALL_DATA) org.cups.cups-lpdAT.service $(BUILDROOT)$(SYSTEMD_DIR)/org.cups.cups-lpd@.service; \
201 $(INSTALL_DATA) org.cups.cups-lpd.socket $(BUILDROOT)$(SYSTEMD_DIR); \
202 elif test "x$(XINETD)" != x; then \
203 echo Installing xinetd configuration file for cups-lpd...; \
204 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(XINETD); \
205 $(INSTALL_DATA) cups-lpd.xinetd $(BUILDROOT)$(XINETD)/cups-lpd; \
206 fi
207
208
209 #
210 # Install programs...
211 #
212
213 install-exec:
214 echo Installing programs in $(SBINDIR)...
215 $(INSTALL_DIR) -m 755 $(SBINDIR)
216 $(INSTALL_BIN) -m $(CUPS_CUPSD_FILE_PERM) cupsd $(SBINDIR)
217 $(INSTALL_BIN) cupsfilter $(SBINDIR)
218 echo Installing programs in $(SERVERBIN)/daemon...
219 $(INSTALL_DIR) -m 755 $(SERVERBIN)
220 $(INSTALL_DIR) -m 755 $(SERVERBIN)/daemon
221 $(INSTALL_BIN) cups-deviced $(SERVERBIN)/daemon
222 $(INSTALL_BIN) cups-driverd $(SERVERBIN)/daemon
223 $(INSTALL_BIN) cups-exec $(SERVERBIN)/daemon
224 $(INSTALL_BIN) cups-lpd $(SERVERBIN)/daemon
225 if test "x$(SYMROOT)" != "x"; then \
226 $(INSTALL_DIR) $(SYMROOT); \
227 for file in $(PROGRAMS); do \
228 cp $$file $(SYMROOT); \
229 dsymutil $(SYMROOT)/$$file; \
230 done \
231 fi
232
233
234 #
235 # Install headers...
236 #
237
238 install-headers:
239
240
241 #
242 # Install libraries...
243 #
244
245 install-libs:
246
247
248 #
249 # Uninstall the scheduler...
250 #
251
252 uninstall:
253 $(RM) $(SBINDIR)/cupsd
254 $(RM) $(SBINDIR)/cupsfilter
255 $(RM) $(SERVERBIN)/daemon/cups-deviced
256 $(RM) $(SERVERBIN)/daemon/cups-driverd
257 $(RM) $(SERVERBIN)/daemon/cups-exec
258 $(RM) $(SERVERBIN)/daemon/cups-lpd
259 -$(RMDIR) $(STATEDIR)/certs
260 -$(RMDIR) $(STATEDIR)
261 -$(RMDIR) $(SERVERROOT)/ppd
262 -$(RMDIR) $(SERVERROOT)/interfaces
263 -$(RMDIR) $(SERVERROOT)
264 -$(RMDIR) $(SERVERBIN)/driver
265 -$(RMDIR) $(SERVERBIN)/daemon
266 -$(RMDIR) $(SERVERBIN)
267 -$(RMDIR) $(SBINDIR)
268 -$(RMDIR) $(REQUESTS)/tmp
269 -$(RMDIR) $(REQUESTS)
270 -$(RMDIR) $(LOGDIR)
271 -$(RMDIR) $(CACHEDIR)
272 if test "x$(INITDIR)" != x; then \
273 echo Uninstalling init scripts...; \
274 $(RM) $(BUILDROOT)$(INITDIR)/init.d/cups; \
275 $(RMDIR) $(BUILDROOT)$(INITDIR)/init.d; \
276 $(RM) $(BUILDROOT)$(INITDIR)/rc0.d/K00cups; \
277 $(RMDIR) $(BUILDROOT)$(INITDIR)/rc0.d; \
278 $(RM) $(BUILDROOT)$(INITDIR)/rc2.d/S99cups; \
279 $(RMDIR) $(BUILDROOT)$(INITDIR)/rc2.d; \
280 $(RM) $(BUILDROOT)$(INITDIR)/rc3.d/S99cups; \
281 $(RMDIR) $(BUILDROOT)$(INITDIR)/rc3.d; \
282 $(RM) $(BUILDROOT)$(INITDIR)/rc5.d/S99cups; \
283 $(RMDIR) $(BUILDROOT)$(INITDIR)/rc5.d; \
284 fi
285 if test "x$(INITDDIR)" != x; then \
286 echo Uninstalling startup script...; \
287 $(RM) $(BUILDROOT)$(INITDDIR)/cups.sh; \
288 $(RMDIR) $(BUILDROOT)$(INITDDIR); \
289 fi
290 if test "x$LAUNCHD_DIR" != x; then \
291 echo Uninstalling launchd files...; \
292 $(RM) $(BUILDROOT)$(LAUNCHD_DIR)/org.cups.cupsd.plist; \
293 $(RM) $(BUILDROOT)$(LAUNCHD_DIR)/org.cups.cups-lpd.plist; \
294 fi
295 if test "x$SYSTEMD_DIR" != x; then \
296 echo Uninstalling systemd files...; \
297 $(RM) $(BUILDROOT)$(SYSTEMD_DIR)/org.cups.cupsd.path; \
298 $(RM) $(BUILDROOT)$(SYSTEMD_DIR)/org.cups.cupsd.service; \
299 $(RM) $(BUILDROOT)$(SYSTEMD_DIR)/org.cups.cupsd.socket; \
300 fi
301 if test "x$(SMFMANIFESTDIR)" != x; then \
302 echo Uninstalling SMF manifest file...;\
303 $(RM) $(BUILDROOT)$(SMFMANIFESTDIR)/cups.xml; \
304 fi
305 if test "x$(XINETD)" != x; then \
306 echo Uninstalling xinetd configuration file for cups-lpd...; \
307 $(RM) $(BUILDROOT)$(XINETD)/cups-lpd; \
308 fi
309
310
311 #
312 # Make the scheduler executable, "cupsd".
313 #
314
315 cupsd: $(CUPSDOBJS) libcupsmime.a ../cups/$(LIBCUPS)
316 echo Linking $@...
317 $(LD_CC) $(LDFLAGS) -o cupsd $(CUPSDOBJS) libcupsmime.a \
318 $(LIBZ) $(SSLLIBS) $(LIBSLP) $(LIBLDAP) $(PAMLIBS) \
319 $(LIBPAPER) $(LIBMALLOC) $(SERVERLIBS) $(ONDEMANDLIBS) \
320 $(DNSSDLIBS) $(LIBS) $(LIBGSSAPI) $(LIBWRAP)
321 $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
322
323 cupsd-static: $(CUPSDOBJS) libcupsmime.a ../cups/$(LIBCUPSSTATIC)
324 echo Linking $@...
325 $(LD_CC) $(LDFLAGS) -o cupsd-static $(CUPSDOBJS) libcupsmime.a \
326 $(LIBZ) $(SSLLIBS) $(LIBSLP) $(LIBLDAP) $(PAMLIBS) \
327 ../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(LIBZ) $(LIBPAPER) \
328 $(LIBMALLOC) $(SERVERLIBS) $(ONDEMANDLIBS) $(DNSSDLIBS) \
329 $(LIBGSSAPI) $(LIBWRAP)
330 $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
331
332
333 #
334 # Make the cupsfilter utility.
335 #
336
337 cupsfilter: cupsfilter.o libcupsmime.a ../cups/$(LIBCUPS)
338 echo Linking $@...
339 $(LD_CC) $(LDFLAGS) -o cupsfilter cupsfilter.o libcupsmime.a $(LIBS)
340 $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
341 $(RM) convert
342 $(LN) cupsfilter convert
343
344 cupsfilter-static: cupsfilter.o libcupsmime.a ../cups/$(LIBCUPSSTATIC)
345 echo Linking $@...
346 $(LD_CC) $(LDFLAGS) -o cupsfilter-static cupsfilter.o libcupsmime.a \
347 ../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(LIBZ) $(SSLLIBS) \
348 $(DNSSDLIBS) $(LIBGSSAPI)
349 $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
350
351
352 #
353 # Make the device daemon, "cups-deviced".
354 #
355
356 cups-deviced: cups-deviced.o util.o ../cups/$(LIBCUPS)
357 echo Linking $@...
358 $(LD_CC) $(LDFLAGS) -o cups-deviced cups-deviced.o util.o $(LIBS)
359 $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
360
361
362 #
363 # Make the driver daemon, "cups-driverd".
364 #
365
366 cups-driverd: cups-driverd.o util.o ../cups/$(LIBCUPS) ../ppdc/libcupsppdc.a
367 echo Linking $@...
368 $(LD_CXX) $(LDFLAGS) -o cups-driverd cups-driverd.o util.o \
369 ../ppdc/libcupsppdc.a $(LIBS)
370 $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
371
372
373 #
374 # Make the sandbox execution helper, "cups-exec".
375 #
376
377 cups-exec: cups-exec.o
378 echo Linking $@...
379 $(LD_CC) $(LDFLAGS) -o cups-exec cups-exec.o $(LIBS)
380 $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
381
382
383 #
384 # Make the line printer daemon, "cups-lpd".
385 #
386
387 cups-lpd: cups-lpd.o ../cups/$(LIBCUPS)
388 echo Linking $@...
389 $(LD_CC) $(LDFLAGS) -o cups-lpd cups-lpd.o $(LIBS)
390 $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
391
392
393 #
394 # libcupsmime.a
395 #
396
397 libcupsmime.a: $(LIBOBJS)
398 echo Archiving $@...
399 $(RM) $@
400 $(AR) $(ARFLAGS) $@ $(LIBOBJS)
401 $(RANLIB) $@
402
403
404 #
405 # Make the test program, "testlpd".
406 #
407
408 testlpd: testlpd.o ../cups/$(LIBCUPSSTATIC) cups-lpd
409 echo Linking $@...
410 $(LD_CC) $(LDFLAGS) -o testlpd testlpd.o ../cups/$(LIBCUPSSTATIC) \
411 $(COMMONLIBS) $(LIBZ) $(SSLLIBS) $(DNSSDLIBS) $(LIBGSSAPI)
412
413
414 #
415 # testmime
416 #
417
418 testmime: testmime.o libcupsmime.a ../cups/$(LIBCUPSSTATIC)
419 echo Linking $@...
420 $(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testmime.o libcupsmime.a \
421 ../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(LIBZ) $(SSLLIBS) \
422 $(DNSSDLIBS) $(LIBGSSAPI)
423 $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
424 echo Running MIME tests...
425 ./testmime
426
427
428 #
429 # Make the test program, "testspeed".
430 #
431
432 testspeed: testspeed.o ../cups/$(LIBCUPSSTATIC)
433 echo Linking $@...
434 $(LD_CC) $(LDFLAGS) -o testspeed testspeed.o ../cups/$(LIBCUPSSTATIC) \
435 $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ) $(LIBGSSAPI)
436 $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
437
438
439 #
440 # Make the test program, "testsub".
441 #
442
443 testsub: testsub.o ../cups/$(LIBCUPSSTATIC)
444 echo Linking $@...
445 $(LD_CC) $(LDFLAGS) -o testsub testsub.o ../cups/$(LIBCUPSSTATIC) \
446 $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ) $(LIBGSSAPI)
447 $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
448
449
450 #
451 # Lines of code computation...
452 #
453
454 sloc:
455 echo "cupsd: \c"
456 sloccount $(CUPSDOBJS:.o=.c) $(LIBOBJS:.o=.c) cups-driverd.cxx cups-lpd.c 2>/dev/null | grep "Total Physical" | awk '{print $$9}'
457
458
459 #
460 # Dependencies...
461 #
462
463 include Dependencies