]> git.ipfire.org Git - thirdparty/cups.git/blame - backend/Makefile
Merge changes from CUPS 1.6svn-r10437.
[thirdparty/cups.git] / backend / Makefile
CommitLineData
ef416fc2 1#
b19ccc9e 2# "$Id: Makefile 7924 2008-09-10 17:36:13Z mike $"
ef416fc2 3#
f8b3a85b 4# Backend makefile for CUPS.
ef416fc2 5#
12f89d24 6# Copyright 2007-2012 by Apple Inc.
09a101d6 7# Copyright 1997-2007 by Easy Software Products, all rights reserved.
ef416fc2 8#
9# These coded instructions, statements, and computer programs are the
bc44d920 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/".
ef416fc2 14#
15# This file is subject to the Apple OS-Developed Software exception.
16#
17
18include ../Makedefs
19
f8b3a85b
MS
20#
21# Object files...
22#
23
f3c17241
MS
24# RBACKENDS are installed mode 0700 so cupsd will run them as root...
25#
26# UBACKENDS are installed mode 0755 so cupsd will run them as an unprivileged
27# user...
28#
29# See http://www.cups.org/documentation.php/api-filter.html for more info...
a4845881
MS
30RBACKENDS = \
31 ipp \
32 lpd \
33 $(DNSSD_BACKEND)
34UBACKENDS = \
35 snmp \
36 socket \
37 usb
38UNITTESTS = \
39 test1284 \
40 testbackend \
41 testsupplies
42TARGETS = \
43 libbackend.a \
44 $(RBACKENDS) \
45 $(UBACKENDS)
46LIBOBJS = \
47 ieee1284.o \
48 network.o \
49 runloop.o \
50 snmp-supplies.o
51OBJS = \
52 ipp.o \
53 lpd.o \
54 dnssd.o \
55 snmp.o \
56 socket.o \
57 test1284.o \
58 testbackend.o \
59 testsupplies.o \
60 usb.o
ef416fc2 61
62
63#
64# Make all targets...
65#
66
67all: $(TARGETS)
68
69
c9fc04c6
MS
70#
71# Make library targets...
72#
73
74libs:
75
76
5f64df29
MS
77#
78# Make unit tests...
79#
80
1340db2d 81unittests: $(UNITTESTS)
5f64df29
MS
82
83
ef416fc2 84#
85# Clean all object files...
86#
87
88clean:
a4845881 89 $(RM) $(OBJS) $(TARGETS) $(UNITTESTS) $(LIBOBJS) http https ipps mdns
ef416fc2 90
91
92#
93# Update dependencies (without system header dependencies...)
94#
95
96depend:
12f89d24 97 $(CC) -MM $(ALL_CFLAGS) $(OBJS:.o=.c) >Dependencies
ef416fc2 98
99
100#
101# Install all targets...
102#
103
50fe7201
MS
104install: all install-data install-headers install-libs install-exec
105
106
107#
108# Install data files...
109#
110
111install-data:
112
113
114#
115# Install programs...
116#
117
eac3a0a0
MS
118install-exec: $(INSTALLXPC)
119 echo Installing backends in $(SERVERBIN)/backend
bd7854cb 120 $(INSTALL_DIR) -m 755 $(SERVERBIN)/backend
e00b005a 121 for file in $(RBACKENDS); do \
839a51c8 122 $(LIBTOOL) $(INSTALL_BIN) -m 700 $$file $(SERVERBIN)/backend; \
e00b005a 123 done
124 for file in $(UBACKENDS); do \
ef416fc2 125 $(INSTALL_BIN) $$file $(SERVERBIN)/backend; \
126 done
eac3a0a0
MS
127 for file in $(IPPALIASES); do \
128 $(RM) $(SERVERBIN)/backend/$$file; \
129 $(LN) ipp $(SERVERBIN)/backend/$$file; \
130 done
49d87452
MS
131 if test "x$(DNSSD_BACKEND)" != x; then \
132 $(RM) $(SERVERBIN)/backend/mdns; \
133 $(LN) $(DNSSD_BACKEND) $(SERVERBIN)/backend/mdns; \
134 fi
09a101d6 135 if test "x$(SYMROOT)" != "x"; then \
136 $(INSTALL_DIR) $(SYMROOT); \
137 for file in $(TARGETS); do \
138 cp $$file $(SYMROOT); \
139 done \
140 fi
ef416fc2 141
eac3a0a0
MS
142install-xpc: ipp
143 echo Installing XPC backends in $(SERVERBIN)/apple
144 $(INSTALL_DIR) -m 755 $(SERVERBIN)/apple
145 $(LIBTOOL) $(INSTALL_BIN) ipp $(SERVERBIN)/apple
146 for file in $(IPPALIASES); do \
147 $(RM) $(SERVERBIN)/apple/$$file; \
148 $(LN) ipp $(SERVERBIN)/apple/$$file; \
149 done
150
ef416fc2 151
50fe7201
MS
152#
153# Install headers...
154#
155
156install-headers:
157
158
159#
160# Install libraries...
161#
162
163install-libs:
164
165
757d2cad 166#
167# Uninstall all targets...
168#
169
170uninstall:
eac3a0a0
MS
171 $(RM) $(SERVERBIN)/apple/ipp
172 for file in $(IPPALIASES); do \
173 $(RM) $(SERVERBIN)/apple/$$file; \
174 done
175 -$(RMDIR) $(SERVERBIN)/apple
757d2cad 176 for file in $(RBACKENDS) $(UBACKENDS); do \
177 $(RM) $(SERVERBIN)/backend/$$file; \
178 done
eac3a0a0
MS
179 for file in $(IPPALIASES); do \
180 $(RM) $(SERVERBIN)/backend/$$file; \
181 done
757d2cad 182 -$(RMDIR) $(SERVERBIN)/backend
183 -$(RMDIR) $(SERVERBIN)
184
185
ef416fc2 186#
568fa3fa 187# test1284
ef416fc2 188#
189
f8b3a85b 190test1284: test1284.o ../cups/$(LIBCUPSSTATIC)
ef416fc2 191 echo Linking $@...
f8b3a85b 192 $(CC) $(LDFLAGS) -o test1284 test1284.o ../cups/$(LIBCUPSSTATIC) \
c168a833 193 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 194
195
196#
568fa3fa 197# testbackend
ef416fc2 198#
199
f8b3a85b 200testbackend: testbackend.o ../cups/$(LIBCUPSSTATIC)
ef416fc2 201 echo Linking $@...
f8b3a85b 202 $(CC) $(LDFLAGS) -o testbackend testbackend.o ../cups/$(LIBCUPSSTATIC) \
c168a833 203 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 204
205
568fa3fa
MS
206#
207# testsupplies
208#
209
f8b3a85b 210testsupplies: testsupplies.o libbackend.a ../cups/$(LIBCUPSSTATIC)
568fa3fa
MS
211 echo Linking $@...
212 $(CC) $(LDFLAGS) -o testsupplies testsupplies.o libbackend.a \
f8b3a85b 213 ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
c168a833 214 $(COMMONLIBS) $(LIBZ)
568fa3fa
MS
215
216
ed486911 217#
218# libbackend.a
219#
220
221libbackend.a: $(LIBOBJS)
222 echo Archiving $@...
223 $(RM) $@
224 $(AR) $(ARFLAGS) $@ $(LIBOBJS)
225 $(RANLIB) $@
226
227
c5571a1d
MS
228#
229# dnssd
230#
231
232dnssd: dnssd.o ../cups/$(LIBCUPS) libbackend.a
233 echo Linking $@...
234 $(CC) $(LDFLAGS) -o dnssd dnssd.o libbackend.a $(LIBS)
235 $(RM) mdns
236 $(LN) dnssd mdns
237
238
ef416fc2 239#
240# ipp
241#
242
7a14d768 243ipp: ipp.o ../cups/$(LIBCUPS) libbackend.a
ef416fc2 244 echo Linking $@...
7a14d768 245 $(CC) $(LDFLAGS) -o ipp ipp.o libbackend.a $(LIBS)
ef416fc2 246 $(RM) http
247 $(LN) ipp http
248
249
250#
251# lpd
252#
253
7a14d768 254lpd: lpd.o ../cups/$(LIBCUPS) libbackend.a
ef416fc2 255 echo Linking $@...
7a14d768
MS
256 $(CC) $(LDFLAGS) -o lpd lpd.o libbackend.a $(LIBS)
257
258
89d46774 259#
260# snmp
261#
262
ed486911 263snmp: snmp.o ../cups/$(LIBCUPS) libbackend.a
89d46774 264 echo Linking $@...
ed486911 265 $(CC) $(LDFLAGS) -o snmp snmp.o libbackend.a $(LIBS)
89d46774 266
267
ef416fc2 268#
269# socket
270#
271
ed486911 272socket: socket.o ../cups/$(LIBCUPS) libbackend.a
ef416fc2 273 echo Linking $@...
ed486911 274 $(CC) $(LDFLAGS) -o socket socket.o libbackend.a $(LIBS)
ef416fc2 275
276
277#
278# usb
279#
280
ed486911 281usb: usb.o ../cups/$(LIBCUPS) libbackend.a
ef416fc2 282 echo Linking $@...
bb0d23b2 283 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o usb usb.o libbackend.a $(LIBUSB) \
9a4f8274 284 $(BACKLIBS) $(LIBS)
75bd9771 285usb.o: usb.c usb-darwin.c usb-libusb.c usb-unix.c
ef416fc2 286
287
288#
289# Dependencies...
290#
291
292include Dependencies
293
294
295#
b19ccc9e 296# End of "$Id: Makefile 7924 2008-09-10 17:36:13Z mike $".
ef416fc2 297#