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