2 # CGI makefile for CUPS.
4 # Copyright 2007-2017 by Apple Inc.
5 # Copyright 1997-2006 by Easy Software Products.
7 # Licensed under Apache License v2.0. See the file "LICENSE" for more information.
58 # Make library targets...
61 libs
: $(LIBTARGETS
) $(UNITTESTS
)
68 unittests
: $(UNITTARGETS
)
72 # Clean all object files...
76 $(RM
) $(OBJS
) $(TARGETS
) $(UNITTARGETS
) makedocset
77 $(RM
) libcupscgi.so libcupscgi.dylib
81 # Update dependencies (without system header dependencies...)
85 $(CC
) -MM
$(ALL_CFLAGS
) $(OBJS
:.o
=.c
) >Dependencies
89 # Install all targets...
92 install: all install-data install-headers install-libs install-exec
96 # Install data files...
103 # Install programs...
107 $(INSTALL_DIR
) -m
755 $(SERVERBIN
)/cgi-bin
108 for file in
$(CGIS
); do \
109 $(INSTALL_BIN
) $$file $(SERVERBIN
)/cgi-bin
; \
111 if
test "x$(SYMROOT)" != "x"; then \
112 $(INSTALL_DIR
) $(SYMROOT
); \
113 for file in
$(CGIS
); do \
114 cp
$$file $(SYMROOT
); \
115 dsymutil
$(SYMROOT
)/$$file; \
125 if
test "x$(privateinclude)" != x
; then \
126 echo Installing private header files into
$(PRIVATEINCLUDE
)...
; \
127 $(INSTALL_DIR
) -m
755 $(PRIVATEINCLUDE
); \
128 for file in cgi.h help-index.h
; do \
129 $(INSTALL_DATA
) $$file $(PRIVATEINCLUDE
); \
135 # Install libraries...
138 install-libs
: $(INSTALLSTATIC
)
139 echo Installing libraries in
$(LIBDIR
)...
140 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
141 $(INSTALL_LIB
) $(LIBCUPSCGI
) $(LIBDIR
)
142 if
test $(LIBCUPSCGI
) = "libcupscgi.so.1"; then \
143 $(RM
) $(LIBDIR
)/`basename $(LIBCUPSCGI) .1`; \
144 $(LN
) $(LIBCUPSCGI
) $(LIBDIR
)/`basename $(LIBCUPSCGI) .1`; \
146 if
test $(LIBCUPSCGI
) = "libcupscgi.1.dylib"; then \
147 $(RM
) $(LIBDIR
)/libcupscgi.dylib
; \
148 $(LN
) $(LIBCUPSCGI
) $(LIBDIR
)/libcupscgi.dylib
; \
150 if
test "x$(SYMROOT)" != "x"; then \
151 $(INSTALL_DIR
) $(SYMROOT
); \
152 cp
$(LIBCUPSCGI
) $(SYMROOT
); \
153 dsymutil
$(SYMROOT
)/$(LIBCUPSCGI
); \
157 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
158 $(INSTALL_LIB
) -m
755 libcupscgi.a
$(LIBDIR
)
159 $(RANLIB
) $(LIBDIR
)/libcupscgi.a
160 $(CHMOD
) 555 $(LIBDIR
)/libcupscgi.a
164 # Uninstall all targets...
168 for file in
$(CGIS
); do \
169 $(RM
) $(SERVERBIN
)/cgi-bin
/$$file; \
171 -$(RMDIR
) $(SERVERBIN
)/cgi-bin
172 $(RM
) $(LIBDIR
)/libcupscgi
.1.dylib
173 $(RM
) $(LIBDIR
)/libcupscgi.a
174 $(RM
) $(LIBDIR
)/libcupscgi.dylib
175 $(RM
) $(LIBDIR
)/libcupscgi.so
176 $(RM
) $(LIBDIR
)/libcupscgi.so
.1
178 -if
test "x$(privateinclude)" != x
; then \
179 $(RM
) $(PRIVATEINCLUDE
)/cgi.h
; \
180 $(RM
) $(PRIVATEINCLUDE
)/help-index.h
; \
181 $(RMDIR
) $(PRIVATEINCLUDE
); \
189 libcupscgi.so
.1: $(LIBOBJS
)
191 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
) $(LIBS
)
192 $(RM
) `basename $@ .1`
193 $(LN
) $@
`basename $@ .1`
200 libcupscgi
.1.dylib
: $(LIBOBJS
) libcupscgi.exp
202 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@ \
203 -install_name
$(libdir)/$@ \
204 -current_version
1.0.0 \
205 -compatibility_version
1.0.0 \
206 -exported_symbols_list libcupscgi.exp \
208 $(RM
) libcupscgi.dylib
209 $(LN
) $@ libcupscgi.dylib
216 libcupscgi.la
: $(LIBOBJS
)
218 $(LD_CC
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
:.o
=.lo
) -rpath
$(LIBDIR
) \
219 -version-info
1:0 $(LIBS
)
226 libcupscgi.a
: $(LIBOBJS
)
229 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
237 admin.cgi
: admin.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
239 $(LD_CC
) $(LDFLAGS
) -o
$@ admin.o
-lcupscgi
$(LIBS
)
246 classes.cgi
: classes.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
248 $(LD_CC
) $(LDFLAGS
) -o
$@ classes.o
-lcupscgi
$(LIBS
)
255 help.cgi
: help.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
257 $(LD_CC
) $(LDFLAGS
) -o
$@ help.o
-lcupscgi
$(LIBS
)
264 jobs.cgi
: jobs.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
266 $(LD_CC
) $(LDFLAGS
) -o
$@ jobs.o
-lcupscgi
$(LIBS
)
273 makedocset
: makedocset.o ..
/Makedefs libcupscgi.a ..
/cups
/$(LIBCUPSSTATIC
)
275 $(LD_CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ makedocset.o libcupscgi.a \
276 ..
/cups
/$(LIBCUPSSTATIC
) $(COMMONLIBS
) $(SSLLIBS
) $(DNSSDLIBS
) \
284 printers.cgi
: printers.o ..
/Makedefs ..
/cups
/$(LIBCUPS
) $(LIBCUPSCGI
)
286 $(LD_CC
) $(LDFLAGS
) -o
$@ printers.o
-L.
-lcupscgi
$(LIBS
)
293 testcgi
: testcgi.o ..
/Makedefs libcupscgi.a ..
/cups
/$(LIBCUPSSTATIC
)
295 $(LD_CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testcgi.o libcupscgi.a \
296 ..
/cups
/$(LIBCUPSSTATIC
) $(COMMONLIBS
) $(SSLLIBS
) $(DNSSDLIBS
) \
298 echo Testing CGI API...
306 testhi
: testhi.o ..
/Makedefs libcupscgi.a ..
/cups
/$(LIBCUPSSTATIC
)
308 $(LD_CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testhi.o libcupscgi.a \
309 ..
/cups
/$(LIBCUPSSTATIC
) $(COMMONLIBS
) $(SSLLIBS
) $(DNSSDLIBS
) \
311 echo Testing help index API...
319 testtemplate
: testtemplate.o ..
/Makedefs libcupscgi.a ..
/cups
/$(LIBCUPSSTATIC
)
321 $(LD_CC
) $(LDFLAGS
) -o
$@ testtemplate.o libcupscgi.a ..
/cups
/$(LIBCUPSSTATIC
) \
322 $(COMMONLIBS
) $(SSLLIBS
) $(DNSSDLIBS
) $(LIBZ
) $(LIBGSSAPI
)