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/".
25 LIB32OBJS
= $(LIBOBJS
:.o
=.32.o
)
26 LIB64OBJS
= $(LIBOBJS
:.o
=.64.o
)
71 # Make library targets...
74 libs
: $(LIBTARGETS
) $(UNITTESTS
)
81 unittests
: $(UNITTARGETS
)
85 # Clean all object files...
89 $(RM
) $(OBJS
) $(TARGETS
) $(UNITTARGETS
)
90 $(RM
) libcupscgi.so libcupscgi.sl libcupscgi.dylib
95 # Update dependencies (without system header dependencies...)
99 touch Dependencies.tmp
100 makedepend
-Y
-I..
-fDependencies.tmp
$(OBJS
:.o
=.c
) >/dev
/null
2>&1
102 cp Dependencies.tmp Dependencies
103 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp
>>Dependencies
104 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp
>>Dependencies
105 $(RM
) Dependencies.tmp
109 # Install all targets...
112 install: all install-data install-headers install-libs install-exec
116 # Install data files...
123 # Install programs...
127 $(INSTALL_DIR
) -m
755 $(SERVERBIN
)/cgi-bin
128 for file in
$(CGIS
); do \
129 $(INSTALL_BIN
) $$file $(SERVERBIN
)/cgi-bin
; \
131 if
test "x$(SYMROOT)" != "x"; then \
132 $(INSTALL_DIR
) $(SYMROOT
); \
133 for file in
$(TARGETS
); do \
134 cp
$$file $(SYMROOT
); \
144 echo Installing header files in
$(INCLUDEDIR
)/cups...
145 $(INSTALL_DIR
) -m
755 $(INCLUDEDIR
)/cups
146 $(INSTALL_DATA
) cgi.h
$(INCLUDEDIR
)/cups
147 $(INSTALL_DATA
) help-index.h
$(INCLUDEDIR
)/cups
151 # Install libraries...
154 install-libs
: $(INSTALLSTATIC
) $(INSTALL32
) $(INSTALL64
)
155 echo Installing libraries in
$(LIBDIR
)...
156 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
157 $(INSTALL_LIB
) $(LIBCUPSCGI
) $(LIBDIR
)
158 if
test $(LIBCUPSCGI
) = "libcupscgi.so.1" -o
$(LIBCUPSCGI
) = "libcupscgi.sl.1"; then \
159 $(RM
) $(LIBDIR
)/`basename $(LIBCUPSCGI) .1`; \
160 $(LN
) $(LIBCUPSCGI
) $(LIBDIR
)/`basename $(LIBCUPSCGI) .1`; \
162 if
test $(LIBCUPSCGI
) = "libcupscgi.1.dylib"; then \
163 $(RM
) $(LIBDIR
)/libcupscgi.dylib
; \
164 $(LN
) $(LIBCUPSCGI
) $(LIBDIR
)/libcupscgi.dylib
; \
166 if
test "x$(SYMROOT)" != "x"; then \
167 $(INSTALL_DIR
) $(SYMROOT
); \
168 cp
$(LIBCUPSCGI
) $(SYMROOT
); \
172 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
173 $(INSTALL_LIB
) libcupscgi.a
$(LIBDIR
)
174 $(RANLIB
) $(LIBDIR
)/libcupscgi.a
177 echo Installing libraries in
$(LIB32DIR
)...
178 $(INSTALL_DIR
) -m
755 $(LIB32DIR
)
179 $(INSTALL_LIB
) 32bit
/libcupscgi.so
.1 $(LIB32DIR
)/libcupscgi.so
.1
180 $(LN
) libcupscgi.so
.1 $(LIB32DIR
)/libcupscgi.so
183 echo Installing libraries in
$(LIB64DIR
)...
184 $(INSTALL_DIR
) -m
755 $(LIB64DIR
)
185 $(INSTALL_LIB
) 64bit
/libcupscgi.so
.1 $(LIB64DIR
)/libcupscgi.so
.1
186 $(LN
) libcupscgi.so
.1 $(LIB64DIR
)/libcupscgi.so
190 # Uninstall all targets...
193 uninstall: $(UNINSTALL32
) $(UNINSTALL64
)
194 for file in
$(CGIS
); do \
195 $(RM
) $(SERVERBIN
)/cgi-bin
/$$file; \
197 -$(RMDIR
) $(SERVERBIN
)/cgi-bin
198 $(RM
) $(LIBDIR
)/libcupscgi
.1.dylib
199 $(RM
) $(LIBDIR
)/libcupscgi.a
200 $(RM
) $(LIBDIR
)/libcupscgi.dylib
201 $(RM
) $(LIBDIR
)/libcupscgi_s.a
202 $(RM
) $(LIBDIR
)/libcupscgi.sl
203 $(RM
) $(LIBDIR
)/libcupscgi.sl
.1
204 $(RM
) $(LIBDIR
)/libcupscgi.so
205 $(RM
) $(LIBDIR
)/libcupscgi.so
.1
207 $(RM
) $(INCLUDEDIR
)/cups
/cgi.h
208 $(RM
) $(INCLUDEDIR
)/cups
/help-index.h
209 -$(RMDIR
) $(INCLUDEDIR
)/cups
212 $(RM
) $(LIB32DIR
)/libcupscgi.so
213 $(RM
) $(LIB32DIR
)/libcupscgi.so
.1
214 -$(RMDIR
) $(LIB32DIR
)
217 $(RM
) $(LIB64DIR
)/libcupscgi.so
218 $(RM
) $(LIB64DIR
)/libcupscgi.so
.1
219 -$(RMDIR
) $(LIB64DIR
)
223 # Automatic API help files...
227 mxmldoc
--section
"Programming" \
229 --css ..
/doc
/cups-printable.css \
230 --header api-cgi.header
--intro api-cgi.shtml \
231 cgi.h help-index.h
$(LIBOBJS
:.o
=.c
) >..
/doc
/help
/api-cgi.html
234 mxmldoc
--framed api-cgi \
235 --section
"Programming" \
237 --css ..
/doc
/cups-printable.css \
238 --header api-cgi.header
--intro api-cgi.shtml \
239 cgi.h help-index.h
$(LIBOBJS
:.o
=.c
)
243 # libcupscgi.so.1, libcupscgi.sl.1
246 libcupscgi.so
.1 libcupscgi.sl
.1: $(LIBOBJS
)
248 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
) $(LIBS
)
249 $(RM
) `basename $@ .1`
250 $(LN
) $@
`basename $@ .1`
254 # 32bit/libcupscgi.so.1
257 32bit
/libcupscgi.so
.1: $(LIB32OBJS
)
258 echo Linking
32-bit
$@...
260 $(DSO
) $(ARCH32FLAGS
) $(DSO32FLAGS
) -o
$@
$(LIB32OBJS
) $(LIBS
)
261 $(RM
) 32bit
/libcupscgi.so
262 $(LN
) libcupscgi.so
.1 32bit
/libcupscgi.so
266 # 64bit/libcupscgi.so.1
269 64bit
/libcupscgi.so
.1: $(LIB64OBJS
)
270 echo Linking
64-bit
$@...
272 $(DSO
) $(ARCH64FLAGS
) $(DSO64FLAGS
) -o
$@
$(LIB64OBJS
) $(LIBS
)
273 $(RM
) 64bit
/libcupscgi.so
274 $(LN
) libcupscgi.so
.1 64bit
/libcupscgi.so
281 libcupscgi
.1.dylib
: $(LIBOBJS
) libcupscgi.exp
283 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@ \
284 -install_name
$(libdir)/$@ \
285 -current_version
1.0.0 \
286 -compatibility_version
1.0.0 \
287 -exported_symbols_list libcupscgi.exp \
289 $(RM
) libcupscgi.dylib
290 $(LN
) $@ libcupscgi.dylib
297 libcupscgi_s.a
: $(LIBOBJS
)
299 $(DSO
) $(DSOFLAGS
) -o libcupscgi_s.o
$(LIBOBJS
) $(LIBS
)
301 $(AR
) $(ARFLAGS
) $@ libcupscgi_s.o
308 libcupscgi.la
: $(LIBOBJS
)
310 $(CC
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
:.o
=.lo
) -rpath
$(LIBDIR
) \
311 -version-info
1:0 $(LIBS
)
318 libcupscgi.a
: $(LIBOBJS
)
321 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
329 admin.cgi
: admin.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
331 $(CC
) $(LDFLAGS
) -o
$@ admin.o
-lcupscgi
$(LIBS
)
338 classes.cgi
: classes.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
340 $(CC
) $(LDFLAGS
) -o
$@ classes.o
-lcupscgi
$(LIBS
)
347 help.cgi
: help.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
349 $(CC
) $(LDFLAGS
) -o
$@ help.o
-lcupscgi
$(LIBS
)
356 jobs.cgi
: jobs.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
358 $(CC
) $(LDFLAGS
) -o
$@ jobs.o
-lcupscgi
$(LIBS
)
365 printers.cgi
: printers.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
367 $(CC
) $(LDFLAGS
) -o
$@ printers.o
-L.
-lcupscgi
$(LIBS
)
374 testcgi
: testcgi.o ..
/Makedefs libcupscgi.a ..
/cups
/libcups.a
376 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testcgi.o libcupscgi.a \
377 ..
/cups
/libcups.a
$(COMMONLIBS
) $(SSLLIBS
) $(LIBZ
) $(LIBGSSAPI
)
378 echo Testing CGI API...
386 testhi
: testhi.o ..
/Makedefs libcupscgi.a ..
/cups
/libcups.a
388 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testhi.o libcupscgi.a \
389 ..
/cups
/libcups.a
$(COMMONLIBS
) $(SSLLIBS
) $(LIBZ
) $(LIBGSSAPI
)
390 echo Testing help index API...
398 testtemplate
: testtemplate.o ..
/Makedefs libcupscgi.a ..
/cups
/libcups.a
400 $(CC
) $(LDFLAGS
) -o
$@ testtemplate.o libcupscgi.a ..
/cups
/libcups.a \
401 $(COMMONLIBS
) $(SSLLIBS
) $(LIBZ
) $(LIBGSSAPI
)
408 websearch
: websearch.o ..
/Makedefs libcupscgi.a ..
/cups
/libcups.a
410 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ websearch.o libcupscgi.a \
411 ..
/cups
/libcups.a
$(COMMONLIBS
) $(SSLLIBS
) $(LIBZ
) $(LIBGSSAPI
)
422 # End of "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $".