2 # CGI makefile for CUPS.
4 # Copyright 2007-2016 by Apple Inc.
5 # Copyright 1997-2006 by Easy Software Products.
7 # These coded instructions, statements, and computer programs are the
8 # property of Apple Inc. and are protected by Federal copyright
9 # law. Distribution and use rights are outlined in the file "LICENSE.txt"
10 # which should have been included with this file. If this file is
11 # file is missing or damaged, see the license at "http://www.cups.org/".
62 # Make library targets...
65 libs
: $(LIBTARGETS
) $(UNITTESTS
)
72 unittests
: $(UNITTARGETS
)
76 # Clean all object files...
80 $(RM
) $(OBJS
) $(TARGETS
) $(UNITTARGETS
) makedocset
81 $(RM
) libcupscgi.so libcupscgi.dylib
85 # Update dependencies (without system header dependencies...)
89 $(CC
) -MM
$(ALL_CFLAGS
) $(OBJS
:.o
=.c
) >Dependencies
93 # Install all targets...
96 install: all install-data install-headers install-libs install-exec
100 # Install data files...
107 # Install programs...
111 $(INSTALL_DIR
) -m
755 $(SERVERBIN
)/cgi-bin
112 for file in
$(CGIS
); do \
113 $(INSTALL_BIN
) $$file $(SERVERBIN
)/cgi-bin
; \
115 if
test "x$(SYMROOT)" != "x"; then \
116 $(INSTALL_DIR
) $(SYMROOT
); \
117 for file in
$(CGIS
); do \
118 cp
$$file $(SYMROOT
); \
119 dsymutil
$(SYMROOT
)/$$file; \
129 if
test "x$(privateinclude)" != x
; then \
130 echo Installing private header files into
$(PRIVATEINCLUDE
)...
; \
131 $(INSTALL_DIR
) -m
755 $(PRIVATEINCLUDE
); \
132 for file in cgi.h help-index.h
; do \
133 $(INSTALL_DATA
) $$file $(PRIVATEINCLUDE
); \
139 # Install libraries...
142 install-libs
: $(INSTALLSTATIC
)
143 echo Installing libraries in
$(LIBDIR
)...
144 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
145 $(INSTALL_LIB
) $(LIBCUPSCGI
) $(LIBDIR
)
146 if
test $(LIBCUPSCGI
) = "libcupscgi.so.1"; then \
147 $(RM
) $(LIBDIR
)/`basename $(LIBCUPSCGI) .1`; \
148 $(LN
) $(LIBCUPSCGI
) $(LIBDIR
)/`basename $(LIBCUPSCGI) .1`; \
150 if
test $(LIBCUPSCGI
) = "libcupscgi.1.dylib"; then \
151 $(RM
) $(LIBDIR
)/libcupscgi.dylib
; \
152 $(LN
) $(LIBCUPSCGI
) $(LIBDIR
)/libcupscgi.dylib
; \
154 if
test "x$(SYMROOT)" != "x"; then \
155 $(INSTALL_DIR
) $(SYMROOT
); \
156 cp
$(LIBCUPSCGI
) $(SYMROOT
); \
157 dsymutil
$(SYMROOT
)/$(LIBCUPSCGI
); \
161 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
162 $(INSTALL_LIB
) -m
755 libcupscgi.a
$(LIBDIR
)
163 $(RANLIB
) $(LIBDIR
)/libcupscgi.a
164 $(CHMOD
) 555 $(LIBDIR
)/libcupscgi.a
168 # Uninstall all targets...
172 for file in
$(CGIS
); do \
173 $(RM
) $(SERVERBIN
)/cgi-bin
/$$file; \
175 -$(RMDIR
) $(SERVERBIN
)/cgi-bin
176 $(RM
) $(LIBDIR
)/libcupscgi
.1.dylib
177 $(RM
) $(LIBDIR
)/libcupscgi.a
178 $(RM
) $(LIBDIR
)/libcupscgi.dylib
179 $(RM
) $(LIBDIR
)/libcupscgi.so
180 $(RM
) $(LIBDIR
)/libcupscgi.so
.1
182 -if
test "x$(privateinclude)" != x
; then \
183 $(RM
) $(PRIVATEINCLUDE
)/cgi.h
; \
184 $(RM
) $(PRIVATEINCLUDE
)/help-index.h
; \
185 $(RMDIR
) $(PRIVATEINCLUDE
); \
193 libcupscgi.so
.1: $(LIBOBJS
)
195 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
) $(LIBS
)
196 $(RM
) `basename $@ .1`
197 $(LN
) $@
`basename $@ .1`
204 libcupscgi
.1.dylib
: $(LIBOBJS
) libcupscgi.exp
206 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@ \
207 -install_name
$(libdir)/$@ \
208 -current_version
1.0.0 \
209 -compatibility_version
1.0.0 \
210 -exported_symbols_list libcupscgi.exp \
212 $(RM
) libcupscgi.dylib
213 $(LN
) $@ libcupscgi.dylib
220 libcupscgi.la
: $(LIBOBJS
)
222 $(CC
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
:.o
=.lo
) -rpath
$(LIBDIR
) \
223 -version-info
1:0 $(LIBS
)
230 libcupscgi.a
: $(LIBOBJS
)
233 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
241 admin.cgi
: admin.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
243 $(CC
) $(LDFLAGS
) -o
$@ admin.o
-lcupscgi
$(LIBS
)
250 classes.cgi
: classes.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
252 $(CC
) $(LDFLAGS
) -o
$@ classes.o
-lcupscgi
$(LIBS
)
259 help.cgi
: help.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
261 $(CC
) $(LDFLAGS
) -o
$@ help.o
-lcupscgi
$(LIBS
)
268 jobs.cgi
: jobs.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
270 $(CC
) $(LDFLAGS
) -o
$@ jobs.o
-lcupscgi
$(LIBS
)
277 makedocset
: makedocset.o ..
/Makedefs libcupscgi.a ..
/cups
/$(LIBCUPSSTATIC
)
279 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ makedocset.o libcupscgi.a \
280 ..
/cups
/$(LIBCUPSSTATIC
) $(COMMONLIBS
) $(SSLLIBS
) $(DNSSDLIBS
) \
288 printers.cgi
: printers.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
290 $(CC
) $(LDFLAGS
) -o
$@ printers.o
-L.
-lcupscgi
$(LIBS
)
297 testcgi
: testcgi.o ..
/Makedefs libcupscgi.a ..
/cups
/$(LIBCUPSSTATIC
)
299 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testcgi.o libcupscgi.a \
300 ..
/cups
/$(LIBCUPSSTATIC
) $(COMMONLIBS
) $(SSLLIBS
) $(DNSSDLIBS
) \
302 echo Testing CGI API...
310 testhi
: testhi.o ..
/Makedefs libcupscgi.a ..
/cups
/$(LIBCUPSSTATIC
)
312 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testhi.o libcupscgi.a \
313 ..
/cups
/$(LIBCUPSSTATIC
) $(COMMONLIBS
) $(SSLLIBS
) $(DNSSDLIBS
) \
315 echo Testing help index API...
323 testtemplate
: testtemplate.o ..
/Makedefs libcupscgi.a ..
/cups
/$(LIBCUPSSTATIC
)
325 $(CC
) $(LDFLAGS
) -o
$@ testtemplate.o libcupscgi.a ..
/cups
/$(LIBCUPSSTATIC
) \
326 $(COMMONLIBS
) $(SSLLIBS
) $(DNSSDLIBS
) $(LIBZ
) $(LIBGSSAPI
)