]> git.ipfire.org Git - thirdparty/cups.git/blob - cgi-bin/Makefile
6bc1dbaebf38eb0b8f5f704045a71c879b70a073
[thirdparty/cups.git] / cgi-bin / Makefile
1 #
2 # CGI makefile for CUPS.
3 #
4 # Copyright 2007-2016 by Apple Inc.
5 # Copyright 1997-2006 by Easy Software Products.
6 #
7 # These coded instructions, statements, and computer programs are the
8 # property of Apple Inc. and are protected by Federal copyright
9 # law. Distribution and use rights are outlined in the file "LICENSE.txt"
10 # which should have been included with this file. If this file is
11 # file is missing or damaged, see the license at "http://www.cups.org/".
12 #
13
14 include ../Makedefs
15
16 LIBOBJS = \
17 help-index.o \
18 html.o \
19 ipp-var.o \
20 search.o \
21 template.o \
22 var.o
23 OBJS = \
24 $(LIBOBJS) \
25 admin.o \
26 classes.o \
27 help.o \
28 jobs.o \
29 makedocset.o \
30 printers.o \
31 testcgi.o \
32 testhi.o \
33 testtemplate.o
34 CGIS = \
35 admin.cgi \
36 classes.cgi \
37 help.cgi \
38 jobs.cgi \
39 printers.cgi
40 LIBTARGETS = \
41 libcupscgi.a \
42 $(LIBCUPSCGI)
43
44 UNITTARGETS = \
45 testcgi \
46 testhi \
47 testtemplate
48
49 TARGETS = \
50 $(LIBTARGETS) \
51 $(CGIS)
52
53
54 #
55 # Make all targets...
56 #
57
58 all: $(TARGETS)
59
60
61 #
62 # Make library targets...
63 #
64
65 libs: $(LIBTARGETS) $(UNITTESTS)
66
67
68 #
69 # Make unit tests...
70 #
71
72 unittests: $(UNITTARGETS)
73
74
75 #
76 # Clean all object files...
77 #
78
79 clean:
80 $(RM) $(OBJS) $(TARGETS) $(UNITTARGETS) makedocset
81 $(RM) libcupscgi.so libcupscgi.dylib
82
83
84 #
85 # Update dependencies (without system header dependencies...)
86 #
87
88 depend:
89 $(CC) -MM $(ALL_CFLAGS) $(OBJS:.o=.c) >Dependencies
90
91
92 #
93 # Install all targets...
94 #
95
96 install: all install-data install-headers install-libs install-exec
97
98
99 #
100 # Install data files...
101 #
102
103 install-data:
104
105
106 #
107 # Install programs...
108 #
109
110 install-exec:
111 $(INSTALL_DIR) -m 755 $(SERVERBIN)/cgi-bin
112 for file in $(CGIS); do \
113 $(INSTALL_BIN) $$file $(SERVERBIN)/cgi-bin; \
114 done
115 if test "x$(SYMROOT)" != "x"; then \
116 $(INSTALL_DIR) $(SYMROOT); \
117 for file in $(CGIS); do \
118 cp $$file $(SYMROOT); \
119 dsymutil $(SYMROOT)/$$file; \
120 done \
121 fi
122
123
124 #
125 # Install headers...
126 #
127
128 install-headers:
129 if test "x$(privateinclude)" != x; then \
130 echo Installing private header files into $(PRIVATEINCLUDE)...; \
131 $(INSTALL_DIR) -m 755 $(PRIVATEINCLUDE); \
132 for file in cgi.h help-index.h; do \
133 $(INSTALL_DATA) $$file $(PRIVATEINCLUDE); \
134 done; \
135 fi
136
137
138 #
139 # Install libraries...
140 #
141
142 install-libs: $(INSTALLSTATIC)
143 echo Installing libraries in $(LIBDIR)...
144 $(INSTALL_DIR) -m 755 $(LIBDIR)
145 $(INSTALL_LIB) $(LIBCUPSCGI) $(LIBDIR)
146 if test $(LIBCUPSCGI) = "libcupscgi.so.1"; then \
147 $(RM) $(LIBDIR)/`basename $(LIBCUPSCGI) .1`; \
148 $(LN) $(LIBCUPSCGI) $(LIBDIR)/`basename $(LIBCUPSCGI) .1`; \
149 fi
150 if test $(LIBCUPSCGI) = "libcupscgi.1.dylib"; then \
151 $(RM) $(LIBDIR)/libcupscgi.dylib; \
152 $(LN) $(LIBCUPSCGI) $(LIBDIR)/libcupscgi.dylib; \
153 fi
154 if test "x$(SYMROOT)" != "x"; then \
155 $(INSTALL_DIR) $(SYMROOT); \
156 cp $(LIBCUPSCGI) $(SYMROOT); \
157 dsymutil $(SYMROOT)/$(LIBCUPSCGI); \
158 fi
159
160 installstatic:
161 $(INSTALL_DIR) -m 755 $(LIBDIR)
162 $(INSTALL_LIB) -m 755 libcupscgi.a $(LIBDIR)
163 $(RANLIB) $(LIBDIR)/libcupscgi.a
164 $(CHMOD) 555 $(LIBDIR)/libcupscgi.a
165
166
167 #
168 # Uninstall all targets...
169 #
170
171 uninstall:
172 for file in $(CGIS); do \
173 $(RM) $(SERVERBIN)/cgi-bin/$$file; \
174 done
175 -$(RMDIR) $(SERVERBIN)/cgi-bin
176 $(RM) $(LIBDIR)/libcupscgi.1.dylib
177 $(RM) $(LIBDIR)/libcupscgi.a
178 $(RM) $(LIBDIR)/libcupscgi.dylib
179 $(RM) $(LIBDIR)/libcupscgi.so
180 $(RM) $(LIBDIR)/libcupscgi.so.1
181 -$(RMDIR) $(LIBDIR)
182 -if test "x$(privateinclude)" != x; then \
183 $(RM) $(PRIVATEINCLUDE)/cgi.h; \
184 $(RM) $(PRIVATEINCLUDE)/help-index.h; \
185 $(RMDIR) $(PRIVATEINCLUDE); \
186 fi
187
188
189 #
190 # libcupscgi.so.1
191 #
192
193 libcupscgi.so.1: $(LIBOBJS)
194 echo Linking $@...
195 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBS)
196 $(RM) `basename $@ .1`
197 $(LN) $@ `basename $@ .1`
198
199
200 #
201 # libcupscgi.1.dylib
202 #
203
204 libcupscgi.1.dylib: $(LIBOBJS) libcupscgi.exp
205 echo Linking $@...
206 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
207 -install_name $(libdir)/$@ \
208 -current_version 1.0.0 \
209 -compatibility_version 1.0.0 \
210 -exported_symbols_list libcupscgi.exp \
211 $(LIBOBJS) $(LIBS)
212 $(RM) libcupscgi.dylib
213 $(LN) $@ libcupscgi.dylib
214
215
216 #
217 # libcupscgi.la
218 #
219
220 libcupscgi.la: $(LIBOBJS)
221 echo Linking $@...
222 $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
223 -version-info 1:0 $(LIBS)
224
225
226 #
227 # libcupscgi.a
228 #
229
230 libcupscgi.a: $(LIBOBJS)
231 echo Archiving $@...
232 $(RM) $@
233 $(AR) $(ARFLAGS) $@ $(LIBOBJS)
234 $(RANLIB) $@
235
236
237 #
238 # admin.cgi
239 #
240
241 admin.cgi: admin.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
242 echo Linking $@...
243 $(CC) $(LDFLAGS) -o $@ admin.o -lcupscgi $(LIBS)
244
245
246 #
247 # classes.cgi
248 #
249
250 classes.cgi: classes.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
251 echo Linking $@...
252 $(CC) $(LDFLAGS) -o $@ classes.o -lcupscgi $(LIBS)
253
254
255 #
256 # help.cgi
257 #
258
259 help.cgi: help.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
260 echo Linking $@...
261 $(CC) $(LDFLAGS) -o $@ help.o -lcupscgi $(LIBS)
262
263
264 #
265 # jobs.cgi
266 #
267
268 jobs.cgi: jobs.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
269 echo Linking $@...
270 $(CC) $(LDFLAGS) -o $@ jobs.o -lcupscgi $(LIBS)
271
272
273 #
274 # makedocset
275 #
276
277 makedocset: makedocset.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
278 echo Linking $@...
279 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ makedocset.o libcupscgi.a \
280 ../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
281 $(LIBZ) $(LIBGSSAPI)
282
283
284 #
285 # printers.cgi
286 #
287
288 printers.cgi: printers.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
289 echo Linking $@...
290 $(CC) $(LDFLAGS) -o $@ printers.o -L. -lcupscgi $(LIBS)
291
292
293 #
294 # testcgi
295 #
296
297 testcgi: testcgi.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
298 echo Linking $@...
299 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testcgi.o libcupscgi.a \
300 ../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
301 $(LIBZ) $(LIBGSSAPI)
302 echo Testing CGI API...
303 ./testcgi
304
305
306 #
307 # testhi
308 #
309
310 testhi: testhi.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
311 echo Linking $@...
312 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testhi.o libcupscgi.a \
313 ../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
314 $(LIBZ) $(LIBGSSAPI)
315 echo Testing help index API...
316 ./testhi
317
318
319 #
320 # testtemplate
321 #
322
323 testtemplate: testtemplate.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
324 echo Linking $@...
325 $(CC) $(LDFLAGS) -o $@ testtemplate.o libcupscgi.a ../cups/$(LIBCUPSSTATIC) \
326 $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) $(LIBZ) $(LIBGSSAPI)
327
328
329 #
330 # Dependencies...
331 #
332
333 include Dependencies