2 # "$Id: Makefile 7558 2008-05-12 23:46:44Z 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
)
69 # Make library targets...
76 # Clean all object files...
80 $(RM
) $(OBJS
) $(TARGETS
)
81 $(RM
) libcupscgi.so libcupscgi.sl libcupscgi.dylib
86 # Update dependencies (without system header dependencies...)
90 touch Dependencies.tmp
91 makedepend
-Y
-I..
-fDependencies.tmp
$(OBJS
:.o
=.c
) >/dev
/null
2>&1
93 cp Dependencies.tmp Dependencies
94 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp
>>Dependencies
95 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp
>>Dependencies
96 $(RM
) Dependencies.tmp
100 # Install all targets...
103 install: all install-data install-headers install-libs install-exec
107 # Install data files...
114 # Install programs...
118 $(INSTALL_DIR
) -m
755 $(SERVERBIN
)/cgi-bin
119 for file in
$(CGIS
); do \
120 $(INSTALL_BIN
) $$file $(SERVERBIN
)/cgi-bin
; \
122 if
test "x$(SYMROOT)" != "x"; then \
123 $(INSTALL_DIR
) $(SYMROOT
); \
124 for file in
$(TARGETS
); do \
125 cp
$$file $(SYMROOT
); \
135 echo Installing header files in
$(INCLUDEDIR
)/cups...
136 $(INSTALL_DIR
) -m
755 $(INCLUDEDIR
)/cups
137 $(INSTALL_DATA
) cgi.h
$(INCLUDEDIR
)/cups
138 $(INSTALL_DATA
) help-index.h
$(INCLUDEDIR
)/cups
142 # Install libraries...
145 install-libs
: $(INSTALLSTATIC
) $(INSTALL32
) $(INSTALL64
)
146 echo Installing libraries in
$(LIBDIR
)...
147 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
148 $(INSTALL_LIB
) $(LIBCUPSCGI
) $(LIBDIR
)
149 if
test $(LIBCUPSCGI
) = "libcupscgi.so.1" -o
$(LIBCUPSCGI
) = "libcupscgi.sl.1"; then \
150 $(RM
) $(LIBDIR
)/`basename $(LIBCUPSCGI) .1`; \
151 $(LN
) $(LIBCUPSCGI
) $(LIBDIR
)/`basename $(LIBCUPSCGI) .1`; \
153 if
test $(LIBCUPSCGI
) = "libcupscgi.1.dylib"; then \
154 $(RM
) $(LIBDIR
)/libcupscgi.dylib
; \
155 $(LN
) $(LIBCUPSCGI
) $(LIBDIR
)/libcupscgi.dylib
; \
157 if
test "x$(SYMROOT)" != "x"; then \
158 $(INSTALL_DIR
) $(SYMROOT
); \
159 cp
$(LIBCUPSCGI
) $(SYMROOT
); \
163 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
164 $(INSTALL_LIB
) libcupscgi.a
$(LIBDIR
)
165 $(RANLIB
) $(LIBDIR
)/libcupscgi.a
168 echo Installing libraries in
$(LIB32DIR
)...
169 $(INSTALL_DIR
) -m
755 $(LIB32DIR
)
170 $(INSTALL_LIB
) 32bit
/libcupscgi.so
.1 $(LIB32DIR
)/libcupscgi.so
.1
171 $(LN
) libcupscgi.so
.1 $(LIB32DIR
)/libcupscgi.so
174 echo Installing libraries in
$(LIB64DIR
)...
175 $(INSTALL_DIR
) -m
755 $(LIB64DIR
)
176 $(INSTALL_LIB
) 64bit
/libcupscgi.so
.1 $(LIB64DIR
)/libcupscgi.so
.1
177 $(LN
) libcupscgi.so
.1 $(LIB64DIR
)/libcupscgi.so
181 # Uninstall all targets...
184 uninstall: $(UNINSTALL32
) $(UNINSTALL64
)
185 for file in
$(CGIS
); do \
186 $(RM
) $(SERVERBIN
)/cgi-bin
/$$file; \
188 -$(RMDIR
) $(SERVERBIN
)/cgi-bin
189 $(RM
) $(LIBDIR
)/libcupscgi
.1.dylib
190 $(RM
) $(LIBDIR
)/libcupscgi.a
191 $(RM
) $(LIBDIR
)/libcupscgi.dylib
192 $(RM
) $(LIBDIR
)/libcupscgi_s.a
193 $(RM
) $(LIBDIR
)/libcupscgi.sl
194 $(RM
) $(LIBDIR
)/libcupscgi.sl
.1
195 $(RM
) $(LIBDIR
)/libcupscgi.so
196 $(RM
) $(LIBDIR
)/libcupscgi.so
.1
198 $(RM
) $(INCLUDEDIR
)/cups
/cgi.h
199 $(RM
) $(INCLUDEDIR
)/cups
/help-index.h
200 -$(RMDIR
) $(INCLUDEDIR
)/cups
203 $(RM
) $(LIB32DIR
)/libcupscgi.so
204 $(RM
) $(LIB32DIR
)/libcupscgi.so
.1
205 -$(RMDIR
) $(LIB32DIR
)
208 $(RM
) $(LIB64DIR
)/libcupscgi.so
209 $(RM
) $(LIB64DIR
)/libcupscgi.so
.1
210 -$(RMDIR
) $(LIB64DIR
)
214 # Automatic API help files...
218 mxmldoc
--section
"Programming" \
220 --css ..
/doc
/cups-printable.css \
221 --header api-cgi.header
--intro api-cgi.shtml \
222 cgi.h help-index.h
$(LIBOBJS
:.o
=.c
) >..
/doc
/help
/api-cgi.html
225 mxmldoc
--framed api-cgi \
226 --section
"Programming" \
228 --css ..
/doc
/cups-printable.css \
229 --header api-cgi.header
--intro api-cgi.shtml \
230 cgi.h help-index.h
$(LIBOBJS
:.o
=.c
)
234 # libcupscgi.so.1, libcupscgi.sl.1
237 libcupscgi.so
.1 libcupscgi.sl
.1: $(LIBOBJS
)
239 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
) $(LIBS
)
240 $(RM
) `basename $@ .1`
241 $(LN
) $@
`basename $@ .1`
245 # 32bit/libcupscgi.so.1
248 32bit
/libcupscgi.so
.1: $(LIB32OBJS
)
249 echo Linking
32-bit
$@...
251 $(DSO
) $(ARCH32FLAGS
) $(DSO32FLAGS
) -o
$@
$(LIB32OBJS
) $(LIBS
)
252 $(RM
) 32bit
/libcupscgi.so
253 $(LN
) libcupscgi.so
.1 32bit
/libcupscgi.so
257 # 64bit/libcupscgi.so.1
260 64bit
/libcupscgi.so
.1: $(LIB64OBJS
)
261 echo Linking
64-bit
$@...
263 $(DSO
) $(ARCH64FLAGS
) $(DSO64FLAGS
) -o
$@
$(LIB64OBJS
) $(LIBS
)
264 $(RM
) 64bit
/libcupscgi.so
265 $(LN
) libcupscgi.so
.1 64bit
/libcupscgi.so
272 libcupscgi
.1.dylib
: $(LIBOBJS
) libcupscgi.exp
274 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@ \
275 -install_name
$(libdir)/$@ \
276 -current_version
1.0.0 \
277 -compatibility_version
1.0.0 \
278 -exported_symbols_list libcupscgi.exp \
280 $(RM
) libcupscgi.dylib
281 $(LN
) $@ libcupscgi.dylib
288 libcupscgi_s.a
: $(LIBOBJS
)
290 $(DSO
) $(DSOFLAGS
) -o libcupscgi_s.o
$(LIBOBJS
) $(LIBS
)
292 $(AR
) $(ARFLAGS
) $@ libcupscgi_s.o
299 libcupscgi.la
: $(LIBOBJS
)
301 $(CC
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
:.o
=.lo
) -rpath
$(LIBDIR
) \
302 -version-info
1:0 $(LIBS
)
309 libcupscgi.a
: $(LIBOBJS
)
312 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
320 admin.cgi
: admin.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
322 $(CC
) $(LDFLAGS
) -o
$@ admin.o
-L.
-lcupscgi
$(LIBS
)
329 classes.cgi
: classes.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
331 $(CC
) $(LDFLAGS
) -o
$@ classes.o
-L.
-lcupscgi
$(LIBS
)
338 help.cgi
: help.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
340 $(CC
) $(LDFLAGS
) -o
$@ help.o
-L.
-lcupscgi
$(LIBS
)
347 jobs.cgi
: jobs.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
349 $(CC
) $(LDFLAGS
) -o
$@ jobs.o
-L.
-lcupscgi
$(LIBS
)
356 printers.cgi
: printers.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
358 $(CC
) $(LDFLAGS
) -o
$@ printers.o
-L.
-lcupscgi
$(LIBS
)
365 testcgi
: testcgi.o ..
/Makedefs libcupscgi.a ..
/cups
/libcups.a
367 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testcgi.o libcupscgi.a \
368 ..
/cups
/libcups.a
$(COMMONLIBS
) $(SSLLIBS
) $(LIBZ
) $(LIBGSSAPI
)
369 echo Testing CGI API...
377 testhi
: testhi.o ..
/Makedefs libcupscgi.a ..
/cups
/libcups.a
379 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testhi.o libcupscgi.a \
380 ..
/cups
/libcups.a
$(COMMONLIBS
) $(SSLLIBS
) $(LIBZ
) $(LIBGSSAPI
)
381 echo Testing help index API...
389 testtemplate
: testtemplate.o ..
/Makedefs libcupscgi.a ..
/cups
/libcups.a
391 $(CC
) $(LDFLAGS
) -o
$@ testtemplate.o libcupscgi.a ..
/cups
/libcups.a \
392 $(COMMONLIBS
) $(SSLLIBS
) $(LIBZ
) $(LIBGSSAPI
)
399 websearch
: websearch.o ..
/Makedefs libcupscgi.a ..
/cups
/libcups.a
401 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ websearch.o libcupscgi.a \
402 ..
/cups
/libcups.a
$(COMMONLIBS
) $(SSLLIBS
) $(LIBZ
) $(LIBGSSAPI
)
413 # End of "$Id: Makefile 7558 2008-05-12 23:46:44Z mike $".