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