]> git.ipfire.org Git - thirdparty/cups.git/blame - cups/Makefile
New IPv6-capable address list stuff for STR #1313. Basically, this
[thirdparty/cups.git] / cups / Makefile
CommitLineData
04c3c0a1 1#
c9d3f842 2# "$Id$"
04c3c0a1 3#
a87857fe 4# API library Makefile for the Common UNIX Printing System (CUPS).
04c3c0a1 5#
c9d3f842 6# Copyright 1997-2005 by Easy Software Products, all rights reserved.
04c3c0a1 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
8784b6a6 17# 44141 Airport View Drive, Suite 204
c9d3f842 18# Hollywood, Maryland 20636 USA
04c3c0a1 19#
c4dcf3cc 20# Voice: (301) 373-9600
04c3c0a1 21# EMail: cups-info@cups.org
22# WWW: http://www.cups.org
23#
dab1a4d8 24# This file is subject to the Apple OS-Developed Software exception.
25#
04c3c0a1 26
27include ../Makedefs
28
29#
8394744e 30# Object files...
04c3c0a1 31#
32
03f61bf3 33LIBOBJS = \
edd05ffd 34 array.o \
03f61bf3 35 attr.o \
36 auth.o \
37 backchannel.o \
38 dest.o \
39 dir.o \
40 emit.o \
41 encode.o \
42 file.o \
43 getputfile.o \
44 globals.o \
45 http.o \
46 http-addr.o \
086c584d 47 http-addrlist.o \
03f61bf3 48 http-support.o \
49 ipp.o \
50 ipp-support.o \
51 langprintf.o \
52 language.o \
53 mark.o \
54 md5.o \
55 md5passwd.o \
56 normalize.o \
57 options.o \
58 page.o \
59 ppd.o \
60 snprintf.o \
61 string.o \
62 tempfile.o \
63 transcode.o \
64 usersys.o \
65 util.o
66OBJS = \
67 $(LIBOBJS) \
91edd94b 68 testarray.o \
eb1176e6 69 testfile.o \
03f61bf3 70 testhttp.o \
71 testi18n.o \
72 testipp.o \
73 testlang.o \
a665f6fc 74 php_cups_wrap.o
04c3c0a1 75
a3e17a89 76
04c3c0a1 77#
78# Header files to install...
79#
80
03f61bf3 81HEADERS = \
edd05ffd 82 array.h \
03f61bf3 83 cups.h \
84 dir.h \
85 file.h \
86 http.h \
87 ipp.h \
88 language.h \
89 md5.h \
90 normalize.h \
91 ppd.h \
92 transcode.h
04c3c0a1 93
a3e17a89 94
04c3c0a1 95#
96# Targets in this directory...
97#
98
03f61bf3 99TARGETS = \
100 $(LIBCUPS) \
101 libcups.a \
91edd94b 102 testarray \
eb1176e6 103 testfile \
03f61bf3 104 testhttp \
105 testi18n \
106 testipp \
107 testlang
04c3c0a1 108
a3e17a89 109
04c3c0a1 110#
111# Make all targets...
112#
113
114all: $(TARGETS)
115
a3e17a89 116
04c3c0a1 117#
118# Remove object and target files...
119#
120
121clean:
415199da 122 $(RM) $(OBJS) $(TARGETS) `basename $(LIBCUPS) .2` libcups.dylib
04c3c0a1 123
a3e17a89 124
f915b00f 125#
126# Update dependencies (without system header dependencies...)
127#
128
129depend:
130 makedepend -Y -I.. -fDependencies $(OBJS:.o=.c) >/dev/null 2>&1
131
132
04c3c0a1 133#
134# Install object and target files...
135#
136
9ff2fed2 137install: all installhdrs
753453e4 138 $(INSTALL_DIR) $(LIBDIR)
a3e17a89 139 $(INSTALL_LIB) $(LIBCUPS) $(LIBDIR)
faf27595 140 if test $(LIBCUPS) = "libcups.so.2" -o $(LIBCUPS) = "libcups.sl.2"; then \
faf27595 141 $(RM) $(LIBDIR)/`basename $(LIBCUPS) .2`; \
142 $(LN) $(LIBCUPS) $(LIBDIR)/`basename $(LIBCUPS) .2`; \
ab679c8f 143 fi
faf27595 144 if test $(LIBCUPS) = "libcups.2.dylib"; then \
9ff2fed2 145 $(STRIP) -x $(LIBDIR)/$(LIBCUPS); \
753453e4 146 $(RM) $(LIBDIR)/libcups.dylib; \
147 $(LN) $(LIBCUPS) $(LIBDIR)/libcups.dylib; \
148 fi
66b3b86f 149 if test $(LIBCUPS) != "libcups.a"; then \
753453e4 150 $(INSTALL_LIB) libcups.a $(LIBDIR); \
c4dcf3cc 151 $(RANLIB) $(LIBDIR)/libcups.a; \
753453e4 152 fi
ab679c8f 153
f915b00f 154installhdrs:
155 $(INSTALL_DIR) $(INCLUDEDIR)/cups
156 for file in $(HEADERS); do \
157 $(INSTALL_DATA) $$file $(INCLUDEDIR)/cups; \
158 done
159
a3e17a89 160
ab679c8f 161#
faf27595 162# libcups.so.2, libcups.sl.2
ab679c8f 163#
164
faf27595 165libcups.so.2 libcups.sl.2: $(LIBOBJS)
ab679c8f 166 echo Linking $@...
ddd3933d 167 $(DSO) $(DSOFLAGS) -o $@ $(LIBOBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
faf27595 168 $(RM) `basename $@ .2`
169 $(LN) $@ `basename $@ .2`
04c3c0a1 170
a3e17a89 171
753453e4 172#
173# libcups.2.dylib
174#
175
faf27595 176libcups.2.dylib: $(LIBOBJS)
753453e4 177 echo Linking $@...
9ae34eb7 178 $(DSO) $(DSOFLAGS) -o $@ \
f915b00f 179 -install_name $(libdir)/libcups.dylib \
c4dcf3cc 180 -current_version 2.7.0 \
faf27595 181 -compatibility_version 2.0.0 \
ddd3933d 182 $(LIBOBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
753453e4 183 $(RM) libcups.dylib
184 $(LN) $@ libcups.dylib
185
186
187#
188# libcups_s.a
189#
190
b5943919 191libcups_s.a: $(LIBOBJS)
753453e4 192 echo Creating $@...
54b6964f 193 $(RM) libcups_s.exp
69cf287c 194 (echo _ipp_add_attr; echo _ipp_free_attr; \
2625096f 195 echo _cups_hstrerror; echo _cups_md5_init; \
196 echo _cups_md5_append; echo _cups_md5_finish; \
197 echo _cups_strlcat; echo _cups_strlcpy) >libcups_s.exp
ddd3933d 198 $(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o $(LIBOBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) -lm
753453e4 199 $(RM) $@
200 $(AR) $(ARFLAGS) $@ libcups_s.o
201
202
ea315b09 203#
204# libcups.la
205#
206
b5943919 207libcups.la: $(LIBOBJS)
ea315b09 208 echo Linking $@...
c4dcf3cc 209 $(CC) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
ddd3933d 210 -version-info 2:7 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ea315b09 211
212
04c3c0a1 213#
214# libcups.a
215#
216
02abdc7e 217libcups.a: $(LIBOBJS)
8391453b 218 echo Archiving $@...
04c3c0a1 219 $(RM) $@
02abdc7e 220 $(AR) $(ARFLAGS) $@ $(LIBOBJS)
04c3c0a1 221 $(RANLIB) $@
222
a3e17a89 223
a665f6fc 224#
225# CUPS language bindings for various scripting languages...
226#
227
228phpcups.so: $(LIBCUPS) php_cups_wrap.o
229 echo Linking $@...
230 if test `uname` = Darwin; then \
231 DSOFLAGS="-bundle -flat_namespace -undefined suppress"; \
232 else \
233 DSOFLAGS="$(DSOFLAGS)"; \
234 fi; \
235 $(DSO) $$DSOFLAGS -o $@ php_cups_wrap.o $(LIBS) `php-config --ldflags --libs`
236
237php_cups_wrap.o: php_cups_wrap.c
238 echo Compiling $<...
239 $(CC) $(CFLAGS) `php-config --includes` -c $<
240php_cups_wrap.c: cups.h
241 echo Creating $< using SWIG...
242 swig -php -o $@ -module cups cups.h
243
244
7551914d 245#
246# cups_C.h - the default POSIX locale that is compiled in.
247#
248
249cups_C.h: ../locale/C/cups_C
8391453b 250 echo Generating $@...
7551914d 251 $(RM) cups_C.h
252 $(AWK) '{print "\"" $$0 "\","}' < ../locale/C/cups_C > cups_C.h
253
a3e17a89 254
91edd94b 255#
256# testarray (dependency on static CUPS library is intentional)
257#
258
259testarray: testarray.o libcups.a
260 echo Linking $@...
261 $(CC) $(LDFLAGS) -o $@ testarray.o libcups.a \
262 $(NETLIBS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
263
264
eb1176e6 265#
266# testfile (dependency on static CUPS library is intentional)
267#
268
269testfile: testfile.o libcups.a
270 echo Linking $@...
271 $(CC) $(LDFLAGS) -o $@ testfile.o libcups.a \
272 $(NETLIBS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
273
274
faf27595 275#
276# testhttp (dependency on static CUPS library is intentional)
277#
278
279testhttp: testhttp.o libcups.a
280 echo Linking $@...
9a524e65 281 $(CC) $(LDFLAGS) -o $@ testhttp.o libcups.a \
282 $(NETLIBS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
faf27595 283
284
1f90dbaa 285#
286# testipp (dependency on static CUPS library is intentional)
287#
288
289testipp: testipp.o libcups.a
290 echo Linking $@...
9a524e65 291 $(CC) $(LDFLAGS) -o $@ testipp.o libcups.a \
292 $(NETLIBS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
1f90dbaa 293
294
c5061b15 295#
296# testi18n (dependency on static CUPS library is intentional)
297#
298
299testi18n: testi18n.o libcups.a
300 echo Linking $@...
9a524e65 301 $(CC) $(LDFLAGS) -o $@ testi18n.o libcups.a \
302 $(NETLIBS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
c5061b15 303
304
a594463b 305#
306# testlang (dependency on static CUPS library is intentional)
307#
308
309testlang: testlang.o libcups.a
310 echo Linking $@...
9a524e65 311 $(CC) $(LDFLAGS) -o $@ testlang.o libcups.a \
312 $(NETLIBS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
a594463b 313
314
5dd92fd5 315#
67871650 316# Automatic API help files...
317#
318
319apihelp:
320 echo Generating CUPS API help files...
321 mxmldoc --title "Array API" array.h array.c >../doc/help/api-array.html
d12c5b68 322 mxmldoc --title "File and Directory APIs" file.h file.c dir.h dir.c >../doc/help/api-filedir.html
67871650 323 mxmldoc --title "PPD API" ppd.h attr.c emit.c mark.c page.c ppd.c >../doc/help/api-ppd.html
d12c5b68 324 mxmldoc --title "HTTP and IPP APIs" cups.h http.h ipp.h \
325 auth.c dest.c encode.c getputfile.c http.c http-addr.c \
326 http-support.c ipp.c ipp-support.c md5passwd.c options.c \
327 usersys.c util.c >../doc/help/api-httpipp.html
328 mxmldoc --title "Filter and Backend APIs" backchannel.c >../doc/help/api-filter.html
5dd92fd5 329
330
f915b00f 331#
332# Dependencies...
333#
a87857fe 334
f915b00f 335include Dependencies
04c3c0a1 336
a3e17a89 337
04c3c0a1 338#
c9d3f842 339# End of "$Id$".
04c3c0a1 340#