]> git.ipfire.org Git - thirdparty/cups.git/blob - backend/Makefile
Merge changes from CUPS 1.5svn-r9313.
[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-2010 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:
89 $(INSTALL_DIR) -m 755 $(SERVERBIN)/backend
90 for file in $(RBACKENDS); do \
91 $(LIBTOOL) $(INSTALL_BIN) -m 700 $$file $(SERVERBIN)/backend; \
92 done
93 for file in $(UBACKENDS); do \
94 $(INSTALL_BIN) $$file $(SERVERBIN)/backend; \
95 done
96 $(RM) $(SERVERBIN)/backend/http
97 $(LN) ipp $(SERVERBIN)/backend/http
98 if test "x$(DNSSD_BACKEND)" != x; then \
99 $(RM) $(SERVERBIN)/backend/mdns; \
100 $(LN) $(DNSSD_BACKEND) $(SERVERBIN)/backend/mdns; \
101 fi
102 if test "x$(SYMROOT)" != "x"; then \
103 $(INSTALL_DIR) $(SYMROOT); \
104 for file in $(TARGETS); do \
105 cp $$file $(SYMROOT); \
106 done \
107 fi
108
109
110 #
111 # Install headers...
112 #
113
114 install-headers:
115
116
117 #
118 # Install libraries...
119 #
120
121 install-libs:
122
123
124 #
125 # Uninstall all targets...
126 #
127
128 uninstall:
129 for file in $(RBACKENDS) $(UBACKENDS); do \
130 $(RM) $(SERVERBIN)/backend/$$file; \
131 done
132 $(RM) $(SERVERBIN)/backend/http
133 -$(RMDIR) $(SERVERBIN)/backend
134 -$(RMDIR) $(SERVERBIN)
135
136
137 #
138 # test1284
139 #
140
141 test1284: test1284.o ../cups/$(LIBCUPSSTATIC)
142 echo Linking $@...
143 $(CC) $(LDFLAGS) -o test1284 test1284.o ../cups/$(LIBCUPSSTATIC) \
144 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
145
146
147 #
148 # testbackend
149 #
150
151 testbackend: testbackend.o ../cups/$(LIBCUPSSTATIC)
152 echo Linking $@...
153 $(CC) $(LDFLAGS) -o testbackend testbackend.o ../cups/$(LIBCUPSSTATIC) \
154 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
155
156
157 #
158 # testsupplies
159 #
160
161 testsupplies: testsupplies.o libbackend.a ../cups/$(LIBCUPSSTATIC)
162 echo Linking $@...
163 $(CC) $(LDFLAGS) -o testsupplies testsupplies.o libbackend.a \
164 ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
165 $(COMMONLIBS) $(LIBZ)
166
167
168 #
169 # libbackend.a
170 #
171
172 libbackend.a: $(LIBOBJS)
173 echo Archiving $@...
174 $(RM) $@
175 $(AR) $(ARFLAGS) $@ $(LIBOBJS)
176 $(RANLIB) $@
177
178
179 #
180 # dnssd
181 #
182
183 dnssd: dnssd.o ../cups/$(LIBCUPS) libbackend.a
184 echo Linking $@...
185 $(CC) $(LDFLAGS) -o dnssd dnssd.o libbackend.a $(LIBS)
186 $(RM) mdns
187 $(LN) dnssd mdns
188
189
190 #
191 # ipp
192 #
193
194 ipp: ipp.o ../cups/$(LIBCUPS) libbackend.a
195 echo Linking $@...
196 $(CC) $(LDFLAGS) -o ipp ipp.o libbackend.a $(LIBS)
197 $(RM) http
198 $(LN) ipp http
199
200
201 #
202 # lpd
203 #
204
205 lpd: lpd.o ../cups/$(LIBCUPS) libbackend.a
206 echo Linking $@...
207 $(CC) $(LDFLAGS) -o lpd lpd.o libbackend.a $(LIBS)
208
209
210 #
211 # parallel
212 #
213
214 parallel: parallel.o ../cups/$(LIBCUPS) libbackend.a
215 echo Linking $@...
216 $(CC) $(LDFLAGS) -o parallel parallel.o libbackend.a $(LIBS)
217
218
219 #
220 # serial
221 #
222
223 serial: serial.o ../cups/$(LIBCUPS) libbackend.a
224 echo Linking $@...
225 $(CC) $(LDFLAGS) -o serial serial.o libbackend.a $(BACKLIBS) $(LIBS)
226
227
228 #
229 # snmp
230 #
231
232 snmp: snmp.o ../cups/$(LIBCUPS) libbackend.a
233 echo Linking $@...
234 $(CC) $(LDFLAGS) -o snmp snmp.o libbackend.a $(LIBS)
235
236
237 #
238 # socket
239 #
240
241 socket: socket.o ../cups/$(LIBCUPS) libbackend.a
242 echo Linking $@...
243 $(CC) $(LDFLAGS) -o socket socket.o libbackend.a $(LIBS)
244
245
246 #
247 # usb
248 #
249
250 usb: usb.o ../cups/$(LIBCUPS) libbackend.a
251 echo Linking $@...
252 $(CC) $(LDFLAGS) -o usb usb.o libbackend.a $(LIBUSB) \
253 $(BACKLIBS) $(LIBS)
254 usb.o: usb.c usb-darwin.c usb-libusb.c usb-unix.c
255
256
257 #
258 # Dependencies...
259 #
260
261 include Dependencies
262
263
264 #
265 # End of "$Id: Makefile 7924 2008-09-10 17:36:13Z mike $".
266 #