]> git.ipfire.org Git - thirdparty/cups.git/blob - cgi-bin/Makefile
Merge changes from CUPS 1.7svn-r10791.
[thirdparty/cups.git] / cgi-bin / Makefile
1 #
2 # "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $"
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 done \
124 fi
125
126
127 #
128 # Install headers...
129 #
130
131 install-headers:
132 echo Installing header files in $(INCLUDEDIR)/cups...
133 $(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups
134 $(INSTALL_DATA) cgi.h $(INCLUDEDIR)/cups
135 $(INSTALL_DATA) help-index.h $(INCLUDEDIR)/cups
136
137
138 #
139 # Install libraries...
140 #
141
142 install-libs: $(INSTALLSTATIC)
143 echo Installing libraries in $(LIBDIR)...
144 $(INSTALL_DIR) -m 755 $(LIBDIR)
145 $(INSTALL_LIB) $(LIBCUPSCGI) $(LIBDIR)
146 if test $(LIBCUPSCGI) = "libcupscgi.so.1" -o $(LIBCUPSCGI) = "libcupscgi.sl.1"; then \
147 $(RM) $(LIBDIR)/`basename $(LIBCUPSCGI) .1`; \
148 $(LN) $(LIBCUPSCGI) $(LIBDIR)/`basename $(LIBCUPSCGI) .1`; \
149 fi
150 if test $(LIBCUPSCGI) = "libcupscgi.1.dylib"; then \
151 $(RM) $(LIBDIR)/libcupscgi.dylib; \
152 $(LN) $(LIBCUPSCGI) $(LIBDIR)/libcupscgi.dylib; \
153 fi
154 if test "x$(SYMROOT)" != "x"; then \
155 $(INSTALL_DIR) $(SYMROOT); \
156 cp $(LIBCUPSCGI) $(SYMROOT); \
157 dsymutil $(SYMROOT)/$(LIBCUPSCGI); \
158 fi
159
160 installstatic:
161 $(INSTALL_DIR) -m 755 $(LIBDIR)
162 $(INSTALL_LIB) -m 755 libcupscgi.a $(LIBDIR)
163 $(RANLIB) $(LIBDIR)/libcupscgi.a
164 $(CHMOD) 555 $(LIBDIR)/libcupscgi.a
165
166
167 #
168 # Uninstall all targets...
169 #
170
171 uninstall:
172 for file in $(CGIS); do \
173 $(RM) $(SERVERBIN)/cgi-bin/$$file; \
174 done
175 -$(RMDIR) $(SERVERBIN)/cgi-bin
176 $(RM) $(LIBDIR)/libcupscgi.1.dylib
177 $(RM) $(LIBDIR)/libcupscgi.a
178 $(RM) $(LIBDIR)/libcupscgi.dylib
179 $(RM) $(LIBDIR)/libcupscgi_s.a
180 $(RM) $(LIBDIR)/libcupscgi.sl
181 $(RM) $(LIBDIR)/libcupscgi.sl.1
182 $(RM) $(LIBDIR)/libcupscgi.so
183 $(RM) $(LIBDIR)/libcupscgi.so.1
184 -$(RMDIR) $(LIBDIR)
185 $(RM) $(INCLUDEDIR)/cups/cgi.h
186 $(RM) $(INCLUDEDIR)/cups/help-index.h
187 -$(RMDIR) $(INCLUDEDIR)/cups
188
189
190 #
191 # Automatic API help files...
192 #
193
194 apihelp:
195 mxmldoc --section "Programming" \
196 --title "CGI API" \
197 --css ../doc/cups-printable.css \
198 --header api-cgi.header --intro api-cgi.shtml \
199 cgi.h help-index.h $(LIBOBJS:.o=.c) >../doc/help/api-cgi.html
200 mxmldoc --tokens help/api-cgi.html api-cgi.xml >../doc/help/api-cgi.tokens
201 $(RM) api-cgi.xml
202
203 framedhelp:
204 mxmldoc --framed api-cgi \
205 --section "Programming" \
206 --title "CGI API" \
207 --css ../doc/cups-printable.css \
208 --header api-cgi.header --intro api-cgi.shtml \
209 cgi.h help-index.h $(LIBOBJS:.o=.c)
210
211
212 #
213 # libcupscgi.so.1, libcupscgi.sl.1
214 #
215
216 libcupscgi.so.1 libcupscgi.sl.1: $(LIBOBJS)
217 echo Linking $@...
218 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBS)
219 $(RM) `basename $@ .1`
220 $(LN) $@ `basename $@ .1`
221
222
223 #
224 # libcupscgi.1.dylib
225 #
226
227 libcupscgi.1.dylib: $(LIBOBJS) libcupscgi.exp
228 echo Linking $@...
229 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
230 -install_name $(libdir)/$@ \
231 -current_version 1.0.0 \
232 -compatibility_version 1.0.0 \
233 -exported_symbols_list libcupscgi.exp \
234 $(LIBOBJS) $(LIBS)
235 $(RM) libcupscgi.dylib
236 $(LN) $@ libcupscgi.dylib
237
238
239 #
240 # libcupscgi_s.a
241 #
242
243 libcupscgi_s.a: $(LIBOBJS)
244 echo Creating $@...
245 $(DSO) $(DSOFLAGS) -o libcupscgi_s.o $(LIBOBJS) $(LIBS)
246 $(RM) $@
247 $(AR) $(ARFLAGS) $@ libcupscgi_s.o
248
249
250 #
251 # libcupscgi.la
252 #
253
254 libcupscgi.la: $(LIBOBJS)
255 echo Linking $@...
256 $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
257 -version-info 1:0 $(LIBS)
258
259
260 #
261 # libcupscgi.a
262 #
263
264 libcupscgi.a: $(LIBOBJS)
265 echo Archiving $@...
266 $(RM) $@
267 $(AR) $(ARFLAGS) $@ $(LIBOBJS)
268 $(RANLIB) $@
269
270
271 #
272 # admin.cgi
273 #
274
275 admin.cgi: admin.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
276 echo Linking $@...
277 $(CC) $(LDFLAGS) -o $@ admin.o -lcupscgi $(LIBS)
278
279
280 #
281 # classes.cgi
282 #
283
284 classes.cgi: classes.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
285 echo Linking $@...
286 $(CC) $(LDFLAGS) -o $@ classes.o -lcupscgi $(LIBS)
287
288
289 #
290 # help.cgi
291 #
292
293 help.cgi: help.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
294 echo Linking $@...
295 $(CC) $(LDFLAGS) -o $@ help.o -lcupscgi $(LIBS)
296
297
298 #
299 # jobs.cgi
300 #
301
302 jobs.cgi: jobs.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
303 echo Linking $@...
304 $(CC) $(LDFLAGS) -o $@ jobs.o -lcupscgi $(LIBS)
305
306
307 #
308 # makedocset
309 #
310
311 makedocset: makedocset.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
312 echo Linking $@...
313 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ makedocset.o libcupscgi.a \
314 ../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
315 $(LIBZ) $(LIBGSSAPI)
316
317
318 #
319 # printers.cgi
320 #
321
322 printers.cgi: printers.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
323 echo Linking $@...
324 $(CC) $(LDFLAGS) -o $@ printers.o -L. -lcupscgi $(LIBS)
325
326
327 #
328 # testcgi
329 #
330
331 testcgi: testcgi.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
332 echo Linking $@...
333 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testcgi.o libcupscgi.a \
334 ../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
335 $(LIBZ) $(LIBGSSAPI)
336 echo Testing CGI API...
337 ./testcgi
338
339
340 #
341 # testhi
342 #
343
344 testhi: testhi.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
345 echo Linking $@...
346 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testhi.o libcupscgi.a \
347 ../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
348 $(LIBZ) $(LIBGSSAPI)
349 echo Testing help index API...
350 ./testhi
351
352
353 #
354 # testtemplate
355 #
356
357 testtemplate: testtemplate.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
358 echo Linking $@...
359 $(CC) $(LDFLAGS) -o $@ testtemplate.o libcupscgi.a ../cups/$(LIBCUPSSTATIC) \
360 $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) $(LIBZ) $(LIBGSSAPI)
361
362
363 #
364 # websearch
365 #
366
367 websearch: websearch.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
368 echo Linking $@...
369 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ websearch.o libcupscgi.a \
370 ../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
371 $(LIBZ) $(LIBGSSAPI)
372
373
374 #
375 # Dependencies...
376 #
377
378 include Dependencies
379
380
381 #
382 # End of "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $".
383 #