0441f5deec
- Build the static library with PIC and run ranlib; - Also build and install a shared library.
126 lines
4.2 KiB
Text
126 lines
4.2 KiB
Text
--- src/tests/Makefile.orig 2020-12-04 10:17:44 UTC
|
|
+++ src/tests/Makefile
|
|
@@ -1,11 +1,5 @@
|
|
# Makefile for CoCoALib/src/tests/ directory
|
|
|
|
-COCOA_ROOT=../..
|
|
-include $(COCOA_ROOT)/configuration/autoconf.mk
|
|
-CWD=src/tests/
|
|
-
|
|
-DEPEND_FILE=Makefile_dependencies
|
|
-
|
|
TESTS=test-empty.C \
|
|
test-BigInt1.C test-BigInt2.C test-BigInt3.C \
|
|
test-BigRat1.C test-BigRat2.C test-BigRat3.C test-BigRat4.C \
|
|
@@ -66,107 +60,11 @@ TESTS=test-empty.C \
|
|
test-utils1.C test-utils2.C
|
|
# test-RingTwinFloat3.C test-OpenMath2.C -- skip these tests for the moment
|
|
|
|
+all: ${TESTS:.C=}
|
|
+ bash RunTests.sh ${.ALLSRC}
|
|
|
|
-EXECS=$(TESTS:.C=)
|
|
-
|
|
-
|
|
-default:
|
|
- @echo "*** src/tests/Makefile: default target ***"
|
|
- @(cd $(COCOA_ROOT); $(MAKE) check)
|
|
-
|
|
-.PHONY: lib
|
|
-lib: library
|
|
-
|
|
-.PHONY: library
|
|
-library:
|
|
- @(cd $(COCOA_ROOT); $(MAKE) library)
|
|
-
|
|
-
|
|
-# This target should be made only after the CoCoA library has been compiled;
|
|
-# normally it would be called by the command "make check" in the CoCoALib root
|
|
-# directory.
|
|
-.PHONY: executables
|
|
-executables: $(EXECS)
|
|
-
|
|
-$(EXECS): $(COCOA_LIB)
|
|
-
|
|
-
|
|
-# This target should be made only after the CoCoA library has been compiled;
|
|
-# normally it would be called by the command "make RunTests" in the CoCoALib root
|
|
-# directory. Most of the work is done by the RunTests.sh script.
|
|
-.PHONY: check
|
|
-check: $(EXECS)
|
|
- @./RunTests.sh $(EXECS) 2> /dev/null # discard err mesgs from the shell script
|
|
-
|
|
-
|
|
-.PHONY: valgrind
|
|
-valgrind: executables
|
|
- @./ValgrindTests.sh $(EXECS)
|
|
-
|
|
-
|
|
-.PHONY: clean clean-local
|
|
-clean: clean-local
|
|
- @echo "Cleaned CoCoALib/$(CWD)"
|
|
-
|
|
-clean-local:
|
|
- @/bin/rm -f ./*.o gmon.out core a.out ./*~ ./.*~ ./.\#*
|
|
- @/bin/rm -f $(EXECS) "$(DEPEND_FILE).new" "$(DEPEND_FILE).old" ./*.cout ./*.cerr
|
|
- @/bin/rm -rf ./*.dSYM
|
|
-
|
|
-.PHONY: veryclean
|
|
-veryclean: clean-local
|
|
- @true >| "$(DEPEND_FILE)" # Empties $(DEPEND_FILE)
|
|
- @echo "Verycleaned CoCoALib/$(CWD)"
|
|
-
|
|
-
|
|
-# Morally the DEPEND_FILE depends on $(TESTS), but I do not tell make
|
|
-# this as it tends to rebuild it too often.
|
|
-
|
|
-# This target checks whether we should really build DEPEND_FILE
|
|
-.PHONY: dependencies
|
|
-dependencies:
|
|
- @if [ \! -s "$(DEPEND_FILE)" -o \! "$(DEPEND_FILE)" -nt "$(COCOA_HDR)" ] ; \
|
|
- then \
|
|
- $(MAKE) create-dependencies; \
|
|
- fi
|
|
-
|
|
-# This is the target which really does rebuild the DEPEND_FILE
|
|
-.PHONY: create-dependencies
|
|
-create-dependencies:
|
|
- @/bin/rm -rf $(DEPEND_FILE).new
|
|
- @echo "Rebuilding dependencies in <CoCoALib>/$(CWD)"
|
|
- @echo "##################################################################" >> $(DEPEND_FILE).new
|
|
- @echo "# --- CoCoALib version $(COCOALIB_VERSION) ---" >> $(DEPEND_FILE).new
|
|
- @echo "# Dependencies for directory CoCoALib/src/tests/" >> $(DEPEND_FILE).new
|
|
- @echo "# DO NOT EDIT: this file is automatically generated; to regenerate" >> $(DEPEND_FILE).new
|
|
- @echo "# run \`make dependencies' in the CoCoALib root directory." >> $(DEPEND_FILE).new
|
|
- @echo "##################################################################" >> $(DEPEND_FILE).new
|
|
- @echo >> $(DEPEND_FILE).new
|
|
- @echo "#----------------------------------------------------------" >> $(DEPEND_FILE).new
|
|
- @echo "# all executables also depend on libcocoa.a -- see Makefile" >> $(DEPEND_FILE).new
|
|
- @echo "#----------------------------------------------------------" >> $(DEPEND_FILE).new
|
|
- @echo >> $(DEPEND_FILE).new
|
|
- @for srcfile in $(TESTS); \
|
|
- do \
|
|
- execfile=`basename $$srcfile .C`; \
|
|
- echo "$$execfile: $$srcfile" >> $(DEPEND_FILE).new; \
|
|
- echo >> $(DEPEND_FILE).new; \
|
|
- done
|
|
- @if [ -s "$(DEPEND_FILE)" ] ; \
|
|
- then \
|
|
- /bin/mv -f "$(DEPEND_FILE)" "$(DEPEND_FILE).old" ; \
|
|
- fi
|
|
- @/bin/mv $(DEPEND_FILE).new $(DEPEND_FILE)
|
|
-
|
|
-
|
|
-# Tests using external libs depend on those libs
|
|
-test-frobby1: $(FROBBY_LIBS)
|
|
-test-normaliz1: $(NORMALIZ_LIBS)
|
|
-
|
|
-$(DEPEND_FILE):
|
|
- @touch "$(DEPEND_FILE)"
|
|
-
|
|
-include $(DEPEND_FILE)
|
|
+.C:
|
|
+ ${CXX} ${CXXFLAGS} -o ${.TARGET} ${.IMPSRC} ${LDFLAGS}
|
|
|
|
#############################################################################
|
|
# Next few lines are for RCS header/log
|