]> git.ipfire.org Git - thirdparty/cups.git/blame - cups/Makefile
Load cups into easysw/current.
[thirdparty/cups.git] / cups / Makefile
CommitLineData
ef416fc2 1#
bc44d920 2# "$Id: Makefile 6649 2007-07-11 21:46:42Z mike $"
ef416fc2 3#
4# API library Makefile for the Common UNIX Printing System (CUPS).
5#
bc44d920 6# Copyright 2007 by Apple Inc.
ef416fc2 7# Copyright 1997-2006 by Easy Software Products, all rights reserved.
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
20#
21# Object files...
22#
23
24LIBOBJS = \
757d2cad 25 adminutil.o \
ef416fc2 26 array.o \
27 attr.o \
28 auth.o \
29 backchannel.o \
a4d04587 30 backend.o \
fa73b229 31 custom.o \
ef416fc2 32 dest.o \
33 dir.o \
34 emit.o \
35 encode.o \
36 file.o \
89d46774 37 getifaddrs.o \
ef416fc2 38 getputfile.o \
39 globals.o \
40 http.o \
41 http-addr.o \
42 http-addrlist.o \
43 http-support.o \
44 ipp.o \
45 ipp-support.o \
46 langprintf.o \
47 language.o \
fa73b229 48 localize.o \
ef416fc2 49 mark.o \
50 md5.o \
51 md5passwd.o \
fa73b229 52 notify.o \
ef416fc2 53 options.o \
54 page.o \
55 ppd.o \
ecdc0628 56 request.o \
f7deaa1a 57 sidechannel.o \
ef416fc2 58 snprintf.o \
59 string.o \
60 tempfile.o \
61 transcode.o \
62 usersys.o \
63 util.o
e1d6a774 64LIB32OBJS = $(LIBOBJS:.o=.32.o)
65LIB64OBJS = $(LIBOBJS:.o=.64.o)
ef416fc2 66OBJS = \
67 $(LIBOBJS) \
e1d6a774 68 $(LIB32OBJS) \
69 $(LIB64OBJS) \
757d2cad 70 testadmin.o \
ef416fc2 71 testarray.o \
09a101d6 72 testcups.o \
ef416fc2 73 testfile.o \
74 testhttp.o \
75 testi18n.o \
76 testipp.o \
77 testlang.o \
fa73b229 78 testppd.o \
ef416fc2 79 php_cups_wrap.o
80
81
82#
83# Header files to install...
84#
85
86HEADERS = \
757d2cad 87 adminutil.h \
ef416fc2 88 array.h \
d09495fa 89 backend.h \
ef416fc2 90 cups.h \
91 dir.h \
92 file.h \
93 http.h \
94 i18n.h \
95 ipp.h \
96 language.h \
ef416fc2 97 ppd.h \
f7deaa1a 98 sidechannel.h \
ef416fc2 99 transcode.h
100
101
102#
103# Targets in this directory...
104#
105
106TARGETS = \
107 $(LIBCUPS) \
e1d6a774 108 $(LIB32CUPS) \
109 $(LIB64CUPS) \
ef416fc2 110 libcups.a \
757d2cad 111 testadmin \
ef416fc2 112 testarray \
09a101d6 113 testcups \
ef416fc2 114 testfile \
115 testhttp \
116 testi18n \
117 testipp \
fa73b229 118 testlang \
119 testppd
ef416fc2 120
121
122#
123# Make all targets...
124#
125
126all: $(TARGETS)
127
128
129#
130# Remove object and target files...
131#
132
133clean:
e1d6a774 134 $(RM) $(OBJS) $(TARGETS)
f301802f 135 $(RM) libcups.so libcups.sl libcups.dylib
ed486911 136 $(RM) -r 32bit 64bit
ef416fc2 137
138
139#
140# Update dependencies (without system header dependencies...)
141#
142
143depend:
e1d6a774 144 touch Dependencies.tmp
145 makedepend -Y -I.. -fDependencies.tmp $(OBJS:.o=.c) >/dev/null 2>&1
146 $(RM) Dependencies
147 cp Dependencies.tmp Dependencies
148 sed -r -e '1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp >>Dependencies
149 sed -r -e '1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp >>Dependencies
150 $(RM) Dependencies.tmp
ef416fc2 151
152
153#
154# Install object and target files...
155#
156
e1d6a774 157install: all installhdrs $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64)
bd7854cb 158 $(INSTALL_DIR) -m 755 $(LIBDIR)
ef416fc2 159 $(INSTALL_LIB) $(LIBCUPS) $(LIBDIR)
160 if test $(LIBCUPS) = "libcups.so.2" -o $(LIBCUPS) = "libcups.sl.2"; then \
161 $(RM) $(LIBDIR)/`basename $(LIBCUPS) .2`; \
162 $(LN) $(LIBCUPS) $(LIBDIR)/`basename $(LIBCUPS) .2`; \
163 fi
164 if test $(LIBCUPS) = "libcups.2.dylib"; then \
165 $(STRIP) -x $(LIBDIR)/$(LIBCUPS); \
166 $(RM) $(LIBDIR)/libcups.dylib; \
167 $(LN) $(LIBCUPS) $(LIBDIR)/libcups.dylib; \
168 fi
09a101d6 169 if test "x$(SYMROOT)" != "x"; then \
170 $(INSTALL_DIR) $(SYMROOT); \
171 for file in $(TARGETS); do \
172 cp $$file $(SYMROOT); \
173 done \
174 fi
923edb68 175
176installstatic:
177 $(INSTALL_DIR) -m 755 $(LIBDIR)
d6ae789d 178 $(INSTALL_LIB) libcups.a $(LIBDIR)
179 $(RANLIB) $(LIBDIR)/libcups.a
ef416fc2 180
181installhdrs:
bd7854cb 182 $(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups
ef416fc2 183 for file in $(HEADERS); do \
184 $(INSTALL_DATA) $$file $(INCLUDEDIR)/cups; \
185 done
186
e1d6a774 187install32bit:
188 $(INSTALL_DIR) -m 755 $(LIB32DIR)
f301802f 189 $(INSTALL_LIB) 32bit/libcups.so.2 $(LIB32DIR)/libcups.so.2
ed486911 190 $(LN) libcups.so.2 $(LIB32DIR)/libcups.so
e1d6a774 191
192install64bit:
193 $(INSTALL_DIR) -m 755 $(LIB64DIR)
f301802f 194 $(INSTALL_LIB) 64bit/libcups.so.2 $(LIB64DIR)/libcups.so.2
ed486911 195 $(LN) libcups.so.2 $(LIB64DIR)/libcups.so
e1d6a774 196
ef416fc2 197
757d2cad 198#
199# Uninstall object and target files...
200#
201
e1d6a774 202uninstall: $(UNINSTALL32) $(UNINSTALL64)
757d2cad 203 $(RM) $(LIBDIR)/libcups.2.dylib
204 $(RM) $(LIBDIR)/libcups.a
205 $(RM) $(LIBDIR)/libcups.dylib
206 $(RM) $(LIBDIR)/libcups_s.a
207 $(RM) $(LIBDIR)/libcups.sl
208 $(RM) $(LIBDIR)/libcups.sl.2
209 $(RM) $(LIBDIR)/libcups.so
210 $(RM) $(LIBDIR)/libcups.so.2
211 -$(RMDIR) $(LIBDIR)
212 for file in $(HEADERS); do \
213 $(RM) $(INCLUDEDIR)/cups/$$file; \
214 done
215 -$(RMDIR) $(INCLUDEDIR)/cups
216
e1d6a774 217uninstall32bit:
218 $(RM) $(LIB32DIR)/libcups.so
219 $(RM) $(LIB32DIR)/libcups.so.2
220 -$(RMDIR) $(LIB32DIR)
221
222uninstall64bit:
223 $(RM) $(LIB64DIR)/libcups.so
224 $(RM) $(LIB64DIR)/libcups.so.2
225 -$(RMDIR) $(LIB64DIR)
226
757d2cad 227
ef416fc2 228#
229# libcups.so.2, libcups.sl.2
230#
231
232libcups.so.2 libcups.sl.2: $(LIBOBJS)
233 echo Linking $@...
f7deaa1a 234 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 235 $(RM) `basename $@ .2`
236 $(LN) $@ `basename $@ .2`
237
238
e1d6a774 239#
f301802f 240# 32bit/libcups.so.2
e1d6a774 241#
242
f301802f 24332bit/libcups.so.2: $(LIB32OBJS)
e1d6a774 244 echo Linking 32-bit $@...
f301802f 245 -mkdir 32bit
f7deaa1a 246 $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(LIB32OBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
f301802f 247 $(RM) 32bit/libcups.so
248 $(LN) libcups.so.2 32bit/libcups.so
e1d6a774 249
250
251#
f301802f 252# 64bit/libcups.so.2
e1d6a774 253#
254
f301802f 25564bit/libcups.so.2: $(LIB64OBJS)
e1d6a774 256 echo Linking 64-bit $@...
f301802f 257 -mkdir 64bit
f7deaa1a 258 $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(LIB64OBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
f301802f 259 $(RM) 64bit/libcups.so
260 $(LN) libcups.so.2 64bit/libcups.so
e1d6a774 261
262
ef416fc2 263#
264# libcups.2.dylib
265#
266
09a101d6 267libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER)
ef416fc2 268 echo Linking $@...
e1d6a774 269 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
fa73b229 270 -install_name $(libdir)/$@ \
f7deaa1a 271 -current_version 2.8.0 \
ef416fc2 272 -compatibility_version 2.0.0 \
09a101d6 273 -exported_symbols_list libcups.exp \
274 -sectorder __TEXT __text $(LIBCUPSORDER) \
f7deaa1a 275 $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 276 $(RM) libcups.dylib
277 $(LN) $@ libcups.dylib
278
279
280#
281# libcups_s.a
282#
283
a74454a7 284libcups_s.a: $(LIBOBJS) libcups_s.exp
ef416fc2 285 echo Creating $@...
f7deaa1a 286 $(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) -lm
ef416fc2 287 $(RM) $@
288 $(AR) $(ARFLAGS) $@ libcups_s.o
289
290
291#
292# libcups.la
293#
294
295libcups.la: $(LIBOBJS)
296 echo Linking $@...
e1d6a774 297 $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
f7deaa1a 298 -version-info 2:8 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 299
300
301#
302# libcups.a
303#
304
305libcups.a: $(LIBOBJS)
306 echo Archiving $@...
307 $(RM) $@
308 $(AR) $(ARFLAGS) $@ $(LIBOBJS)
309 $(RANLIB) $@
310
311
312#
313# CUPS language bindings for various scripting languages...
314#
757d2cad 315# NOTE: Not currently used or functional - see the scripting/php directory
316# for the hand-written bindings...
317#
ef416fc2 318
319phpcups.so: $(LIBCUPS) php_cups_wrap.o
320 echo Linking $@...
321 if test `uname` = Darwin; then \
322 DSOFLAGS="-bundle -flat_namespace -undefined suppress"; \
323 else \
324 DSOFLAGS="$(DSOFLAGS)"; \
325 fi; \
326 $(DSO) $$DSOFLAGS -o $@ php_cups_wrap.o $(LIBS) `php-config --ldflags --libs`
327
328php_cups_wrap.o: php_cups_wrap.c
329 echo Compiling $<...
330 $(CC) $(CFLAGS) `php-config --includes` -c $<
331php_cups_wrap.c: cups.h
332 echo Creating $< using SWIG...
333 swig -php -o $@ -module cups cups.h
334
335
757d2cad 336#
337# testadmin (dependency on static CUPS library is intentional)
338#
339
340testadmin: testadmin.o libcups.a
341 echo Linking $@...
342 $(CC) $(LDFLAGS) -o $@ testadmin.o libcups.a \
f7deaa1a 343 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
757d2cad 344
345
ef416fc2 346#
347# testarray (dependency on static CUPS library is intentional)
348#
349
350testarray: testarray.o libcups.a
351 echo Linking $@...
352 $(CC) $(LDFLAGS) -o $@ testarray.o libcups.a \
f7deaa1a 353 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 354
355
09a101d6 356#
357# testcups (dependency on static CUPS library is intentional)
358#
359
360testcups: testcups.o libcups.a
361 echo Linking $@...
362 $(CC) $(LDFLAGS) -o $@ testcups.o libcups.a \
363 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
364
365
ef416fc2 366#
367# testfile (dependency on static CUPS library is intentional)
368#
369
370testfile: testfile.o libcups.a
371 echo Linking $@...
372 $(CC) $(LDFLAGS) -o $@ testfile.o libcups.a \
f7deaa1a 373 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 374
375
376#
377# testhttp (dependency on static CUPS library is intentional)
378#
379
380testhttp: testhttp.o libcups.a
381 echo Linking $@...
382 $(CC) $(LDFLAGS) -o $@ testhttp.o libcups.a \
f7deaa1a 383 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 384
385
386#
387# testipp (dependency on static CUPS library is intentional)
388#
389
390testipp: testipp.o libcups.a
391 echo Linking $@...
392 $(CC) $(LDFLAGS) -o $@ testipp.o libcups.a \
f7deaa1a 393 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 394
395
396#
397# testi18n (dependency on static CUPS library is intentional)
398#
399
400testi18n: testi18n.o libcups.a
401 echo Linking $@...
402 $(CC) $(LDFLAGS) -o $@ testi18n.o libcups.a \
f7deaa1a 403 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 404
405
406#
407# testlang (dependency on static CUPS library is intentional)
408#
409
410testlang: testlang.o libcups.a
411 echo Linking $@...
412 $(CC) $(LDFLAGS) -o $@ testlang.o libcups.a \
f7deaa1a 413 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 414
415
fa73b229 416#
417# testppd (dependency on static CUPS library is intentional)
418#
419
420testppd: testppd.o libcups.a
421 echo Linking $@...
422 $(CC) $(LDFLAGS) -o $@ testppd.o libcups.a \
f7deaa1a 423 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
fa73b229 424
425
ef416fc2 426#
427# Automatic API help files...
428#
429
430apihelp:
431 echo Generating CUPS API help files...
432 mxmldoc --section "Programming" --title "Array API" \
433 --intro api-array.shtml \
434 array.h array.c >../doc/help/api-array.html
435 mxmldoc --section "Programming" --title "CUPS API" \
436 --intro api-cups.shtml \
f7deaa1a 437 cups.h dest.c getputfile.c language.c notify.c \
ef416fc2 438 options.c tempfile.c usersys.c \
439 util.c >../doc/help/api-cups.html
440 mxmldoc --section "Programming" --title "File and Directory APIs" \
441 --intro api-filedir.shtml \
442 file.h file.c dir.h dir.c >../doc/help/api-filedir.html
443 mxmldoc --section "Programming" --title "PPD API" \
444 --intro api-ppd.shtml \
89d46774 445 ppd.h attr.c custom.c emit.c localize.c mark.c page.c \
ef416fc2 446 ppd.c >../doc/help/api-ppd.html
447 mxmldoc --section "Programming" --title "HTTP and IPP APIs" \
448 --intro api-httpipp.shtml \
ecdc0628 449 http.h ipp.h auth.c encode.c http.c http-addr.c \
450 http-support.c ipp.c ipp-support.c md5passwd.c \
451 request.c >../doc/help/api-httpipp.html
ef416fc2 452 mxmldoc --section "Programming" --title "Filter and Backend APIs" \
453 --intro api-filter.shtml \
f7deaa1a 454 backchannel.c sidechannel.c sidechannel.h >../doc/help/api-filter.html
ef416fc2 455
456
457#
458# Dependencies...
459#
460
461include Dependencies
462
463
464#
bc44d920 465# End of "$Id: Makefile 6649 2007-07-11 21:46:42Z mike $".
ef416fc2 466#