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