]> git.ipfire.org Git - thirdparty/cups.git/blob - cgi-bin/Makefile
Merge changes from CUPS 1.4svn-r7715.
[thirdparty/cups.git] / cgi-bin / Makefile
1 #
2 # "$Id: Makefile 7558 2008-05-12 23:46:44Z mike $"
3 #
4 # CGI makefile for the Common UNIX Printing System (CUPS).
5 #
6 # Copyright 2007-2008 by Apple Inc.
7 # Copyright 1997-2006 by Easy Software Products.
8 #
9 # These coded instructions, statements, and computer programs are the
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/".
14 #
15
16 include ../Makedefs
17
18 LIBOBJS = \
19 help-index.o \
20 html.o \
21 ipp-var.o \
22 search.o \
23 template.o \
24 var.o
25 LIB32OBJS = $(LIBOBJS:.o=.32.o)
26 LIB64OBJS = $(LIBOBJS:.o=.64.o)
27 OBJS = \
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 \
38 testtemplate.o \
39 websearch.o
40 CGIS = \
41 admin.cgi \
42 classes.cgi \
43 help.cgi \
44 jobs.cgi \
45 printers.cgi
46 LIBTARGETS = \
47 libcupscgi.a \
48 $(LIBCUPSCGI) \
49 $(LIB32CUPSCGI) \
50 $(LIB32CUPSCGI) \
51 testcgi \
52 testhi \
53 websearch
54
55 TARGETS = \
56 $(LIBTARGETS) \
57 $(CGIS) \
58 testtemplate
59
60
61 #
62 # Make all targets...
63 #
64
65 all: $(TARGETS)
66
67
68 #
69 # Make library targets...
70 #
71
72 libs: $(LIBTARGETS)
73
74
75 #
76 # Clean all object files...
77 #
78
79 clean:
80 $(RM) $(OBJS) $(TARGETS)
81 $(RM) libcupscgi.so libcupscgi.sl libcupscgi.dylib
82 $(RM) -r 32bit 64bit
83
84
85 #
86 # Update dependencies (without system header dependencies...)
87 #
88
89 depend:
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
97
98
99 #
100 # Install all targets...
101 #
102
103 install: all install-data install-headers install-libs install-exec
104
105
106 #
107 # Install data files...
108 #
109
110 install-data:
111
112
113 #
114 # Install programs...
115 #
116
117 install-exec:
118 $(INSTALL_DIR) -m 755 $(SERVERBIN)/cgi-bin
119 for file in $(CGIS); do \
120 $(INSTALL_BIN) $$file $(SERVERBIN)/cgi-bin; \
121 done
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
128
129
130 #
131 # Install headers...
132 #
133
134 install-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
145 install-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 \
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
162 installstatic:
163 $(INSTALL_DIR) -m 755 $(LIBDIR)
164 $(INSTALL_LIB) libcupscgi.a $(LIBDIR)
165 $(RANLIB) $(LIBDIR)/libcupscgi.a
166
167 install32bit:
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
173 install64bit:
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
180 #
181 # Uninstall all targets...
182 #
183
184 uninstall: $(UNINSTALL32) $(UNINSTALL64)
185 for file in $(CGIS); do \
186 $(RM) $(SERVERBIN)/cgi-bin/$$file; \
187 done
188 -$(RMDIR) $(SERVERBIN)/cgi-bin
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
202 uninstall32bit:
203 $(RM) $(LIB32DIR)/libcupscgi.so
204 $(RM) $(LIB32DIR)/libcupscgi.so.1
205 -$(RMDIR) $(LIB32DIR)
206
207 uninstall64bit:
208 $(RM) $(LIB64DIR)/libcupscgi.so
209 $(RM) $(LIB64DIR)/libcupscgi.so.1
210 -$(RMDIR) $(LIB64DIR)
211
212
213 #
214 # Automatic API help files...
215 #
216
217 apihelp:
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
224 framedhelp:
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
237 libcupscgi.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
248 32bit/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
260 64bit/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
272 libcupscgi.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
288 libcupscgi_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
299 libcupscgi.la: $(LIBOBJS)
300 echo Linking $@...
301 $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
302 -version-info 1:0 $(LIBS)
303
304
305 #
306 # libcupscgi.a
307 #
308
309 libcupscgi.a: $(LIBOBJS)
310 echo Archiving $@...
311 $(RM) $@
312 $(AR) $(ARFLAGS) $@ $(LIBOBJS)
313 $(RANLIB) $@
314
315
316 #
317 # admin.cgi
318 #
319
320 admin.cgi: admin.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
321 echo Linking $@...
322 $(CC) $(LDFLAGS) -o $@ admin.o -L. -lcupscgi $(LIBS)
323
324
325 #
326 # classes.cgi
327 #
328
329 classes.cgi: classes.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
330 echo Linking $@...
331 $(CC) $(LDFLAGS) -o $@ classes.o -L. -lcupscgi $(LIBS)
332
333
334 #
335 # help.cgi
336 #
337
338 help.cgi: help.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
339 echo Linking $@...
340 $(CC) $(LDFLAGS) -o $@ help.o -L. -lcupscgi $(LIBS)
341
342
343 #
344 # jobs.cgi
345 #
346
347 jobs.cgi: jobs.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
348 echo Linking $@...
349 $(CC) $(LDFLAGS) -o $@ jobs.o -L. -lcupscgi $(LIBS)
350
351
352 #
353 # printers.cgi
354 #
355
356 printers.cgi: printers.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
357 echo Linking $@...
358 $(CC) $(LDFLAGS) -o $@ printers.o -L. -lcupscgi $(LIBS)
359
360
361 #
362 # testcgi
363 #
364
365 testcgi: testcgi.o ../Makedefs libcupscgi.a ../cups/libcups.a
366 echo Linking $@...
367 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testcgi.o libcupscgi.a \
368 ../cups/libcups.a $(COMMONLIBS) $(SSLLIBS) $(LIBZ) $(LIBGSSAPI)
369 echo Testing CGI API...
370 ./testcgi
371
372
373 #
374 # testhi
375 #
376
377 testhi: testhi.o ../Makedefs libcupscgi.a ../cups/libcups.a
378 echo Linking $@...
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
383
384
385 #
386 # testtemplate
387 #
388
389 testtemplate: testtemplate.o ../Makedefs libcupscgi.a ../cups/libcups.a
390 echo Linking $@...
391 $(CC) $(LDFLAGS) -o $@ testtemplate.o libcupscgi.a ../cups/libcups.a \
392 $(COMMONLIBS) $(SSLLIBS) $(LIBZ) $(LIBGSSAPI)
393
394
395 #
396 # websearch
397 #
398
399 websearch: 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
405 #
406 # Dependencies...
407 #
408
409 include Dependencies
410
411
412 #
413 # End of "$Id: Makefile 7558 2008-05-12 23:46:44Z mike $".
414 #