]> git.ipfire.org Git - thirdparty/cups.git/blob - backend/Makefile
Changelog.
[thirdparty/cups.git] / backend / Makefile
1 #
2 # "$Id$"
3 #
4 # Backend makefile for CUPS.
5 #
6 # Copyright 2007-2012 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 # This file is subject to the Apple OS-Developed Software exception.
16 #
17
18 include ../Makedefs
19
20 #
21 # Object files...
22 #
23
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...
30 RBACKENDS = \
31 ipp \
32 lpd \
33 $(DNSSD_BACKEND)
34 UBACKENDS = \
35 snmp \
36 socket \
37 usb
38 UNITTESTS = \
39 test1284 \
40 testbackend \
41 testsupplies
42 TARGETS = \
43 libbackend.a \
44 $(RBACKENDS) \
45 $(UBACKENDS)
46 LIBOBJS = \
47 ieee1284.o \
48 network.o \
49 runloop.o \
50 snmp-supplies.o
51 OBJS = \
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
61
62
63 #
64 # Make all targets...
65 #
66
67 all: $(TARGETS)
68
69
70 #
71 # Make library targets...
72 #
73
74 libs:
75
76
77 #
78 # Make unit tests...
79 #
80
81 unittests: $(UNITTESTS)
82
83
84 #
85 # Clean all object files...
86 #
87
88 clean:
89 $(RM) $(OBJS) $(TARGETS) $(UNITTESTS) $(LIBOBJS) http https ipps mdns
90
91
92 #
93 # Update dependencies (without system header dependencies...)
94 #
95
96 depend:
97 $(CC) -MM $(ALL_CFLAGS) $(OBJS:.o=.c) >Dependencies
98
99
100 #
101 # Install all targets...
102 #
103
104 install: all install-data install-headers install-libs install-exec
105
106
107 #
108 # Install data files...
109 #
110
111 install-data:
112
113
114 #
115 # Install programs...
116 #
117
118 install-exec: $(INSTALLXPC)
119 echo Installing backends in $(SERVERBIN)/backend
120 $(INSTALL_DIR) -m 755 $(SERVERBIN)/backend
121 for file in $(RBACKENDS); do \
122 $(LIBTOOL) $(INSTALL_BIN) -m 700 $$file $(SERVERBIN)/backend; \
123 done
124 for file in $(UBACKENDS); do \
125 $(INSTALL_BIN) $$file $(SERVERBIN)/backend; \
126 done
127 for file in $(IPPALIASES); do \
128 $(RM) $(SERVERBIN)/backend/$$file; \
129 $(LN) ipp $(SERVERBIN)/backend/$$file; \
130 done
131 if test "x$(DNSSD_BACKEND)" != x -a `uname` = Darwin; then \
132 $(RM) $(SERVERBIN)/backend/mdns; \
133 $(LN) $(DNSSD_BACKEND) $(SERVERBIN)/backend/mdns; \
134 fi
135 if test "x$(SYMROOT)" != "x"; then \
136 $(INSTALL_DIR) $(SYMROOT); \
137 for file in $(RBACKENDS) $(UBACKENDS); do \
138 cp $$file $(SYMROOT); \
139 dsymutil $(SYMROOT)/$$file; \
140 done \
141 fi
142
143 install-xpc: ipp
144 echo Installing XPC backends in $(SERVERBIN)/apple
145 $(INSTALL_DIR) -m 755 $(SERVERBIN)/apple
146 $(LIBTOOL) $(INSTALL_BIN) ipp $(SERVERBIN)/apple
147 for file in $(IPPALIASES); do \
148 $(RM) $(SERVERBIN)/apple/$$file; \
149 $(LN) ipp $(SERVERBIN)/apple/$$file; \
150 done
151
152
153 #
154 # Install headers...
155 #
156
157 install-headers:
158
159
160 #
161 # Install libraries...
162 #
163
164 install-libs:
165
166
167 #
168 # Uninstall all targets...
169 #
170
171 uninstall:
172 $(RM) $(SERVERBIN)/apple/ipp
173 for file in $(IPPALIASES); do \
174 $(RM) $(SERVERBIN)/apple/$$file; \
175 done
176 -$(RMDIR) $(SERVERBIN)/apple
177 for file in $(RBACKENDS) $(UBACKENDS); do \
178 $(RM) $(SERVERBIN)/backend/$$file; \
179 done
180 for file in $(IPPALIASES); do \
181 $(RM) $(SERVERBIN)/backend/$$file; \
182 done
183 -$(RMDIR) $(SERVERBIN)/backend
184 -$(RMDIR) $(SERVERBIN)
185
186
187 #
188 # test1284
189 #
190
191 test1284: test1284.o ../cups/$(LIBCUPSSTATIC)
192 echo Linking $@...
193 $(CC) $(LDFLAGS) -o test1284 test1284.o ../cups/$(LIBCUPSSTATIC) \
194 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
195
196
197 #
198 # testbackend
199 #
200
201 testbackend: testbackend.o ../cups/$(LIBCUPSSTATIC)
202 echo Linking $@...
203 $(CC) $(LDFLAGS) -o testbackend testbackend.o ../cups/$(LIBCUPSSTATIC) \
204 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
205
206
207 #
208 # testsupplies
209 #
210
211 testsupplies: testsupplies.o libbackend.a ../cups/$(LIBCUPSSTATIC)
212 echo Linking $@...
213 $(CC) $(LDFLAGS) -o testsupplies testsupplies.o libbackend.a \
214 ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
215 $(COMMONLIBS) $(LIBZ)
216
217
218 #
219 # libbackend.a
220 #
221
222 libbackend.a: $(LIBOBJS)
223 echo Archiving $@...
224 $(RM) $@
225 $(AR) $(ARFLAGS) $@ $(LIBOBJS)
226 $(RANLIB) $@
227
228
229 #
230 # dnssd
231 #
232
233 dnssd: dnssd.o ../cups/$(LIBCUPS) libbackend.a
234 echo Linking $@...
235 $(CC) $(LDFLAGS) -o dnssd dnssd.o libbackend.a $(LIBS)
236 if test `uname` = Darwin; then \
237 $(RM) mdns; \
238 $(LN) dnssd mdns; \
239 fi
240
241
242 #
243 # ipp
244 #
245
246 ipp: ipp.o ../cups/$(LIBCUPS) libbackend.a
247 echo Linking $@...
248 $(CC) $(LDFLAGS) -o ipp ipp.o libbackend.a $(LIBS)
249 $(RM) http
250 $(LN) ipp http
251
252
253 #
254 # lpd
255 #
256
257 lpd: lpd.o ../cups/$(LIBCUPS) libbackend.a
258 echo Linking $@...
259 $(CC) $(LDFLAGS) -o lpd lpd.o libbackend.a $(LIBS)
260
261
262 #
263 # snmp
264 #
265
266 snmp: snmp.o ../cups/$(LIBCUPS) libbackend.a
267 echo Linking $@...
268 $(CC) $(LDFLAGS) -o snmp snmp.o libbackend.a $(LIBS)
269
270
271 #
272 # socket
273 #
274
275 socket: socket.o ../cups/$(LIBCUPS) libbackend.a
276 echo Linking $@...
277 $(CC) $(LDFLAGS) -o socket socket.o libbackend.a $(LIBS)
278
279
280 #
281 # usb
282 #
283
284 usb: usb.o ../cups/$(LIBCUPS) libbackend.a
285 echo Linking $@...
286 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o usb usb.o libbackend.a $(LIBUSB) \
287 $(BACKLIBS) $(LIBS)
288 usb.o: usb.c usb-darwin.c usb-libusb.c usb-unix.c
289
290
291 #
292 # Dependencies...
293 #
294
295 include Dependencies
296
297
298 #
299 # End of "$Id$".
300 #