]> git.ipfire.org Git - thirdparty/cups.git/blame - cups/Makefile
Load cups into easysw/current.
[thirdparty/cups.git] / cups / Makefile
CommitLineData
ef416fc2 1#
d09495fa 2# "$Id: Makefile 5801 2006-08-03 02:20:57Z mike $"
ef416fc2 3#
4# API library Makefile for the Common UNIX Printing System (CUPS).
5#
6# Copyright 1997-2006 by Easy Software Products, all rights reserved.
7#
8# These coded instructions, statements, and computer programs are the
9# property of Easy Software Products and are protected by Federal
10# copyright law. Distribution and use rights are outlined in the file
11# "LICENSE.txt" which should have been included with this file. If this
12# file is missing or damaged please contact Easy Software Products
13# at:
14#
15# Attn: CUPS Licensing Information
16# Easy Software Products
17# 44141 Airport View Drive, Suite 204
18# Hollywood, Maryland 20636 USA
19#
20# Voice: (301) 373-9600
21# EMail: cups-info@cups.org
22# WWW: http://www.cups.org
23#
24# This file is subject to the Apple OS-Developed Software exception.
25#
26
27include ../Makedefs
28
29#
30# Object files...
31#
32
33LIBOBJS = \
757d2cad 34 adminutil.o \
ef416fc2 35 array.o \
36 attr.o \
37 auth.o \
38 backchannel.o \
a4d04587 39 backend.o \
fa73b229 40 custom.o \
ef416fc2 41 dest.o \
42 dir.o \
43 emit.o \
44 encode.o \
45 file.o \
89d46774 46 getifaddrs.o \
ef416fc2 47 getputfile.o \
48 globals.o \
49 http.o \
50 http-addr.o \
51 http-addrlist.o \
52 http-support.o \
53 ipp.o \
54 ipp-support.o \
55 langprintf.o \
56 language.o \
fa73b229 57 localize.o \
ef416fc2 58 mark.o \
59 md5.o \
60 md5passwd.o \
fa73b229 61 notify.o \
ef416fc2 62 options.o \
63 page.o \
64 ppd.o \
ecdc0628 65 request.o \
ef416fc2 66 snprintf.o \
67 string.o \
68 tempfile.o \
69 transcode.o \
70 usersys.o \
71 util.o
e1d6a774 72LIB32OBJS = $(LIBOBJS:.o=.32.o)
73LIB64OBJS = $(LIBOBJS:.o=.64.o)
ef416fc2 74OBJS = \
75 $(LIBOBJS) \
e1d6a774 76 $(LIB32OBJS) \
77 $(LIB64OBJS) \
757d2cad 78 testadmin.o \
ef416fc2 79 testarray.o \
80 testfile.o \
81 testhttp.o \
82 testi18n.o \
83 testipp.o \
84 testlang.o \
fa73b229 85 testppd.o \
ef416fc2 86 php_cups_wrap.o
87
88
89#
90# Header files to install...
91#
92
93HEADERS = \
757d2cad 94 adminutil.h \
ef416fc2 95 array.h \
d09495fa 96 backend.h \
ef416fc2 97 cups.h \
98 dir.h \
99 file.h \
100 http.h \
101 i18n.h \
102 ipp.h \
103 language.h \
104 md5.h \
ef416fc2 105 ppd.h \
106 transcode.h
107
108
109#
110# Targets in this directory...
111#
112
113TARGETS = \
114 $(LIBCUPS) \
e1d6a774 115 $(LIB32CUPS) \
116 $(LIB64CUPS) \
ef416fc2 117 libcups.a \
757d2cad 118 testadmin \
ef416fc2 119 testarray \
120 testfile \
121 testhttp \
122 testi18n \
123 testipp \
fa73b229 124 testlang \
125 testppd
ef416fc2 126
127
128#
129# Make all targets...
130#
131
132all: $(TARGETS)
133
134
135#
136# Remove object and target files...
137#
138
139clean:
e1d6a774 140 $(RM) $(OBJS) $(TARGETS)
f301802f 141 $(RM) libcups.so libcups.sl libcups.dylib
ed486911 142 $(RM) -r 32bit 64bit
ef416fc2 143
144
145#
146# Update dependencies (without system header dependencies...)
147#
148
149depend:
e1d6a774 150 touch Dependencies.tmp
151 makedepend -Y -I.. -fDependencies.tmp $(OBJS:.o=.c) >/dev/null 2>&1
152 $(RM) Dependencies
153 cp Dependencies.tmp Dependencies
154 sed -r -e '1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp >>Dependencies
155 sed -r -e '1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp >>Dependencies
156 $(RM) Dependencies.tmp
ef416fc2 157
158
159#
160# Install object and target files...
161#
162
e1d6a774 163install: all installhdrs $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64)
bd7854cb 164 $(INSTALL_DIR) -m 755 $(LIBDIR)
ef416fc2 165 $(INSTALL_LIB) $(LIBCUPS) $(LIBDIR)
166 if test $(LIBCUPS) = "libcups.so.2" -o $(LIBCUPS) = "libcups.sl.2"; then \
167 $(RM) $(LIBDIR)/`basename $(LIBCUPS) .2`; \
168 $(LN) $(LIBCUPS) $(LIBDIR)/`basename $(LIBCUPS) .2`; \
169 fi
170 if test $(LIBCUPS) = "libcups.2.dylib"; then \
171 $(STRIP) -x $(LIBDIR)/$(LIBCUPS); \
172 $(RM) $(LIBDIR)/libcups.dylib; \
173 $(LN) $(LIBCUPS) $(LIBDIR)/libcups.dylib; \
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 $@...
e1d6a774 234 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(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
246 $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(LIB32OBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
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
258 $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(LIB64OBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
259 $(RM) 64bit/libcups.so
260 $(LN) libcups.so.2 64bit/libcups.so
e1d6a774 261
262
ef416fc2 263#
264# libcups.2.dylib
265#
266
267libcups.2.dylib: $(LIBOBJS)
268 echo Linking $@...
e1d6a774 269 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
fa73b229 270 -install_name $(libdir)/$@ \
ef416fc2 271 -current_version 2.7.0 \
272 -compatibility_version 2.0.0 \
273 $(LIBOBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
274 $(RM) libcups.dylib
275 $(LN) $@ libcups.dylib
276
277
278#
279# libcups_s.a
280#
281
a74454a7 282libcups_s.a: $(LIBOBJS) libcups_s.exp
ef416fc2 283 echo Creating $@...
284 $(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o $(LIBOBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) -lm
285 $(RM) $@
286 $(AR) $(ARFLAGS) $@ libcups_s.o
287
288
289#
290# libcups.la
291#
292
293libcups.la: $(LIBOBJS)
294 echo Linking $@...
e1d6a774 295 $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
ef416fc2 296 -version-info 2:7 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
297
298
299#
300# libcups.a
301#
302
303libcups.a: $(LIBOBJS)
304 echo Archiving $@...
305 $(RM) $@
306 $(AR) $(ARFLAGS) $@ $(LIBOBJS)
307 $(RANLIB) $@
308
309
310#
311# CUPS language bindings for various scripting languages...
312#
757d2cad 313# NOTE: Not currently used or functional - see the scripting/php directory
314# for the hand-written bindings...
315#
ef416fc2 316
317phpcups.so: $(LIBCUPS) php_cups_wrap.o
318 echo Linking $@...
319 if test `uname` = Darwin; then \
320 DSOFLAGS="-bundle -flat_namespace -undefined suppress"; \
321 else \
322 DSOFLAGS="$(DSOFLAGS)"; \
323 fi; \
324 $(DSO) $$DSOFLAGS -o $@ php_cups_wrap.o $(LIBS) `php-config --ldflags --libs`
325
326php_cups_wrap.o: php_cups_wrap.c
327 echo Compiling $<...
328 $(CC) $(CFLAGS) `php-config --includes` -c $<
329php_cups_wrap.c: cups.h
330 echo Creating $< using SWIG...
331 swig -php -o $@ -module cups cups.h
332
333
757d2cad 334#
335# testadmin (dependency on static CUPS library is intentional)
336#
337
338testadmin: testadmin.o libcups.a
339 echo Linking $@...
340 $(CC) $(LDFLAGS) -o $@ testadmin.o libcups.a \
341 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
342
343
ef416fc2 344#
345# testarray (dependency on static CUPS library is intentional)
346#
347
348testarray: testarray.o libcups.a
349 echo Linking $@...
350 $(CC) $(LDFLAGS) -o $@ testarray.o libcups.a \
351 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
352
353
354#
355# testfile (dependency on static CUPS library is intentional)
356#
357
358testfile: testfile.o libcups.a
359 echo Linking $@...
360 $(CC) $(LDFLAGS) -o $@ testfile.o libcups.a \
361 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
362
363
364#
365# testhttp (dependency on static CUPS library is intentional)
366#
367
368testhttp: testhttp.o libcups.a
369 echo Linking $@...
370 $(CC) $(LDFLAGS) -o $@ testhttp.o libcups.a \
371 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
372
373
374#
375# testipp (dependency on static CUPS library is intentional)
376#
377
378testipp: testipp.o libcups.a
379 echo Linking $@...
380 $(CC) $(LDFLAGS) -o $@ testipp.o libcups.a \
381 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
382
383
384#
385# testi18n (dependency on static CUPS library is intentional)
386#
387
388testi18n: testi18n.o libcups.a
389 echo Linking $@...
390 $(CC) $(LDFLAGS) -o $@ testi18n.o libcups.a \
391 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
392
393
394#
395# testlang (dependency on static CUPS library is intentional)
396#
397
398testlang: testlang.o libcups.a
399 echo Linking $@...
400 $(CC) $(LDFLAGS) -o $@ testlang.o libcups.a \
401 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
402
403
fa73b229 404#
405# testppd (dependency on static CUPS library is intentional)
406#
407
408testppd: testppd.o libcups.a
409 echo Linking $@...
410 $(CC) $(LDFLAGS) -o $@ testppd.o libcups.a \
411 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
412
413
ef416fc2 414#
415# Automatic API help files...
416#
417
418apihelp:
419 echo Generating CUPS API help files...
420 mxmldoc --section "Programming" --title "Array API" \
421 --intro api-array.shtml \
422 array.h array.c >../doc/help/api-array.html
423 mxmldoc --section "Programming" --title "CUPS API" \
424 --intro api-cups.shtml \
ecdc0628 425 cups.h dest.c getputfile.c language.c \
ef416fc2 426 options.c tempfile.c usersys.c \
427 util.c >../doc/help/api-cups.html
428 mxmldoc --section "Programming" --title "File and Directory APIs" \
429 --intro api-filedir.shtml \
430 file.h file.c dir.h dir.c >../doc/help/api-filedir.html
431 mxmldoc --section "Programming" --title "PPD API" \
432 --intro api-ppd.shtml \
89d46774 433 ppd.h attr.c custom.c emit.c localize.c mark.c page.c \
ef416fc2 434 ppd.c >../doc/help/api-ppd.html
435 mxmldoc --section "Programming" --title "HTTP and IPP APIs" \
436 --intro api-httpipp.shtml \
ecdc0628 437 http.h ipp.h auth.c encode.c http.c http-addr.c \
438 http-support.c ipp.c ipp-support.c md5passwd.c \
439 request.c >../doc/help/api-httpipp.html
ef416fc2 440 mxmldoc --section "Programming" --title "Filter and Backend APIs" \
441 --intro api-filter.shtml \
442 backchannel.c >../doc/help/api-filter.html
443
444
445#
446# Dependencies...
447#
448
449include Dependencies
450
451
452#
d09495fa 453# End of "$Id: Makefile 5801 2006-08-03 02:20:57Z mike $".
ef416fc2 454#