]> git.ipfire.org Git - thirdparty/cups.git/blame - cgi-bin/Makefile
Merge changes from CUPS 1.4svn-r7715.
[thirdparty/cups.git] / cgi-bin / Makefile
CommitLineData
ef416fc2 1#
75bd9771 2# "$Id: Makefile 7558 2008-05-12 23:46:44Z mike $"
ef416fc2 3#
4# CGI makefile for the Common UNIX Printing System (CUPS).
5#
50fe7201 6# Copyright 2007-2008 by Apple Inc.
bd7854cb 7# Copyright 1997-2006 by Easy Software Products.
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
16include ../Makedefs
17
50fe7201
MS
18LIBOBJS = \
19 help-index.o \
20 html.o \
21 ipp-var.o \
22 search.o \
23 template.o \
24 var.o
25LIB32OBJS = $(LIBOBJS:.o=.32.o)
26LIB64OBJS = $(LIBOBJS:.o=.64.o)
27OBJS = \
28 $(LIBOBJS) \
29 $(LIB32OBJS) \
30 $(LIB64OBJS) \
31 admin.o \
32 classes.o \
33 help.o \
34 jobs.o \
35 printers.o \
36 testcgi.o \
37 testhi.o \
1f0275e3
MS
38 testtemplate.o \
39 websearch.o
50fe7201
MS
40CGIS = \
41 admin.cgi \
42 classes.cgi \
43 help.cgi \
44 jobs.cgi \
45 printers.cgi
c9fc04c6 46LIBTARGETS = \
50fe7201
MS
47 libcupscgi.a \
48 $(LIBCUPSCGI) \
49 $(LIB32CUPSCGI) \
50 $(LIB32CUPSCGI) \
50fe7201 51 testcgi \
1f0275e3
MS
52 testhi \
53 websearch
c9fc04c6
MS
54
55TARGETS = \
56 $(LIBTARGETS) \
57 $(CGIS) \
50fe7201 58 testtemplate
ef416fc2 59
60
61#
62# Make all targets...
63#
64
65all: $(TARGETS)
66
67
c9fc04c6
MS
68#
69# Make library targets...
70#
71
72libs: $(LIBTARGETS)
73
74
ef416fc2 75#
76# Clean all object files...
77#
78
79clean:
80 $(RM) $(OBJS) $(TARGETS)
50fe7201
MS
81 $(RM) libcupscgi.so libcupscgi.sl libcupscgi.dylib
82 $(RM) -r 32bit 64bit
ef416fc2 83
84
85#
86# Update dependencies (without system header dependencies...)
87#
88
89depend:
50fe7201
MS
90 touch Dependencies.tmp
91 makedepend -Y -I.. -fDependencies.tmp $(OBJS:.o=.c) >/dev/null 2>&1
92 $(RM) Dependencies
93 cp Dependencies.tmp Dependencies
94 sed -E -e '1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp >>Dependencies
95 sed -E -e '1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp >>Dependencies
96 $(RM) Dependencies.tmp
ef416fc2 97
98
99#
100# Install all targets...
101#
102
50fe7201
MS
103install: all install-data install-headers install-libs install-exec
104
105
106#
107# Install data files...
108#
109
110install-data:
111
112
113#
114# Install programs...
115#
116
117install-exec:
bd7854cb 118 $(INSTALL_DIR) -m 755 $(SERVERBIN)/cgi-bin
ef416fc2 119 for file in $(CGIS); do \
120 $(INSTALL_BIN) $$file $(SERVERBIN)/cgi-bin; \
121 done
09a101d6 122 if test "x$(SYMROOT)" != "x"; then \
123 $(INSTALL_DIR) $(SYMROOT); \
124 for file in $(TARGETS); do \
125 cp $$file $(SYMROOT); \
126 done \
127 fi
ef416fc2 128
129
50fe7201
MS
130#
131# Install headers...
132#
133
134install-headers:
135 echo Installing header files in $(INCLUDEDIR)/cups...
136 $(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups
137 $(INSTALL_DATA) cgi.h $(INCLUDEDIR)/cups
138 $(INSTALL_DATA) help-index.h $(INCLUDEDIR)/cups
139
140
141#
142# Install libraries...
143#
144
145install-libs: $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64)
146 echo Installing libraries in $(LIBDIR)...
147 $(INSTALL_DIR) -m 755 $(LIBDIR)
148 $(INSTALL_LIB) $(LIBCUPSCGI) $(LIBDIR)
149 if test $(LIBCUPSCGI) = "libcupscgi.so.1" -o $(LIBCUPSCGI) = "libcupscgi.sl.1"; then \
150 $(RM) $(LIBDIR)/`basename $(LIBCUPSCGI) .1`; \
151 $(LN) $(LIBCUPSCGI) $(LIBDIR)/`basename $(LIBCUPSCGI) .1`; \
152 fi
153 if test $(LIBCUPSCGI) = "libcupscgi.1.dylib"; then \
50fe7201
MS
154 $(RM) $(LIBDIR)/libcupscgi.dylib; \
155 $(LN) $(LIBCUPSCGI) $(LIBDIR)/libcupscgi.dylib; \
156 fi
157 if test "x$(SYMROOT)" != "x"; then \
158 $(INSTALL_DIR) $(SYMROOT); \
159 cp $(LIBCUPSCGI) $(SYMROOT); \
160 fi
161
162installstatic:
163 $(INSTALL_DIR) -m 755 $(LIBDIR)
164 $(INSTALL_LIB) libcupscgi.a $(LIBDIR)
165 $(RANLIB) $(LIBDIR)/libcupscgi.a
166
167install32bit:
168 echo Installing libraries in $(LIB32DIR)...
169 $(INSTALL_DIR) -m 755 $(LIB32DIR)
170 $(INSTALL_LIB) 32bit/libcupscgi.so.1 $(LIB32DIR)/libcupscgi.so.1
171 $(LN) libcupscgi.so.1 $(LIB32DIR)/libcupscgi.so
172
173install64bit:
174 echo Installing libraries in $(LIB64DIR)...
175 $(INSTALL_DIR) -m 755 $(LIB64DIR)
176 $(INSTALL_LIB) 64bit/libcupscgi.so.1 $(LIB64DIR)/libcupscgi.so.1
177 $(LN) libcupscgi.so.1 $(LIB64DIR)/libcupscgi.so
178
179
757d2cad 180#
181# Uninstall all targets...
182#
183
50fe7201 184uninstall: $(UNINSTALL32) $(UNINSTALL64)
757d2cad 185 for file in $(CGIS); do \
186 $(RM) $(SERVERBIN)/cgi-bin/$$file; \
187 done
188 -$(RMDIR) $(SERVERBIN)/cgi-bin
50fe7201
MS
189 $(RM) $(LIBDIR)/libcupscgi.1.dylib
190 $(RM) $(LIBDIR)/libcupscgi.a
191 $(RM) $(LIBDIR)/libcupscgi.dylib
192 $(RM) $(LIBDIR)/libcupscgi_s.a
193 $(RM) $(LIBDIR)/libcupscgi.sl
194 $(RM) $(LIBDIR)/libcupscgi.sl.1
195 $(RM) $(LIBDIR)/libcupscgi.so
196 $(RM) $(LIBDIR)/libcupscgi.so.1
197 -$(RMDIR) $(LIBDIR)
198 $(RM) $(INCLUDEDIR)/cups/cgi.h
199 $(RM) $(INCLUDEDIR)/cups/help-index.h
200 -$(RMDIR) $(INCLUDEDIR)/cups
201
202uninstall32bit:
203 $(RM) $(LIB32DIR)/libcupscgi.so
204 $(RM) $(LIB32DIR)/libcupscgi.so.1
205 -$(RMDIR) $(LIB32DIR)
206
207uninstall64bit:
208 $(RM) $(LIB64DIR)/libcupscgi.so
209 $(RM) $(LIB64DIR)/libcupscgi.so.1
210 -$(RMDIR) $(LIB64DIR)
211
212
213#
214# Automatic API help files...
215#
216
217apihelp:
218 mxmldoc --section "Programming" \
219 --title "CGI API" \
220 --css ../doc/cups-printable.css \
221 --header api-cgi.header --intro api-cgi.shtml \
222 cgi.h help-index.h $(LIBOBJS:.o=.c) >../doc/help/api-cgi.html
223
224framedhelp:
225 mxmldoc --framed api-cgi \
226 --section "Programming" \
227 --title "CGI API" \
228 --css ../doc/cups-printable.css \
229 --header api-cgi.header --intro api-cgi.shtml \
230 cgi.h help-index.h $(LIBOBJS:.o=.c)
231
232
233#
234# libcupscgi.so.1, libcupscgi.sl.1
235#
236
237libcupscgi.so.1 libcupscgi.sl.1: $(LIBOBJS)
238 echo Linking $@...
239 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBS)
240 $(RM) `basename $@ .1`
241 $(LN) $@ `basename $@ .1`
242
243
244#
245# 32bit/libcupscgi.so.1
246#
247
24832bit/libcupscgi.so.1: $(LIB32OBJS)
249 echo Linking 32-bit $@...
250 -mkdir 32bit
251 $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(LIB32OBJS) $(LIBS)
252 $(RM) 32bit/libcupscgi.so
253 $(LN) libcupscgi.so.1 32bit/libcupscgi.so
254
255
256#
257# 64bit/libcupscgi.so.1
258#
259
26064bit/libcupscgi.so.1: $(LIB64OBJS)
261 echo Linking 64-bit $@...
262 -mkdir 64bit
263 $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(LIB64OBJS) $(LIBS)
264 $(RM) 64bit/libcupscgi.so
265 $(LN) libcupscgi.so.1 64bit/libcupscgi.so
266
267
268#
269# libcupscgi.1.dylib
270#
271
272libcupscgi.1.dylib: $(LIBOBJS) libcupscgi.exp
273 echo Linking $@...
274 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
275 -install_name $(libdir)/$@ \
276 -current_version 1.0.0 \
277 -compatibility_version 1.0.0 \
278 -exported_symbols_list libcupscgi.exp \
279 $(LIBOBJS) $(LIBS)
280 $(RM) libcupscgi.dylib
281 $(LN) $@ libcupscgi.dylib
282
283
284#
285# libcupscgi_s.a
286#
287
288libcupscgi_s.a: $(LIBOBJS)
289 echo Creating $@...
290 $(DSO) $(DSOFLAGS) -o libcupscgi_s.o $(LIBOBJS) $(LIBS)
291 $(RM) $@
292 $(AR) $(ARFLAGS) $@ libcupscgi_s.o
293
294
295#
296# libcupscgi.la
297#
298
299libcupscgi.la: $(LIBOBJS)
300 echo Linking $@...
301 $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
302 -version-info 1:0 $(LIBS)
757d2cad 303
304
ef416fc2 305#
50fe7201 306# libcupscgi.a
ef416fc2 307#
308
50fe7201 309libcupscgi.a: $(LIBOBJS)
ef416fc2 310 echo Archiving $@...
311 $(RM) $@
312 $(AR) $(ARFLAGS) $@ $(LIBOBJS)
313 $(RANLIB) $@
314
315
316#
317# admin.cgi
318#
319
50fe7201 320admin.cgi: admin.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
ef416fc2 321 echo Linking $@...
50fe7201 322 $(CC) $(LDFLAGS) -o $@ admin.o -L. -lcupscgi $(LIBS)
ef416fc2 323
324
325#
326# classes.cgi
327#
328
50fe7201 329classes.cgi: classes.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
ef416fc2 330 echo Linking $@...
50fe7201 331 $(CC) $(LDFLAGS) -o $@ classes.o -L. -lcupscgi $(LIBS)
ef416fc2 332
333
334#
335# help.cgi
336#
337
50fe7201 338help.cgi: help.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
ef416fc2 339 echo Linking $@...
50fe7201 340 $(CC) $(LDFLAGS) -o $@ help.o -L. -lcupscgi $(LIBS)
ef416fc2 341
342
343#
344# jobs.cgi
345#
346
50fe7201 347jobs.cgi: jobs.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
ef416fc2 348 echo Linking $@...
50fe7201 349 $(CC) $(LDFLAGS) -o $@ jobs.o -L. -lcupscgi $(LIBS)
ef416fc2 350
351
352#
353# printers.cgi
354#
355
50fe7201 356printers.cgi: printers.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
ef416fc2 357 echo Linking $@...
50fe7201 358 $(CC) $(LDFLAGS) -o $@ printers.o -L. -lcupscgi $(LIBS)
ef416fc2 359
360
361#
362# testcgi
363#
364
50fe7201 365testcgi: testcgi.o ../Makedefs libcupscgi.a ../cups/libcups.a
ef416fc2 366 echo Linking $@...
c9fc04c6
MS
367 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testcgi.o libcupscgi.a \
368 ../cups/libcups.a $(COMMONLIBS) $(SSLLIBS) $(LIBZ) $(LIBGSSAPI)
369 echo Testing CGI API...
370 ./testcgi
ef416fc2 371
372
373#
374# testhi
375#
376
50fe7201 377testhi: testhi.o ../Makedefs libcupscgi.a ../cups/libcups.a
ef416fc2 378 echo Linking $@...
c9fc04c6
MS
379 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testhi.o libcupscgi.a \
380 ../cups/libcups.a $(COMMONLIBS) $(SSLLIBS) $(LIBZ) $(LIBGSSAPI)
381 echo Testing help index API...
382 ./testhi
ef416fc2 383
384
bd7854cb 385#
386# testtemplate
387#
388
50fe7201 389testtemplate: testtemplate.o ../Makedefs libcupscgi.a ../cups/libcups.a
bd7854cb 390 echo Linking $@...
50fe7201 391 $(CC) $(LDFLAGS) -o $@ testtemplate.o libcupscgi.a ../cups/libcups.a \
f7deaa1a 392 $(COMMONLIBS) $(SSLLIBS) $(LIBZ) $(LIBGSSAPI)
bd7854cb 393
394
1f0275e3
MS
395#
396# websearch
397#
398
399websearch: websearch.o ../Makedefs libcupscgi.a ../cups/libcups.a
400 echo Linking $@...
401 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ websearch.o libcupscgi.a \
402 ../cups/libcups.a $(COMMONLIBS) $(SSLLIBS) $(LIBZ) $(LIBGSSAPI)
403
404
ef416fc2 405#
406# Dependencies...
407#
408
409include Dependencies
410
411
412#
75bd9771 413# End of "$Id: Makefile 7558 2008-05-12 23:46:44Z mike $".
ef416fc2 414#