PHPOPTIONS = @PHPOPTIONS@ -I../.. `$(PHPCONFIG) --includes`
SSLFLAGS = @SSLFLAGS@
SSLLIBS = @SSLLIBS@
+UNITTESTS = @UNITTESTS@
+
#
# Separate 32/64-bit library support...
echo Using ARCHFLAGS="$(ARCHFLAGS)"
echo Using ALL_CFLAGS="$(ALL_CFLAGS)"
echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)"
+ echo Using CC="$(CC)"
+ echo Using CXX="$(CC)"
echo Using DSOFLAGS="$(DSOFLAGS)"
echo Using LDFLAGS="$(LDFLAGS)"
echo Using LIBS="$(LIBS)"
echo Using ARCHFLAGS="$(ARCHFLAGS)"
echo Using ALL_CFLAGS="$(ALL_CFLAGS)"
echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)"
+ echo Using CC="$(CC)"
+ echo Using CXX="$(CC)"
echo Using DSOFLAGS="$(DSOFLAGS)"
echo Using LDFLAGS="$(LDFLAGS)"
echo Using LIBS="$(LIBS)"
done
+#
+# Make unit test targets...
+#
+
+unittests:
+ echo Using ARCHFLAGS="$(ARCHFLAGS)"
+ echo Using ALL_CFLAGS="$(ALL_CFLAGS)"
+ echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)"
+ echo Using CC="$(CC)"
+ echo Using CXX="$(CC)"
+ echo Using DSOFLAGS="$(DSOFLAGS)"
+ echo Using LDFLAGS="$(LDFLAGS)"
+ echo Using LIBS="$(LIBS)"
+ for dir in $(DIRS); do\
+ echo Making all in $$dir... ;\
+ (cd $$dir ; $(MAKE) $(MFLAGS) unittests) || exit 1;\
+ done
+
+
#
# Remove object and target files...
#
libs:
+#
+# Make unit tests...
+#
+
+unittests:
+
+
#
# Clean all object files...
#
include ../Makedefs
+
TARGETS = lpc lpq lpr lprm
OBJS = lpc.o lpq.o lpr.o lprm.o
libs:
+#
+# Make unit tests...
+#
+
+unittests:
+
+
#
# Clean all object files...
#
$(LIBCUPSCGI) \
$(LIB32CUPSCGI) \
$(LIB32CUPSCGI) \
+ websearch
+
+UNITTARGETS = \
testcgi \
testhi \
- websearch
+ testtemplate
TARGETS = \
$(LIBTARGETS) \
- $(CGIS) \
- testtemplate
+ $(CGIS)
#
# Make library targets...
#
-libs: $(LIBTARGETS)
+libs: $(LIBTARGETS) $(UNITTESTS)
+
+
+#
+# Make unit tests...
+#
+
+unittests: $(UNITTARGETS)
#
#
clean:
- $(RM) $(OBJS) $(TARGETS)
+ $(RM) $(OBJS) $(TARGETS) $(UNITTARGETS)
$(RM) libcupscgi.so libcupscgi.sl libcupscgi.dylib
$(RM) -r 32bit 64bit
libs:
+#
+# Make unit tests...
+#
+
+unittests:
+
+
#
# Clean all config and object files...
#
AC_ARG_WITH(optim, [ --with-optim="flags" set optimization flags ])
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging, default=no])
+AC_ARG_ENABLE(debug_printfs, [ --enable-debug-printfs turn on debug printfs, default=no])
+AC_ARG_ENABLE(unit_tests, [ --enable-unit-tests turn on unit tests, default=no])
dnl For debugging, keep symbols, otherwise strip them...
if test x$enable_debug = xyes; then
OPTIM="-g"
- CFLAGS="$CFLAGS -DDEBUG"
else
INSTALL_STRIP="-s"
fi
+dnl Debug printfs can slow things down, so provide a separate option for that
+if test x$enable_debug_printf = xyes; then
+ CFLAGS="$CFLAGS -DDEBUG"
+fi
+
+dnl Unit tests take up time during a compile...
+if test x$enable_unit_tests = xyes; then
+ UNITTESTS="unittests"
+else
+ UNITTESTS=""
+fi
+AC_SUBST(UNITTESTS)
+
dnl Setup general architecture flags...
AC_ARG_WITH(archflags, [ --with-archflags="flags"
set default architecture flags ])
$(LIBCUPS) \
$(LIB32CUPS) \
$(LIB64CUPS) \
- libcups.a \
+ libcups.a
+
+UNITTARGETS = \
+ testadmin \
testarray \
+ testconflicts \
+ testcups \
testfile \
testhttp \
testi18n \
testipp \
testlang \
testoptions \
- testppd
+ testppd \
+ testsnmp
TARGETS = \
- $(LIBTARGETS) \
- testadmin \
- testconflicts \
- testcups \
- testsnmp
+ $(LIBTARGETS)
#
libs: $(LIBTARGETS)
+#
+# Make unit tests...
+#
+
+unittests: $(UNITTARGETS)
+
+
#
# Remove object and target files...
#
clean:
- $(RM) $(OBJS) $(TARGETS)
+ $(RM) $(OBJS) $(TARGETS) $(UNITTARGETS)
$(RM) libcups.so libcups.sl libcups.dylib
$(RM) -r 32bit 64bit
libs:
+#
+# Make unit tests...
+#
+
+unittests:
+
+
#
# Clean all config and object files...
#
libs:
+#
+# Make unit tests...
+#
+
+unittests:
+
+
#
# Remove all generated files...
#
libs: $(LIBTARGETS)
+#
+# Make unit tests...
+#
+
+unittests:
+
+
#
# Clean everything...
#
$(LIBCUPSIMAGE) \
libcupsimage.a \
$(LIB32CUPSIMAGE) \
- $(LIB64CUPSIMAGE) \
+ $(LIB64CUPSIMAGE)
+UNITTARGETS = \
+ rasterbench \
+ testimage \
testraster
TARGETS = \
$(LIBTARGETS) \
- $(FILTERS) \
- rasterbench \
- testimage
+ $(FILTERS)
HPGLOBJS = hpgl-attr.o hpgl-config.o hpgl-main.o hpgl-prolog.o \
hpgl-char.o hpgl-input.o hpgl-polygon.o hpgl-vector.o
libs: $(LIBTARGETS)
+#
+# Make unit tests...
+#
+
+unittests: $(UNITTARGETS)
+
+
#
# Clean all object files...
#
clean:
- $(RM) $(OBJS) $(TARGETS)
+ $(RM) $(OBJS) $(TARGETS) $(UNITTARGETS)
$(RM) libcupsimage.so libcupsimage.sl libcupsimage.dylib
$(RM) -r 32bit 64bit
libs:
+#
+# Make unit tests...
+#
+
+unittests:
+
+
#
# Clean all config and object files...
#
libs:
+#
+# Make unit tests...
+#
+
+unittests:
+
+
#
# Clean all config and object files...
#
libs:
+#
+# Make unit tests...
+#
+
+unittests:
+
+
#
# Clean all config and object files...
#
libs:
+#
+# Make unit tests...
+#
+
+unittests:
+
+
#
# Clean all object files...
#
libs:
+#
+# Make unit tests...
+#
+
+unittests:
+
+
#
# Clean all object files...
#
testcatalog.o
LIBTARGETS = \
$(LIBCUPSPPDC) \
- libcupsppdc.a \
- ppdc-static
+ libcupsppdc.a
+UNITTARGETS = \
+ ppdc-static \
+ testcatalog
TARGETS = \
$(LIBTARGETS) \
ppdc \
ppdhtml \
ppdi \
ppdmerge \
- ppdpo \
- testcatalog
+ ppdpo
#
libs: $(LIBTARGETS)
+#
+# Make unit tests...
+#
+
+unittests: $(UNITTARGETS)
+
+
#
# Clean everything...
#
clean:
$(RM) $(OBJS) core
$(RM) *.bak *.bck core.*
- $(RM) $(TARGETS)
+ $(RM) $(TARGETS) $(UNITTARGETS)
$(RM) -r ppd
$(RM) test.drv
$(RM) libcupsppdc.so libcupsppdc.sl libcupsppdc.dylib
libs: $(LIBTARGETS)
+#
+# Make unit tests...
+#
+
+unittests:
+
+
#
# Clean all object files...
#
libs:
+#
+# Make unit tests...
+#
+
+unittests:
+
+
#
# Remove object and target files...
#
libs:
+#
+# Make unit tests...
+#
+
+unittests:
+
+
#
# Clean all config and object files...
#
libs:
+#
+# Make unit tests...
+#
+
+unittests:
+
+
#
# Clean all object files...
#
libs:
+#
+# Make unit tests...
+#
+
+unittests:
+
+
#
# Clean all config and object files...
#
libs:
+#
+# Make unit tests...
+#
+
+unittests:
+
+
#
# Clean all object files...
#