summaryrefslogtreecommitdiff
path: root/math/cocoalib/files/patch-src_AlgebraicCore_Makefile
blob: 2605423683a7aeaa1b343f8eab7d36e5d54611c1 (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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
--- src/AlgebraicCore/Makefile.orig	2020-10-27 09:42:18 UTC
+++ src/AlgebraicCore/Makefile
@@ -1,10 +1,5 @@
 # Makefile for CoCoALib/src/AlgebraicCore/ directory.
 
-COCOA_ROOT=../..
-include $(COCOA_ROOT)/configuration/autoconf.mk
-CWD=src/AlgebraicCore/
-DEPEND_FILE=Makefile_dependencies
-
 SUBDIRS=TmpFactorDir TmpHilbertDir
 
 FROBBY_FILES=ExternalLibs-Frobby.C
@@ -74,126 +69,21 @@ SRCS=time.C assert.C utils.C  utils-gmp.C  VectorOps.C
      $(FROBBY_FILES) $(GFAN_FILES) $(GSL_FILES) \
      $(MATHSAT_FILES) $(NORMALIZ_FILES)
 
-# (see below) OBJS depend on $(COCOA_ROOT)/configuration/autoconf.mk
-OBJS=$(SRCS:.C=.o)
+all: ${SRCS:.C=.o}
+	echo "" > ./.ALLSRC
+	for x in ${SUBDIRS}; do make -C $$x; done
+	ar rcs libcocoa.a ${.ALLSRC}
+	ranlib libcocoa.a
+	echo ${.ALLSRC} >> ./.ALLSRC
+	${CXX} -shared `cat ./.ALLSRC` -Wl,-soname,libcocoa.so.0 -o libcocoa.so.0
 
-# The default target compiles debug_new.C and leak_checker.C as
-# well as all the files listed in SRCS.
-default:
-	@echo "*** $(CWD)Makefile: default target ***"
-	@cd $(COCOA_ROOT); $(MAKE) library
+.SUFFIXES:.o
 
-.PHONY: all
-all: check-source-files $(COCOA_LIB) debug_new.o leak_checker
+.C.o:
+	${CXX} ${CXXFLAGS} -o ${.TARGET} -c ${.IMPSRC}
 
-$(COCOA_LIB): $(OBJS) $(SUBDIRS)
-	mkdir -p `dirname $(COCOA_LIB)`
-	for subdir in $(SUBDIRS); \
-	do \
-	  echo "Compiling directory $(CWD)$$subdir/"; \
-	  touch "$$subdir"; \
-	  ( cd "$$subdir"; $(MAKE) -s ); \
-	  if [ $$? -ne 0 ]; then echo "***** Compilation of $(CWD)$$subdir/ FAILED *****"; exit 1; fi; \
-	done
-	echo "doing ar for AlgebraicCore"
-	ar $(ARFLAGS) $(COCOA_LIB) $(OBJS)
-
-$(OBJS):  $(COCOA_ROOT)/configuration/autoconf.mk
-
-.PHONY: check-source-files
-check-source-files:
-	@./CheckSourceFiles.sh $(SRCS)
-
-
-#######################################################
-# Special compilation targets with extra CPP symbols.
-BuildInfo.o: BuildInfo.C $(COCOA_ROOT)/include/CoCoA/BuildInfo.H
-	@echo "Compiling BuildInfo.o (with special preprocessor flags)"
-	$(COMPILE) -c  -DCOCOA_VERSION="\"$(COCOALIB_VERSION)\""  -DCOCOA_CXX="\"$(CXX)\""  -DCOCOA_CXXFLAGS="\"$(CXXFLAGS)\""   -o BuildInfo.o BuildInfo.C
-
-IdealOfPoints.o: IdealOfPoints.C $(COCOA_ROOT)/include/CoCoA/IdealOfPoints.H
-	@echo "Compiling IdealOfPoints --  keep your fingers crossed"
-	$(COMPILE) -ITmpFactorDir/ -c IdealOfPoints.C
-
-factor.o: factor.C $(COCOA_ROOT)/include/CoCoA/factor.H
-	@echo "Compiling factor --  keep your fingers crossed"
-	$(COMPILE) -ITmpFactorDir/ -ITmpFactorDir/multivariate/ -c factor.C
-
-TmpHilbert.o: TmpHilbert.C $(COCOA_ROOT)/include/CoCoA/TmpHilbert.H
-	@echo "Compiling TmpHilbert --  keep your fingers crossed"
-	$(COMPILE) -ITmpHilbertDir/ -c TmpHilbert.C
-
-debug_new.o: debug_new.C $(COCOA_ROOT)/include/CoCoA/debug_new.H
-	@echo "Compiling debug_new.o (not part of CoCoALib)"
-	$(COMPILE) -c -o debug_new.o debug_new.C
-
-leak_checker: leak_checker.C
-	@echo "Compiling leak_checker (not part of CoCoALib)"
-	$(COMPILE) -o leak_checker leak_checker.C
-	/bin/rm -rf leak_checker.dSYM
-
-
-.PHONY: clean clean-local clean-subdirs
-clean: clean-local clean-subdirs
-	@echo "Cleaned CoCoALib/$(CWD)"
-
-clean-local:
-	@/bin/rm -f  $(OBJS)  a.out  core  "$(DEPEND_FILE).old"  "$(DEPEND_FILE).new"  leak_checker  debug_new.o
-	@/bin/rm -f  ./*~  ./.*~  ./.\#*
-	@/bin/rm -rf  ./*.dSYM
-
-clean-subdirs:
-	for subdir in $(SUBDIRS); do ( cd $$subdir; $(MAKE) -s clean ); done
-
-.PHONY: veryclean  veryclean-subdirs
-veryclean:  clean-local  veryclean-subdirs
-	@/bin/rm -f "$(DEPEND_FILE)"
-	@true >| "$(DEPEND_FILE)" # Empties $(DEPEND_FILE)
-	@echo "Verycleaned CoCoALib/$(CWD)"
-
-veryclean-subdirs:
-	for subdir in $(SUBDIRS); do ( cd $$subdir; $(MAKE) -s veryclean ); done
-
-
-# This target checks whether we should really build DEPEND_FILE...
-# (only if COCOA_HDR is newer than DEPEND_FILE).
-.PHONY: dependencies
-dependencies:
-	@if [ \! -s "$(DEPEND_FILE)" -o \! "$(DEPEND_FILE)" -nt "$(COCOA_HDR)" ] ; \
-	then \
-	  $(MAKE) create-dependencies; \
-	fi
-	for subdir in $(SUBDIRS); do ( cd $$subdir; $(MAKE) -s dependencies ); done
-
-# 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 $(CWD)"                                  >> $(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
-	@for srcfile in $(SRCS); \
-	do \
-	  objfile=`basename $$srcfile .C`.o; \
-	  $(CXX) $(CXXFLAGS) $(INCLUDE_PATHS) -ITmpFactorDir -ITmpFactorDir/linalg -ITmpFactorDir/multivariate -MM "$$srcfile" -MQ "$$objfile" >> $(DEPEND_FILE).new; \
-	  echo >> $(DEPEND_FILE).new; \
-	done
-	@if [ -s "$(DEPEND_FILE)" ] ; \
-	then \
-	  /bin/mv -f "$(DEPEND_FILE)" "$(DEPEND_FILE).old" ; \
-	fi
-	@/bin/mv -f $(DEPEND_FILE).new  $(DEPEND_FILE)
-
-
-$(DEPEND_FILE):
-	@touch "$(DEPEND_FILE)"
-
-include $(DEPEND_FILE)
+BuildInfo.o:
+	${CXX} ${CXXFLAGS} -DCOCOA_VERSION="\"%%DISTVERSION%%\"" -DCOCOA_CXX="\"${CXX}\"" -DCOCOA_CXXFLAGS="\"${CXXFLAGS}\"" -DCOCOA_CXXFLAGS_DEFINES="\"\"" -o BuildInfo.o -c BuildInfo.C
 
 # Next few lines are for RCS header/log
 # $Header: /Volumes/Home_1/cocoa/cvs-repository/CoCoALib-0.99/src/AlgebraicCore/Makefile,v 1.176 2020/10/27 09:42:18 abbott Exp $