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