Revert manifest to default one
[external/cups.git] / backend / Makefile
1 #
2 # "$Id: Makefile 10425 2012-04-23 17:42:12Z mike $"
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 =     ipp ipp14 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 ipp14.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 744 $$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 -a `uname` = Darwin; 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 # ipp14
222 #
223
224 ipp14:  ipp14.o ../cups/$(LIBCUPS) libbackend.a
225         echo Linking $@...
226         $(CC) $(LDFLAGS) -o ipp14 ipp14.o libbackend.a $(LIBS)
227         #$(RM) http
228         #$(LN) ipp14 http
229
230
231 #
232 # lpd
233 #
234
235 lpd:    lpd.o ../cups/$(LIBCUPS) libbackend.a
236         echo Linking $@...
237         $(CC) $(LDFLAGS) -o lpd lpd.o libbackend.a $(LIBS)
238
239
240 #
241 # parallel
242 #
243
244 parallel:       parallel.o ../cups/$(LIBCUPS) libbackend.a
245         echo Linking $@...
246         $(CC) $(LDFLAGS) -o parallel parallel.o libbackend.a $(LIBS)
247
248
249 #
250 # serial
251 #
252
253 serial: serial.o ../cups/$(LIBCUPS) libbackend.a
254         echo Linking $@...
255         $(CC) $(LDFLAGS) -o serial serial.o libbackend.a $(BACKLIBS) $(LIBS)
256
257
258 #
259 # snmp
260 #
261
262 snmp:   snmp.o ../cups/$(LIBCUPS) libbackend.a
263         echo Linking $@...
264         $(CC) $(LDFLAGS) -o snmp snmp.o libbackend.a $(LIBS)
265
266
267 #
268 # socket
269 #
270
271 socket: socket.o ../cups/$(LIBCUPS) libbackend.a
272         echo Linking $@...
273         $(CC) $(LDFLAGS) -o socket socket.o libbackend.a $(LIBS)
274
275
276 #
277 # usb
278 #
279
280 usb:    usb.o ../cups/$(LIBCUPS) libbackend.a
281         echo Linking $@...
282         $(CC) $(ARCHFLAGS) $(LDFLAGS) -o usb usb.o libbackend.a $(LIBUSB) \
283                 $(BACKLIBS) $(LIBS)
284 usb.o:  usb.c usb-darwin.c usb-libusb.c usb-unix.c
285
286
287 #
288 # Dependencies...
289 #
290
291 include Dependencies
292
293
294 #
295 # End of "$Id: Makefile 10425 2012-04-23 17:42:12Z mike $".
296 #