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