]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | # |
b19ccc9e | 2 | # "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $" |
ef416fc2 | 3 | # |
4 | # CGI makefile for the Common UNIX Printing System (CUPS). | |
5 | # | |
50fe7201 | 6 | # Copyright 2007-2008 by Apple Inc. |
bd7854cb | 7 | # Copyright 1997-2006 by Easy Software Products. |
ef416fc2 | 8 | # |
9 | # These coded instructions, statements, and computer programs are the | |
bc44d920 | 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/". | |
ef416fc2 | 14 | # |
15 | ||
16 | include ../Makedefs | |
17 | ||
50fe7201 MS |
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 \ | |
1f0275e3 MS |
38 | testtemplate.o \ |
39 | websearch.o | |
50fe7201 MS |
40 | CGIS = \ |
41 | admin.cgi \ | |
42 | classes.cgi \ | |
43 | help.cgi \ | |
44 | jobs.cgi \ | |
45 | printers.cgi | |
c9fc04c6 | 46 | LIBTARGETS = \ |
50fe7201 MS |
47 | libcupscgi.a \ |
48 | $(LIBCUPSCGI) \ | |
49 | $(LIB32CUPSCGI) \ | |
50 | $(LIB32CUPSCGI) \ | |
5f64df29 MS |
51 | websearch |
52 | ||
53 | UNITTARGETS = \ | |
50fe7201 | 54 | testcgi \ |
1f0275e3 | 55 | testhi \ |
5f64df29 | 56 | testtemplate |
c9fc04c6 MS |
57 | |
58 | TARGETS = \ | |
59 | $(LIBTARGETS) \ | |
5f64df29 | 60 | $(CGIS) |
ef416fc2 | 61 | |
62 | ||
63 | # | |
64 | # Make all targets... | |
65 | # | |
66 | ||
67 | all: $(TARGETS) | |
68 | ||
69 | ||
c9fc04c6 MS |
70 | # |
71 | # Make library targets... | |
72 | # | |
73 | ||
5f64df29 MS |
74 | libs: $(LIBTARGETS) $(UNITTESTS) |
75 | ||
76 | ||
77 | # | |
78 | # Make unit tests... | |
79 | # | |
80 | ||
81 | unittests: $(UNITTARGETS) | |
c9fc04c6 MS |
82 | |
83 | ||
ef416fc2 | 84 | # |
85 | # Clean all object files... | |
86 | # | |
87 | ||
88 | clean: | |
5f64df29 | 89 | $(RM) $(OBJS) $(TARGETS) $(UNITTARGETS) |
50fe7201 MS |
90 | $(RM) libcupscgi.so libcupscgi.sl libcupscgi.dylib |
91 | $(RM) -r 32bit 64bit | |
ef416fc2 | 92 | |
93 | ||
94 | # | |
95 | # Update dependencies (without system header dependencies...) | |
96 | # | |
97 | ||
98 | depend: | |
50fe7201 MS |
99 | touch Dependencies.tmp |
100 | makedepend -Y -I.. -fDependencies.tmp $(OBJS:.o=.c) >/dev/null 2>&1 | |
101 | $(RM) Dependencies | |
102 | cp Dependencies.tmp Dependencies | |
103 | sed -E -e '1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp >>Dependencies | |
104 | sed -E -e '1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp >>Dependencies | |
105 | $(RM) Dependencies.tmp | |
ef416fc2 | 106 | |
107 | ||
108 | # | |
109 | # Install all targets... | |
110 | # | |
111 | ||
50fe7201 MS |
112 | install: all install-data install-headers install-libs install-exec |
113 | ||
114 | ||
115 | # | |
116 | # Install data files... | |
117 | # | |
118 | ||
119 | install-data: | |
120 | ||
121 | ||
122 | # | |
123 | # Install programs... | |
124 | # | |
125 | ||
126 | install-exec: | |
bd7854cb | 127 | $(INSTALL_DIR) -m 755 $(SERVERBIN)/cgi-bin |
ef416fc2 | 128 | for file in $(CGIS); do \ |
129 | $(INSTALL_BIN) $$file $(SERVERBIN)/cgi-bin; \ | |
130 | done | |
09a101d6 | 131 | if test "x$(SYMROOT)" != "x"; then \ |
132 | $(INSTALL_DIR) $(SYMROOT); \ | |
133 | for file in $(TARGETS); do \ | |
134 | cp $$file $(SYMROOT); \ | |
135 | done \ | |
136 | fi | |
ef416fc2 | 137 | |
138 | ||
50fe7201 MS |
139 | # |
140 | # Install headers... | |
141 | # | |
142 | ||
143 | install-headers: | |
144 | echo Installing header files in $(INCLUDEDIR)/cups... | |
145 | $(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups | |
146 | $(INSTALL_DATA) cgi.h $(INCLUDEDIR)/cups | |
147 | $(INSTALL_DATA) help-index.h $(INCLUDEDIR)/cups | |
148 | ||
149 | ||
150 | # | |
151 | # Install libraries... | |
152 | # | |
153 | ||
154 | install-libs: $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64) | |
155 | echo Installing libraries in $(LIBDIR)... | |
156 | $(INSTALL_DIR) -m 755 $(LIBDIR) | |
157 | $(INSTALL_LIB) $(LIBCUPSCGI) $(LIBDIR) | |
158 | if test $(LIBCUPSCGI) = "libcupscgi.so.1" -o $(LIBCUPSCGI) = "libcupscgi.sl.1"; then \ | |
159 | $(RM) $(LIBDIR)/`basename $(LIBCUPSCGI) .1`; \ | |
160 | $(LN) $(LIBCUPSCGI) $(LIBDIR)/`basename $(LIBCUPSCGI) .1`; \ | |
161 | fi | |
162 | if test $(LIBCUPSCGI) = "libcupscgi.1.dylib"; then \ | |
50fe7201 MS |
163 | $(RM) $(LIBDIR)/libcupscgi.dylib; \ |
164 | $(LN) $(LIBCUPSCGI) $(LIBDIR)/libcupscgi.dylib; \ | |
165 | fi | |
166 | if test "x$(SYMROOT)" != "x"; then \ | |
167 | $(INSTALL_DIR) $(SYMROOT); \ | |
168 | cp $(LIBCUPSCGI) $(SYMROOT); \ | |
169 | fi | |
170 | ||
171 | installstatic: | |
172 | $(INSTALL_DIR) -m 755 $(LIBDIR) | |
173 | $(INSTALL_LIB) libcupscgi.a $(LIBDIR) | |
174 | $(RANLIB) $(LIBDIR)/libcupscgi.a | |
175 | ||
176 | install32bit: | |
177 | echo Installing libraries in $(LIB32DIR)... | |
178 | $(INSTALL_DIR) -m 755 $(LIB32DIR) | |
179 | $(INSTALL_LIB) 32bit/libcupscgi.so.1 $(LIB32DIR)/libcupscgi.so.1 | |
180 | $(LN) libcupscgi.so.1 $(LIB32DIR)/libcupscgi.so | |
181 | ||
182 | install64bit: | |
183 | echo Installing libraries in $(LIB64DIR)... | |
184 | $(INSTALL_DIR) -m 755 $(LIB64DIR) | |
185 | $(INSTALL_LIB) 64bit/libcupscgi.so.1 $(LIB64DIR)/libcupscgi.so.1 | |
186 | $(LN) libcupscgi.so.1 $(LIB64DIR)/libcupscgi.so | |
187 | ||
188 | ||
757d2cad | 189 | # |
190 | # Uninstall all targets... | |
191 | # | |
192 | ||
50fe7201 | 193 | uninstall: $(UNINSTALL32) $(UNINSTALL64) |
757d2cad | 194 | for file in $(CGIS); do \ |
195 | $(RM) $(SERVERBIN)/cgi-bin/$$file; \ | |
196 | done | |
197 | -$(RMDIR) $(SERVERBIN)/cgi-bin | |
50fe7201 MS |
198 | $(RM) $(LIBDIR)/libcupscgi.1.dylib |
199 | $(RM) $(LIBDIR)/libcupscgi.a | |
200 | $(RM) $(LIBDIR)/libcupscgi.dylib | |
201 | $(RM) $(LIBDIR)/libcupscgi_s.a | |
202 | $(RM) $(LIBDIR)/libcupscgi.sl | |
203 | $(RM) $(LIBDIR)/libcupscgi.sl.1 | |
204 | $(RM) $(LIBDIR)/libcupscgi.so | |
205 | $(RM) $(LIBDIR)/libcupscgi.so.1 | |
206 | -$(RMDIR) $(LIBDIR) | |
207 | $(RM) $(INCLUDEDIR)/cups/cgi.h | |
208 | $(RM) $(INCLUDEDIR)/cups/help-index.h | |
209 | -$(RMDIR) $(INCLUDEDIR)/cups | |
210 | ||
211 | uninstall32bit: | |
212 | $(RM) $(LIB32DIR)/libcupscgi.so | |
213 | $(RM) $(LIB32DIR)/libcupscgi.so.1 | |
214 | -$(RMDIR) $(LIB32DIR) | |
215 | ||
216 | uninstall64bit: | |
217 | $(RM) $(LIB64DIR)/libcupscgi.so | |
218 | $(RM) $(LIB64DIR)/libcupscgi.so.1 | |
219 | -$(RMDIR) $(LIB64DIR) | |
220 | ||
221 | ||
222 | # | |
223 | # Automatic API help files... | |
224 | # | |
225 | ||
226 | apihelp: | |
227 | mxmldoc --section "Programming" \ | |
228 | --title "CGI API" \ | |
229 | --css ../doc/cups-printable.css \ | |
230 | --header api-cgi.header --intro api-cgi.shtml \ | |
231 | cgi.h help-index.h $(LIBOBJS:.o=.c) >../doc/help/api-cgi.html | |
232 | ||
233 | framedhelp: | |
234 | mxmldoc --framed api-cgi \ | |
235 | --section "Programming" \ | |
236 | --title "CGI API" \ | |
237 | --css ../doc/cups-printable.css \ | |
238 | --header api-cgi.header --intro api-cgi.shtml \ | |
239 | cgi.h help-index.h $(LIBOBJS:.o=.c) | |
240 | ||
241 | ||
242 | # | |
243 | # libcupscgi.so.1, libcupscgi.sl.1 | |
244 | # | |
245 | ||
246 | libcupscgi.so.1 libcupscgi.sl.1: $(LIBOBJS) | |
247 | echo Linking $@... | |
248 | $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBS) | |
249 | $(RM) `basename $@ .1` | |
250 | $(LN) $@ `basename $@ .1` | |
251 | ||
252 | ||
253 | # | |
254 | # 32bit/libcupscgi.so.1 | |
255 | # | |
256 | ||
257 | 32bit/libcupscgi.so.1: $(LIB32OBJS) | |
258 | echo Linking 32-bit $@... | |
259 | -mkdir 32bit | |
260 | $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(LIB32OBJS) $(LIBS) | |
261 | $(RM) 32bit/libcupscgi.so | |
262 | $(LN) libcupscgi.so.1 32bit/libcupscgi.so | |
263 | ||
264 | ||
265 | # | |
266 | # 64bit/libcupscgi.so.1 | |
267 | # | |
268 | ||
269 | 64bit/libcupscgi.so.1: $(LIB64OBJS) | |
270 | echo Linking 64-bit $@... | |
271 | -mkdir 64bit | |
272 | $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(LIB64OBJS) $(LIBS) | |
273 | $(RM) 64bit/libcupscgi.so | |
274 | $(LN) libcupscgi.so.1 64bit/libcupscgi.so | |
275 | ||
276 | ||
277 | # | |
278 | # libcupscgi.1.dylib | |
279 | # | |
280 | ||
281 | libcupscgi.1.dylib: $(LIBOBJS) libcupscgi.exp | |
282 | echo Linking $@... | |
283 | $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \ | |
284 | -install_name $(libdir)/$@ \ | |
285 | -current_version 1.0.0 \ | |
286 | -compatibility_version 1.0.0 \ | |
287 | -exported_symbols_list libcupscgi.exp \ | |
288 | $(LIBOBJS) $(LIBS) | |
289 | $(RM) libcupscgi.dylib | |
290 | $(LN) $@ libcupscgi.dylib | |
291 | ||
292 | ||
293 | # | |
294 | # libcupscgi_s.a | |
295 | # | |
296 | ||
297 | libcupscgi_s.a: $(LIBOBJS) | |
298 | echo Creating $@... | |
299 | $(DSO) $(DSOFLAGS) -o libcupscgi_s.o $(LIBOBJS) $(LIBS) | |
300 | $(RM) $@ | |
301 | $(AR) $(ARFLAGS) $@ libcupscgi_s.o | |
302 | ||
303 | ||
304 | # | |
305 | # libcupscgi.la | |
306 | # | |
307 | ||
308 | libcupscgi.la: $(LIBOBJS) | |
309 | echo Linking $@... | |
310 | $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \ | |
311 | -version-info 1:0 $(LIBS) | |
757d2cad | 312 | |
313 | ||
ef416fc2 | 314 | # |
50fe7201 | 315 | # libcupscgi.a |
ef416fc2 | 316 | # |
317 | ||
50fe7201 | 318 | libcupscgi.a: $(LIBOBJS) |
ef416fc2 | 319 | echo Archiving $@... |
320 | $(RM) $@ | |
321 | $(AR) $(ARFLAGS) $@ $(LIBOBJS) | |
322 | $(RANLIB) $@ | |
323 | ||
324 | ||
325 | # | |
326 | # admin.cgi | |
327 | # | |
328 | ||
50fe7201 | 329 | admin.cgi: admin.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI) |
ef416fc2 | 330 | echo Linking $@... |
50fe7201 | 331 | $(CC) $(LDFLAGS) -o $@ admin.o -L. -lcupscgi $(LIBS) |
ef416fc2 | 332 | |
333 | ||
334 | # | |
335 | # classes.cgi | |
336 | # | |
337 | ||
50fe7201 | 338 | classes.cgi: classes.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI) |
ef416fc2 | 339 | echo Linking $@... |
50fe7201 | 340 | $(CC) $(LDFLAGS) -o $@ classes.o -L. -lcupscgi $(LIBS) |
ef416fc2 | 341 | |
342 | ||
343 | # | |
344 | # help.cgi | |
345 | # | |
346 | ||
50fe7201 | 347 | help.cgi: help.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI) |
ef416fc2 | 348 | echo Linking $@... |
50fe7201 | 349 | $(CC) $(LDFLAGS) -o $@ help.o -L. -lcupscgi $(LIBS) |
ef416fc2 | 350 | |
351 | ||
352 | # | |
353 | # jobs.cgi | |
354 | # | |
355 | ||
50fe7201 | 356 | jobs.cgi: jobs.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI) |
ef416fc2 | 357 | echo Linking $@... |
50fe7201 | 358 | $(CC) $(LDFLAGS) -o $@ jobs.o -L. -lcupscgi $(LIBS) |
ef416fc2 | 359 | |
360 | ||
361 | # | |
362 | # printers.cgi | |
363 | # | |
364 | ||
50fe7201 | 365 | printers.cgi: printers.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI) |
ef416fc2 | 366 | echo Linking $@... |
50fe7201 | 367 | $(CC) $(LDFLAGS) -o $@ printers.o -L. -lcupscgi $(LIBS) |
ef416fc2 | 368 | |
369 | ||
370 | # | |
371 | # testcgi | |
372 | # | |
373 | ||
50fe7201 | 374 | testcgi: testcgi.o ../Makedefs libcupscgi.a ../cups/libcups.a |
ef416fc2 | 375 | echo Linking $@... |
c9fc04c6 MS |
376 | $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testcgi.o libcupscgi.a \ |
377 | ../cups/libcups.a $(COMMONLIBS) $(SSLLIBS) $(LIBZ) $(LIBGSSAPI) | |
378 | echo Testing CGI API... | |
379 | ./testcgi | |
ef416fc2 | 380 | |
381 | ||
382 | # | |
383 | # testhi | |
384 | # | |
385 | ||
50fe7201 | 386 | testhi: testhi.o ../Makedefs libcupscgi.a ../cups/libcups.a |
ef416fc2 | 387 | echo Linking $@... |
c9fc04c6 MS |
388 | $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testhi.o libcupscgi.a \ |
389 | ../cups/libcups.a $(COMMONLIBS) $(SSLLIBS) $(LIBZ) $(LIBGSSAPI) | |
390 | echo Testing help index API... | |
391 | ./testhi | |
ef416fc2 | 392 | |
393 | ||
bd7854cb | 394 | # |
395 | # testtemplate | |
396 | # | |
397 | ||
50fe7201 | 398 | testtemplate: testtemplate.o ../Makedefs libcupscgi.a ../cups/libcups.a |
bd7854cb | 399 | echo Linking $@... |
50fe7201 | 400 | $(CC) $(LDFLAGS) -o $@ testtemplate.o libcupscgi.a ../cups/libcups.a \ |
f7deaa1a | 401 | $(COMMONLIBS) $(SSLLIBS) $(LIBZ) $(LIBGSSAPI) |
bd7854cb | 402 | |
403 | ||
1f0275e3 MS |
404 | # |
405 | # websearch | |
406 | # | |
407 | ||
408 | websearch: websearch.o ../Makedefs libcupscgi.a ../cups/libcups.a | |
409 | echo Linking $@... | |
410 | $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ websearch.o libcupscgi.a \ | |
411 | ../cups/libcups.a $(COMMONLIBS) $(SSLLIBS) $(LIBZ) $(LIBGSSAPI) | |
412 | ||
413 | ||
ef416fc2 | 414 | # |
415 | # Dependencies... | |
416 | # | |
417 | ||
418 | include Dependencies | |
419 | ||
420 | ||
421 | # | |
b19ccc9e | 422 | # End of "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $". |
ef416fc2 | 423 | # |