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