summaryrefslogtreecommitdiff
path: root/math/cocoalib/files/patch-src_tests_Makefile
blob: f26d2b256b46b097f01a0b8fb774cfedb8cc9341 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
--- 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