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