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