2
# "$Id: Makefile 10996 2013-05-29 11:51:34Z msweet $"
4
# Scheduler Makefile for CUPS.
6
# Copyright 2007-2012 by Apple Inc.
7
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
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/".
97
# Make library targets...
107
unittests: $(UNITTARGETS)
111
# Clean all object files...
116
$(RM) $(TARGETS) $(UNITTARGETS) convert
117
$(RM) libcupsmime.so libcupsmime.sl libcupsmime.dylib
121
# Update dependencies (without system header dependencies...)
125
$(CC) -MM $(ALL_CFLAGS) $(COBJS:.o=.c) >Dependencies
126
$(CXX) -MM $(ALL_CXXFLAGS) $(CXXOBJS:.o=.cxx) >>Dependencies
130
# Run oclint to check code coverage...
134
oclint -o=oclint.html -html $(CUPSDOBJS:.o=.c) $(LIBOBJS:.o=.c) -- $(ALL_CFLAGS)
138
# Install all targets...
141
install: all install-data install-headers install-libs install-exec
145
# Install data files...
149
echo Creating $(SERVERBIN)/driver...
150
$(INSTALL_DIR) -m 755 $(SERVERBIN)/driver
151
echo Creating $(SERVERROOT)...
152
$(INSTALL_DIR) -m 755 -g $(CUPS_GROUP) $(SERVERROOT)
153
echo Creating $(SERVERROOT)/interfaces...
154
$(INSTALL_DIR) -m 755 -g $(CUPS_GROUP) $(SERVERROOT)/interfaces
155
echo Creating $(SERVERROOT)/ppd...
156
$(INSTALL_DIR) -m 755 -g $(CUPS_GROUP) $(SERVERROOT)/ppd
157
if test "x`uname`" != xDarwin; then \
158
echo Creating $(SERVERROOT)/ssl...; \
159
$(INSTALL_DIR) -m 700 -g $(CUPS_GROUP) $(SERVERROOT)/ssl; \
161
if test "$(STATEDIR)" != "$(SERVERROOT)"; then \
162
echo Creating $(STATEDIR)...; \
163
$(INSTALL_DIR) -m 755 $(STATEDIR); \
165
echo Creating $(STATEDIR)/certs...
166
$(INSTALL_DIR) -m 511 -o $(CUPS_USER) -g $(CUPS_PRIMARY_SYSTEM_GROUP) \
168
echo Creating $(LOGDIR)...
169
$(INSTALL_DIR) -m 755 $(LOGDIR)
170
echo Creating $(REQUESTS)...
171
$(INSTALL_DIR) -m 710 -g $(CUPS_GROUP) $(REQUESTS)
172
echo Creating $(REQUESTS)/tmp...
173
$(INSTALL_DIR) -m 1770 -g $(CUPS_GROUP) $(REQUESTS)/tmp
174
echo Creating $(CACHEDIR)...
175
$(INSTALL_DIR) -m 775 -g $(CUPS_GROUP) $(CACHEDIR)
176
if test "x$(INITDIR)" != x; then \
177
echo Installing init scripts...; \
178
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/init.d; \
179
$(INSTALL_SCRIPT) cups.sh $(BUILDROOT)$(INITDIR)/init.d/cups; \
180
for level in $(RCLEVELS); do \
181
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc$${level}.d; \
182
$(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/S$(RCSTART)cups; \
183
if test `uname` = HP-UX; then \
184
level=`expr $$level - 1`; \
185
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc$${level}.d; \
187
$(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/K$(RCSTOP)cups; \
189
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc0.d; \
190
$(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc0.d/K$(RCSTOP)cups; \
192
if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \
193
$(INSTALL_DIR) $(BUILDROOT)$(INITDDIR); \
194
if test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
195
echo Installing LaunchDaemons configuration files...; \
196
$(INSTALL_DATA) org.cups.cupsd.plist $(BUILDROOT)$(DEFAULT_LAUNCHD_CONF); \
197
$(INSTALL_DATA) org.cups.cups-lpd.plist $(BUILDROOT)/System/Library/LaunchDaemons; \
199
echo Installing RC script...; \
200
$(INSTALL_SCRIPT) cups.sh $(BUILDROOT)$(INITDDIR)/cups; \
203
if test "x$(SMFMANIFESTDIR)" != x; then \
204
echo Installing SMF manifest in $(SMFMANIFESTDIR)...;\
205
$(INSTALL_DIR) $(BUILDROOT)/$(SMFMANIFESTDIR); \
206
$(INSTALL_SCRIPT) cups.xml $(BUILDROOT)$(SMFMANIFESTDIR)/cups.xml; \
208
if test "x$(XINETD)" != x; then \
209
echo Installing xinetd configuration file for cups-lpd...; \
210
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(XINETD); \
211
$(INSTALL_DATA) cups-lpd.xinetd $(BUILDROOT)$(XINETD)/cups-lpd; \
216
# Install programs...
220
echo Installing programs in $(SBINDIR)...
221
$(INSTALL_DIR) -m 755 $(SBINDIR)
222
$(INSTALL_BIN) -m $(CUPS_CUPSD_FILE_PERM) cupsd $(SBINDIR)
223
$(INSTALL_BIN) cupsfilter $(SBINDIR)
224
echo Installing programs in $(SERVERBIN)/daemon...
225
$(INSTALL_DIR) -m 755 $(SERVERBIN)
226
$(INSTALL_DIR) -m 755 $(SERVERBIN)/daemon
227
$(INSTALL_BIN) cups-deviced $(SERVERBIN)/daemon
228
$(INSTALL_BIN) cups-driverd $(SERVERBIN)/daemon
229
$(INSTALL_BIN) cups-exec $(SERVERBIN)/daemon
230
$(INSTALL_BIN) cups-lpd $(SERVERBIN)/daemon
231
if test "x$(SYMROOT)" != "x"; then \
232
$(INSTALL_DIR) $(SYMROOT); \
233
for file in $(PROGRAMS); do \
234
cp $$file $(SYMROOT); \
235
dsymutil $(SYMROOT)/$$file; \
245
echo Installing header files in $(INCLUDEDIR)/cups...
246
$(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups
247
$(INSTALL_DATA) mime.h $(INCLUDEDIR)/cups
251
# Install libraries...
254
install-libs: $(INSTALLSTATIC)
255
echo Installing libraries in $(LIBDIR)...
256
$(INSTALL_DIR) -m 755 $(LIBDIR)
257
$(INSTALL_LIB) $(LIBCUPSMIME) $(LIBDIR)
258
if test $(LIBCUPSMIME) = "libcupsmime.so.1" -o $(LIBCUPSMIME) = "libcupsmime.sl.1"; then \
259
$(RM) $(LIBDIR)/`basename $(LIBCUPSMIME) .1`; \
260
$(LN) $(LIBCUPSMIME) $(LIBDIR)/`basename $(LIBCUPSMIME) .1`; \
262
if test $(LIBCUPSMIME) = "libcupsmime.1.dylib"; then \
263
$(RM) $(LIBDIR)/libcupsmime.dylib; \
264
$(LN) $(LIBCUPSMIME) $(LIBDIR)/libcupsmime.dylib; \
266
if test "x$(SYMROOT)" != "x"; then \
267
$(INSTALL_DIR) $(SYMROOT); \
268
cp $(LIBCUPSMIME) $(SYMROOT); \
269
dsymutil $(SYMROOT)/$(LIBCUPSMIME); \
273
$(INSTALL_DIR) -m 755 $(LIBDIR)
274
$(INSTALL_LIB) -m 755 libcupsmime.a $(LIBDIR)
275
$(RANLIB) $(LIBDIR)/libcupsmime.a
276
$(CHMOD) 555 $(LIBDIR)/libcupsmime.a
280
# Uninstall the scheduler...
284
$(RM) $(SBINDIR)/cupsd
285
$(RM) $(SBINDIR)/cupsfilter
286
$(RM) $(SERVERBIN)/daemon/cups-deviced
287
$(RM) $(SERVERBIN)/daemon/cups-driverd
288
$(RM) $(SERVERBIN)/daemon/cups-exec
289
$(RM) $(SERVERBIN)/daemon/cups-lpd
290
$(RM) $(BUILDROOT)/System/Library/Printers/Libraries/convert
291
-$(RMDIR) $(STATEDIR)/certs
292
-$(RMDIR) $(STATEDIR)
293
-$(RMDIR) $(SERVERROOT)/ppd
294
-$(RMDIR) $(SERVERROOT)/interfaces
295
-$(RMDIR) $(SERVERROOT)
296
-$(RMDIR) $(SERVERBIN)/driver
297
-$(RMDIR) $(SERVERBIN)/daemon
298
-$(RMDIR) $(SERVERBIN)
300
-$(RMDIR) $(REQUESTS)/tmp
301
-$(RMDIR) $(REQUESTS)
303
-$(RMDIR) $(CACHEDIR)
304
$(RM) $(LIBDIR)/libcupsmime.1.dylib
305
$(RM) $(LIBDIR)/libcupsmime.a
306
$(RM) $(LIBDIR)/libcupsmime.dylib
307
$(RM) $(LIBDIR)/libcupsmime_s.a
308
$(RM) $(LIBDIR)/libcupsmime.sl
309
$(RM) $(LIBDIR)/libcupsmime.sl.1
310
$(RM) $(LIBDIR)/libcupsmime.so
311
$(RM) $(LIBDIR)/libcupsmime.so.1
313
$(RM) $(INCLUDEDIR)/cups/mime.h
314
-$(RMDIR) $(INCLUDEDIR)/cups
315
echo Uninstalling startup script...
316
if test "x$(INITDIR)" != x; then \
317
$(RM) $(BUILDROOT)$(INITDIR)/init.d/cups; \
318
$(RMDIR) $(BUILDROOT)$(INITDIR)/init.d; \
319
$(RM) $(BUILDROOT)$(INITDIR)/rc0.d/K00cups; \
320
$(RMDIR) $(BUILDROOT)$(INITDIR)/rc0.d; \
321
$(RM) $(BUILDROOT)$(INITDIR)/rc2.d/S99cups; \
322
$(RMDIR) $(BUILDROOT)$(INITDIR)/rc2.d; \
323
$(RM) $(BUILDROOT)$(INITDIR)/rc3.d/S99cups; \
324
$(RMDIR) $(BUILDROOT)$(INITDIR)/rc3.d; \
325
$(RM) $(BUILDROOT)$(INITDIR)/rc5.d/S99cups; \
326
$(RMDIR) $(BUILDROOT)$(INITDIR)/rc5.d; \
328
if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \
329
if test "$(INITDDIR)" = "/System/Library/StartupItems/PrintingServices"; then \
330
$(RM) $(BUILDROOT)$(INITDDIR)/PrintingServices; \
331
$(RM) $(BUILDROOT)$(INITDDIR)/StartupParameters.plist; \
332
$(RM) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj/Localizable.strings; \
333
$(RMDIR) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \
334
elif test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
335
$(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cupsd.plist; \
336
$(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cups-lpd.plist; \
337
$(RMDIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices; \
339
$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \
341
$(RMDIR) $(BUILDROOT)$(INITDDIR); \
343
if test "x$(SMFMANIFESTDIR)" != x; then \
344
echo Uninstalling SMF manifest in $(SMFMANIFESTDIR)...;\
345
$(RM) $(BUILDROOT)$(SMFMANIFESTDIR)/cups.xml; \
347
if test "x$(XINETD)" != x; then \
348
echo Uninstalling xinetd configuration file for cups-lpd...; \
349
$(RM) $(BUILDROOT)$(XINETD)/cups-lpd; \
354
# Automatic API help files...
358
mxmldoc --section "Programming" \
360
--css ../doc/cups-printable.css \
361
--header api-mime.header --intro api-mime.shtml \
362
mime.h $(LIBOBJS:.o=.c) >../doc/help/api-mime.html
363
mxmldoc --tokens help/api-mime.html api-mime.xml >../doc/help/api-mime.tokens
367
mxmldoc --framed api-mime \
368
--section "Programming" \
370
--css ../doc/cups-printable.css \
371
--header api-mime.header --intro api-mime.shtml \
372
mime.h $(LIBOBJS:.o=.c)
376
# Make the scheduler executable, "cupsd".
379
cupsd: $(CUPSDOBJS) $(LIBCUPSMIME) ../cups/$(LIBCUPS)
381
$(CC) $(LDFLAGS) -o cupsd $(CUPSDOBJS) -L. -lcupsmime \
382
$(LIBZ) $(SSLLIBS) $(LIBSLP) $(LIBLDAP) $(PAMLIBS) \
383
$(LIBPAPER) $(LIBMALLOC) $(SERVERLIBS) $(DNSSDLIBS) $(LIBS) \
384
$(LIBGSSAPI) $(LIBWRAP)
386
cupsd-static: $(CUPSDOBJS) libcupsmime.a ../cups/$(LIBCUPSSTATIC)
388
$(CC) $(LDFLAGS) -o cupsd-static $(CUPSDOBJS) libcupsmime.a \
389
$(LIBZ) $(SSLLIBS) $(LIBSLP) $(LIBLDAP) $(PAMLIBS) \
390
../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(LIBZ) $(LIBPAPER) \
391
$(LIBMALLOC) $(SERVERLIBS) $(DNSSDLIBS) $(LIBGSSAPI) \
394
tls.o: tls-darwin.c tls-gnutls.c tls-openssl.c
398
# Make the cupsfilter utility.
401
cupsfilter: cupsfilter.o $(LIBCUPSMIME) ../cups/$(LIBCUPS)
403
$(CC) $(LDFLAGS) -o cupsfilter cupsfilter.o -L. -lcupsmime $(LIBS)
405
$(LN) cupsfilter convert
409
# Make the device daemon, "cups-deviced".
412
cups-deviced: cups-deviced.o util.o ../cups/$(LIBCUPS)
414
$(CC) $(LDFLAGS) -o cups-deviced cups-deviced.o util.o $(LIBS)
418
# Make the driver daemon, "cups-driverd".
421
cups-driverd: cups-driverd.o util.o ../cups/$(LIBCUPS) ../ppdc/$(LIBCUPSPPDC)
423
$(CXX) $(LDFLAGS) -o cups-driverd cups-driverd.o util.o \
424
-L../ppdc -lcupsppdc $(LIBS)
428
# Make the sandbox execution helper, "cups-exec".
431
cups-exec: cups-exec.o
433
$(CC) $(LDFLAGS) -o cups-exec cups-exec.o $(LIBS)
437
# Make the line printer daemon, "cups-lpd".
440
cups-lpd: cups-lpd.o ../cups/$(LIBCUPS)
442
$(CC) $(LDFLAGS) -o cups-lpd cups-lpd.o $(LIBS)
446
# libcupsmime.so.1, libcupsmime.sl.1
449
libcupsmime.so.1 libcupsmime.sl.1: $(LIBOBJS)
451
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBS)
452
$(RM) `basename $@ .1`
453
$(LN) $@ `basename $@ .1`
457
# libcupsmime.1.dylib
460
libcupsmime.1.dylib: $(LIBOBJS) libcupsmime.exp
462
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
463
-install_name $(libdir)/$@ \
464
-current_version 1.0.0 \
465
-compatibility_version 1.0.0 \
466
-exported_symbols_list libcupsmime.exp \
468
$(RM) libcupsmime.dylib
469
$(LN) $@ libcupsmime.dylib
476
libcupsmime_s.a: $(LIBOBJS)
478
$(DSO) $(DSOFLAGS) -o libcupsmime_s.o $(LIBOBJS) $(LIBS)
480
$(AR) $(ARFLAGS) $@ libcupsmime_s.o
487
libcupsmime.la: $(LIBOBJS)
489
$(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
490
-version-info 1:0 $(LIBS)
497
libcupsmime.a: $(LIBOBJS)
500
$(AR) $(ARFLAGS) $@ $(LIBOBJS)
505
# Make the test program, "testlpd".
508
testlpd: testlpd.o ../cups/$(LIBCUPSSTATIC) cups-lpd
510
$(CC) $(LDFLAGS) -o testlpd testlpd.o ../cups/$(LIBCUPSSTATIC) \
511
$(COMMONLIBS) $(LIBZ) $(SSLLIBS) $(DNSSDLIBS) $(LIBGSSAPI)
518
testmime: testmime.o libcupsmime.a ../cups/$(LIBCUPSSTATIC)
520
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testmime.o libcupsmime.a \
521
../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(LIBZ) $(SSLLIBS) \
522
$(DNSSDLIBS) $(LIBGSSAPI)
523
echo Running MIME tests...
528
# Make the test program, "testspeed".
531
testspeed: testspeed.o ../cups/$(LIBCUPSSTATIC)
533
$(CC) $(LDFLAGS) -o testspeed testspeed.o ../cups/$(LIBCUPSSTATIC) \
534
$(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ) $(LIBGSSAPI)
538
# Make the test program, "testsub".
541
testsub: testsub.o ../cups/$(LIBCUPSSTATIC)
543
$(CC) $(LDFLAGS) -o testsub testsub.o ../cups/$(LIBCUPSSTATIC) \
544
$(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ) $(LIBGSSAPI)
548
# Lines of code computation...
553
sloccount $(CUPSDOBJS:.o=.c) $(LIBOBJS:.o=.c) cups-driverd.cxx cups-lpd.c 2>/dev/null | grep "Total Physical" | awk '{print $$9}'
564
# End of "$Id: Makefile 10996 2013-05-29 11:51:34Z msweet $".