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