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