2 # "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $"
4 # CGI makefile for the Common UNIX Printing System (CUPS).
6 # Copyright 2007-2008 by Apple Inc.
7 # Copyright 1997-2006 by Easy Software Products.
9 # These coded instructions, statements, and computer programs are the
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/".
65 # Make library targets...
68 libs
: $(LIBTARGETS
) $(UNITTESTS
)
75 unittests
: $(UNITTARGETS
)
79 # Clean all object files...
83 $(RM
) $(OBJS
) $(TARGETS
) $(UNITTARGETS
)
84 $(RM
) libcupscgi.so libcupscgi.sl libcupscgi.dylib
88 # Update dependencies (without system header dependencies...)
92 makedepend
-Y
-I..
-fDependencies
$(OBJS
:.o
=.c
) >/dev
/null
2>&1
96 # Install all targets...
99 install: all install-data install-headers install-libs install-exec
103 # Install data files...
110 # Install programs...
114 $(INSTALL_DIR
) -m
755 $(SERVERBIN
)/cgi-bin
115 for file in
$(CGIS
); do \
116 $(INSTALL_BIN
) $$file $(SERVERBIN
)/cgi-bin
; \
118 if
test "x$(SYMROOT)" != "x"; then \
119 $(INSTALL_DIR
) $(SYMROOT
); \
120 for file in
$(TARGETS
); do \
121 cp
$$file $(SYMROOT
); \
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
138 # Install libraries...
141 install-libs
: $(INSTALLSTATIC
)
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`; \
149 if
test $(LIBCUPSCGI
) = "libcupscgi.1.dylib"; then \
150 $(RM
) $(LIBDIR
)/libcupscgi.dylib
; \
151 $(LN
) $(LIBCUPSCGI
) $(LIBDIR
)/libcupscgi.dylib
; \
153 if
test "x$(SYMROOT)" != "x"; then \
154 $(INSTALL_DIR
) $(SYMROOT
); \
155 cp
$(LIBCUPSCGI
) $(SYMROOT
); \
159 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
160 $(INSTALL_LIB
) libcupscgi.a
$(LIBDIR
)
161 $(RANLIB
) $(LIBDIR
)/libcupscgi.a
165 # Uninstall all targets...
169 for file in
$(CGIS
); do \
170 $(RM
) $(SERVERBIN
)/cgi-bin
/$$file; \
172 -$(RMDIR
) $(SERVERBIN
)/cgi-bin
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
182 $(RM
) $(INCLUDEDIR
)/cups
/cgi.h
183 $(RM
) $(INCLUDEDIR
)/cups
/help-index.h
184 -$(RMDIR
) $(INCLUDEDIR
)/cups
188 # Automatic API help files...
192 mxmldoc
--section
"Programming" \
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
199 mxmldoc
--framed api-cgi \
200 --section
"Programming" \
202 --css ..
/doc
/cups-printable.css \
203 --header api-cgi.header
--intro api-cgi.shtml \
204 cgi.h help-index.h
$(LIBOBJS
:.o
=.c
)
208 # libcupscgi.so.1, libcupscgi.sl.1
211 libcupscgi.so
.1 libcupscgi.sl
.1: $(LIBOBJS
)
213 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
) $(LIBS
)
214 $(RM
) `basename $@ .1`
215 $(LN
) $@
`basename $@ .1`
222 libcupscgi
.1.dylib
: $(LIBOBJS
) libcupscgi.exp
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 \
230 $(RM
) libcupscgi.dylib
231 $(LN
) $@ libcupscgi.dylib
238 libcupscgi_s.a
: $(LIBOBJS
)
240 $(DSO
) $(DSOFLAGS
) -o libcupscgi_s.o
$(LIBOBJS
) $(LIBS
)
242 $(AR
) $(ARFLAGS
) $@ libcupscgi_s.o
249 libcupscgi.la
: $(LIBOBJS
)
251 $(CC
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
:.o
=.lo
) -rpath
$(LIBDIR
) \
252 -version-info
1:0 $(LIBS
)
259 libcupscgi.a
: $(LIBOBJS
)
262 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
270 admin.cgi
: admin.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
272 $(CC
) $(LDFLAGS
) -o
$@ admin.o
-lcupscgi
$(LIBS
)
279 classes.cgi
: classes.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
281 $(CC
) $(LDFLAGS
) -o
$@ classes.o
-lcupscgi
$(LIBS
)
288 help.cgi
: help.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
290 $(CC
) $(LDFLAGS
) -o
$@ help.o
-lcupscgi
$(LIBS
)
297 jobs.cgi
: jobs.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
299 $(CC
) $(LDFLAGS
) -o
$@ jobs.o
-lcupscgi
$(LIBS
)
306 printers.cgi
: printers.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
308 $(CC
) $(LDFLAGS
) -o
$@ printers.o
-L.
-lcupscgi
$(LIBS
)
315 testcgi
: testcgi.o ..
/Makedefs libcupscgi.a ..
/cups
/libcups.a
317 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testcgi.o libcupscgi.a \
318 ..
/cups
/libcups.a
$(COMMONLIBS
) $(SSLLIBS
) $(LIBZ
) $(LIBGSSAPI
)
319 echo Testing CGI API...
327 testhi
: testhi.o ..
/Makedefs libcupscgi.a ..
/cups
/libcups.a
329 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testhi.o libcupscgi.a \
330 ..
/cups
/libcups.a
$(COMMONLIBS
) $(SSLLIBS
) $(LIBZ
) $(LIBGSSAPI
)
331 echo Testing help index API...
339 testtemplate
: testtemplate.o ..
/Makedefs libcupscgi.a ..
/cups
/libcups.a
341 $(CC
) $(LDFLAGS
) -o
$@ testtemplate.o libcupscgi.a ..
/cups
/libcups.a \
342 $(COMMONLIBS
) $(SSLLIBS
) $(LIBZ
) $(LIBGSSAPI
)
349 websearch
: websearch.o ..
/Makedefs libcupscgi.a ..
/cups
/libcups.a
351 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ websearch.o libcupscgi.a \
352 ..
/cups
/libcups.a
$(COMMONLIBS
) $(SSLLIBS
) $(LIBZ
) $(LIBGSSAPI
)
363 # End of "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $".