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
)
64 # Clean all object files...
68 $(RM
) $(OBJS
) $(TARGETS
)
69 $(RM
) libcupscgi.so libcupscgi.sl libcupscgi.dylib
74 # Update dependencies (without system header dependencies...)
78 touch Dependencies.tmp
79 makedepend
-Y
-I..
-fDependencies.tmp
$(OBJS
:.o
=.c
) >/dev
/null
2>&1
81 cp Dependencies.tmp Dependencies
82 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp
>>Dependencies
83 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp
>>Dependencies
84 $(RM
) Dependencies.tmp
88 # Install all targets...
91 install: all install-data install-headers install-libs install-exec
95 # Install data files...
102 # Install programs...
106 $(INSTALL_DIR
) -m
755 $(SERVERBIN
)/cgi-bin
107 for file in
$(CGIS
); do \
108 $(INSTALL_BIN
) $$file $(SERVERBIN
)/cgi-bin
; \
110 if
test "x$(SYMROOT)" != "x"; then \
111 $(INSTALL_DIR
) $(SYMROOT
); \
112 for file in
$(TARGETS
); do \
113 cp
$$file $(SYMROOT
); \
123 echo Installing header files in
$(INCLUDEDIR
)/cups...
124 $(INSTALL_DIR
) -m
755 $(INCLUDEDIR
)/cups
125 $(INSTALL_DATA
) cgi.h
$(INCLUDEDIR
)/cups
126 $(INSTALL_DATA
) help-index.h
$(INCLUDEDIR
)/cups
130 # Install libraries...
133 install-libs
: $(INSTALLSTATIC
) $(INSTALL32
) $(INSTALL64
)
134 echo Installing libraries in
$(LIBDIR
)...
135 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
136 $(INSTALL_LIB
) $(LIBCUPSCGI
) $(LIBDIR
)
137 if
test $(LIBCUPSCGI
) = "libcupscgi.so.1" -o
$(LIBCUPSCGI
) = "libcupscgi.sl.1"; then \
138 $(RM
) $(LIBDIR
)/`basename $(LIBCUPSCGI) .1`; \
139 $(LN
) $(LIBCUPSCGI
) $(LIBDIR
)/`basename $(LIBCUPSCGI) .1`; \
141 if
test $(LIBCUPSCGI
) = "libcupscgi.1.dylib"; then \
142 $(STRIP
) -x
$(LIBDIR
)/$(LIBCUPSCGI
); \
143 $(RM
) $(LIBDIR
)/libcupscgi.dylib
; \
144 $(LN
) $(LIBCUPSCGI
) $(LIBDIR
)/libcupscgi.dylib
; \
146 if
test "x$(SYMROOT)" != "x"; then \
147 $(INSTALL_DIR
) $(SYMROOT
); \
148 cp
$(LIBCUPSCGI
) $(SYMROOT
); \
152 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
153 $(INSTALL_LIB
) libcupscgi.a
$(LIBDIR
)
154 $(RANLIB
) $(LIBDIR
)/libcupscgi.a
157 echo Installing libraries in
$(LIB32DIR
)...
158 $(INSTALL_DIR
) -m
755 $(LIB32DIR
)
159 $(INSTALL_LIB
) 32bit
/libcupscgi.so
.1 $(LIB32DIR
)/libcupscgi.so
.1
160 $(LN
) libcupscgi.so
.1 $(LIB32DIR
)/libcupscgi.so
163 echo Installing libraries in
$(LIB64DIR
)...
164 $(INSTALL_DIR
) -m
755 $(LIB64DIR
)
165 $(INSTALL_LIB
) 64bit
/libcupscgi.so
.1 $(LIB64DIR
)/libcupscgi.so
.1
166 $(LN
) libcupscgi.so
.1 $(LIB64DIR
)/libcupscgi.so
170 # Uninstall all targets...
173 uninstall: $(UNINSTALL32
) $(UNINSTALL64
)
174 for file in
$(CGIS
); do \
175 $(RM
) $(SERVERBIN
)/cgi-bin
/$$file; \
177 -$(RMDIR
) $(SERVERBIN
)/cgi-bin
178 $(RM
) $(LIBDIR
)/libcupscgi
.1.dylib
179 $(RM
) $(LIBDIR
)/libcupscgi.a
180 $(RM
) $(LIBDIR
)/libcupscgi.dylib
181 $(RM
) $(LIBDIR
)/libcupscgi_s.a
182 $(RM
) $(LIBDIR
)/libcupscgi.sl
183 $(RM
) $(LIBDIR
)/libcupscgi.sl
.1
184 $(RM
) $(LIBDIR
)/libcupscgi.so
185 $(RM
) $(LIBDIR
)/libcupscgi.so
.1
187 $(RM
) $(INCLUDEDIR
)/cups
/cgi.h
188 $(RM
) $(INCLUDEDIR
)/cups
/help-index.h
189 -$(RMDIR
) $(INCLUDEDIR
)/cups
192 $(RM
) $(LIB32DIR
)/libcupscgi.so
193 $(RM
) $(LIB32DIR
)/libcupscgi.so
.1
194 -$(RMDIR
) $(LIB32DIR
)
197 $(RM
) $(LIB64DIR
)/libcupscgi.so
198 $(RM
) $(LIB64DIR
)/libcupscgi.so
.1
199 -$(RMDIR
) $(LIB64DIR
)
203 # Automatic API help files...
207 mxmldoc
--section
"Programming" \
209 --css ..
/doc
/cups-printable.css \
210 --header api-cgi.header
--intro api-cgi.shtml \
211 cgi.h help-index.h
$(LIBOBJS
:.o
=.c
) >..
/doc
/help
/api-cgi.html
214 mxmldoc
--framed api-cgi \
215 --section
"Programming" \
217 --css ..
/doc
/cups-printable.css \
218 --header api-cgi.header
--intro api-cgi.shtml \
219 cgi.h help-index.h
$(LIBOBJS
:.o
=.c
)
223 # libcupscgi.so.1, libcupscgi.sl.1
226 libcupscgi.so
.1 libcupscgi.sl
.1: $(LIBOBJS
)
228 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
) $(LIBS
)
229 $(RM
) `basename $@ .1`
230 $(LN
) $@
`basename $@ .1`
234 # 32bit/libcupscgi.so.1
237 32bit
/libcupscgi.so
.1: $(LIB32OBJS
)
238 echo Linking
32-bit
$@...
240 $(DSO
) $(ARCH32FLAGS
) $(DSO32FLAGS
) -o
$@
$(LIB32OBJS
) $(LIBS
)
241 $(RM
) 32bit
/libcupscgi.so
242 $(LN
) libcupscgi.so
.1 32bit
/libcupscgi.so
246 # 64bit/libcupscgi.so.1
249 64bit
/libcupscgi.so
.1: $(LIB64OBJS
)
250 echo Linking
64-bit
$@...
252 $(DSO
) $(ARCH64FLAGS
) $(DSO64FLAGS
) -o
$@
$(LIB64OBJS
) $(LIBS
)
253 $(RM
) 64bit
/libcupscgi.so
254 $(LN
) libcupscgi.so
.1 64bit
/libcupscgi.so
261 libcupscgi
.1.dylib
: $(LIBOBJS
) libcupscgi.exp
263 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@ \
264 -install_name
$(libdir)/$@ \
265 -current_version
1.0.0 \
266 -compatibility_version
1.0.0 \
267 -exported_symbols_list libcupscgi.exp \
269 $(RM
) libcupscgi.dylib
270 $(LN
) $@ libcupscgi.dylib
277 libcupscgi_s.a
: $(LIBOBJS
)
279 $(DSO
) $(DSOFLAGS
) -o libcupscgi_s.o
$(LIBOBJS
) $(LIBS
)
281 $(AR
) $(ARFLAGS
) $@ libcupscgi_s.o
288 libcupscgi.la
: $(LIBOBJS
)
290 $(CC
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
:.o
=.lo
) -rpath
$(LIBDIR
) \
291 -version-info
1:0 $(LIBS
)
298 libcupscgi.a
: $(LIBOBJS
)
301 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
309 admin.cgi
: admin.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
311 $(CC
) $(LDFLAGS
) -o
$@ admin.o
-L.
-lcupscgi
$(LIBS
)
318 classes.cgi
: classes.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
320 $(CC
) $(LDFLAGS
) -o
$@ classes.o
-L.
-lcupscgi
$(LIBS
)
327 help.cgi
: help.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
329 $(CC
) $(LDFLAGS
) -o
$@ help.o
-L.
-lcupscgi
$(LIBS
)
336 jobs.cgi
: jobs.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
338 $(CC
) $(LDFLAGS
) -o
$@ jobs.o
-L.
-lcupscgi
$(LIBS
)
345 printers.cgi
: printers.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
347 $(CC
) $(LDFLAGS
) -o
$@ printers.o
-L.
-lcupscgi
$(LIBS
)
354 testcgi
: testcgi.o ..
/Makedefs libcupscgi.a ..
/cups
/libcups.a
356 $(CC
) $(LDFLAGS
) -o
$@ testcgi.o libcupscgi.a ..
/cups
/libcups.a \
357 $(COMMONLIBS
) $(SSLLIBS
) $(LIBZ
) $(LIBGSSAPI
)
364 testhi
: testhi.o ..
/Makedefs libcupscgi.a ..
/cups
/libcups.a
366 $(CC
) $(LDFLAGS
) -o
$@ testhi.o libcupscgi.a ..
/cups
/libcups.a \
367 $(COMMONLIBS
) $(SSLLIBS
) $(LIBZ
) $(LIBGSSAPI
)
374 testtemplate
: testtemplate.o ..
/Makedefs libcupscgi.a ..
/cups
/libcups.a
376 $(CC
) $(LDFLAGS
) -o
$@ testtemplate.o libcupscgi.a ..
/cups
/libcups.a \
377 $(COMMONLIBS
) $(SSLLIBS
) $(LIBZ
) $(LIBGSSAPI
)
388 # End of "$Id: Makefile 6649 2007-07-11 21:46:42Z mike $".