2 # "$Id: Makefile 6649 2007-07-11 21:46:42Z 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/".
25 LIB32OBJS
= $(LIBOBJS
:.o
=.32.o
)
26 LIB64OBJS
= $(LIBOBJS
:.o
=.64.o
)
67 # Make library targets...
74 # Clean all object files...
78 $(RM
) $(OBJS
) $(TARGETS
)
79 $(RM
) libcupscgi.so libcupscgi.sl libcupscgi.dylib
84 # Update dependencies (without system header dependencies...)
88 touch Dependencies.tmp
89 makedepend
-Y
-I..
-fDependencies.tmp
$(OBJS
:.o
=.c
) >/dev
/null
2>&1
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
98 # Install all targets...
101 install: all install-data install-headers install-libs install-exec
105 # Install data files...
112 # Install programs...
116 $(INSTALL_DIR
) -m
755 $(SERVERBIN
)/cgi-bin
117 for file in
$(CGIS
); do \
118 $(INSTALL_BIN
) $$file $(SERVERBIN
)/cgi-bin
; \
120 if
test "x$(SYMROOT)" != "x"; then \
121 $(INSTALL_DIR
) $(SYMROOT
); \
122 for file in
$(TARGETS
); do \
123 cp
$$file $(SYMROOT
); \
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
140 # Install libraries...
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`; \
151 if
test $(LIBCUPSCGI
) = "libcupscgi.1.dylib"; then \
152 $(RM
) $(LIBDIR
)/libcupscgi.dylib
; \
153 $(LN
) $(LIBCUPSCGI
) $(LIBDIR
)/libcupscgi.dylib
; \
155 if
test "x$(SYMROOT)" != "x"; then \
156 $(INSTALL_DIR
) $(SYMROOT
); \
157 cp
$(LIBCUPSCGI
) $(SYMROOT
); \
161 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
162 $(INSTALL_LIB
) libcupscgi.a
$(LIBDIR
)
163 $(RANLIB
) $(LIBDIR
)/libcupscgi.a
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
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
179 # Uninstall all targets...
182 uninstall: $(UNINSTALL32
) $(UNINSTALL64
)
183 for file in
$(CGIS
); do \
184 $(RM
) $(SERVERBIN
)/cgi-bin
/$$file; \
186 -$(RMDIR
) $(SERVERBIN
)/cgi-bin
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
196 $(RM
) $(INCLUDEDIR
)/cups
/cgi.h
197 $(RM
) $(INCLUDEDIR
)/cups
/help-index.h
198 -$(RMDIR
) $(INCLUDEDIR
)/cups
201 $(RM
) $(LIB32DIR
)/libcupscgi.so
202 $(RM
) $(LIB32DIR
)/libcupscgi.so
.1
203 -$(RMDIR
) $(LIB32DIR
)
206 $(RM
) $(LIB64DIR
)/libcupscgi.so
207 $(RM
) $(LIB64DIR
)/libcupscgi.so
.1
208 -$(RMDIR
) $(LIB64DIR
)
212 # Automatic API help files...
216 mxmldoc
--section
"Programming" \
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
223 mxmldoc
--framed api-cgi \
224 --section
"Programming" \
226 --css ..
/doc
/cups-printable.css \
227 --header api-cgi.header
--intro api-cgi.shtml \
228 cgi.h help-index.h
$(LIBOBJS
:.o
=.c
)
232 # libcupscgi.so.1, libcupscgi.sl.1
235 libcupscgi.so
.1 libcupscgi.sl
.1: $(LIBOBJS
)
237 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
) $(LIBS
)
238 $(RM
) `basename $@ .1`
239 $(LN
) $@
`basename $@ .1`
243 # 32bit/libcupscgi.so.1
246 32bit
/libcupscgi.so
.1: $(LIB32OBJS
)
247 echo Linking
32-bit
$@...
249 $(DSO
) $(ARCH32FLAGS
) $(DSO32FLAGS
) -o
$@
$(LIB32OBJS
) $(LIBS
)
250 $(RM
) 32bit
/libcupscgi.so
251 $(LN
) libcupscgi.so
.1 32bit
/libcupscgi.so
255 # 64bit/libcupscgi.so.1
258 64bit
/libcupscgi.so
.1: $(LIB64OBJS
)
259 echo Linking
64-bit
$@...
261 $(DSO
) $(ARCH64FLAGS
) $(DSO64FLAGS
) -o
$@
$(LIB64OBJS
) $(LIBS
)
262 $(RM
) 64bit
/libcupscgi.so
263 $(LN
) libcupscgi.so
.1 64bit
/libcupscgi.so
270 libcupscgi
.1.dylib
: $(LIBOBJS
) libcupscgi.exp
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 \
278 $(RM
) libcupscgi.dylib
279 $(LN
) $@ libcupscgi.dylib
286 libcupscgi_s.a
: $(LIBOBJS
)
288 $(DSO
) $(DSOFLAGS
) -o libcupscgi_s.o
$(LIBOBJS
) $(LIBS
)
290 $(AR
) $(ARFLAGS
) $@ libcupscgi_s.o
297 libcupscgi.la
: $(LIBOBJS
)
299 $(CC
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
:.o
=.lo
) -rpath
$(LIBDIR
) \
300 -version-info
1:0 $(LIBS
)
307 libcupscgi.a
: $(LIBOBJS
)
310 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
318 admin.cgi
: admin.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
320 $(CC
) $(LDFLAGS
) -o
$@ admin.o
-L.
-lcupscgi
$(LIBS
)
327 classes.cgi
: classes.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
329 $(CC
) $(LDFLAGS
) -o
$@ classes.o
-L.
-lcupscgi
$(LIBS
)
336 help.cgi
: help.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
338 $(CC
) $(LDFLAGS
) -o
$@ help.o
-L.
-lcupscgi
$(LIBS
)
345 jobs.cgi
: jobs.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
347 $(CC
) $(LDFLAGS
) -o
$@ jobs.o
-L.
-lcupscgi
$(LIBS
)
354 printers.cgi
: printers.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
356 $(CC
) $(LDFLAGS
) -o
$@ printers.o
-L.
-lcupscgi
$(LIBS
)
363 testcgi
: testcgi.o ..
/Makedefs libcupscgi.a ..
/cups
/libcups.a
365 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testcgi.o libcupscgi.a \
366 ..
/cups
/libcups.a
$(COMMONLIBS
) $(SSLLIBS
) $(LIBZ
) $(LIBGSSAPI
)
367 echo Testing CGI API...
375 testhi
: testhi.o ..
/Makedefs libcupscgi.a ..
/cups
/libcups.a
377 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testhi.o libcupscgi.a \
378 ..
/cups
/libcups.a
$(COMMONLIBS
) $(SSLLIBS
) $(LIBZ
) $(LIBGSSAPI
)
379 echo Testing help index API...
387 testtemplate
: testtemplate.o ..
/Makedefs libcupscgi.a ..
/cups
/libcups.a
389 $(CC
) $(LDFLAGS
) -o
$@ testtemplate.o libcupscgi.a ..
/cups
/libcups.a \
390 $(COMMONLIBS
) $(SSLLIBS
) $(LIBZ
) $(LIBGSSAPI
)
401 # End of "$Id: Makefile 6649 2007-07-11 21:46:42Z mike $".