aboutsummaryrefslogtreecommitdiff
path: root/math/cocoalib/files/patch-src_AlgebraicCore_TmpFactorDir_Makefile
blob: fc397d6d97145d4cf09d2375f09e2386744bf83e (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
--- src/AlgebraicCore/TmpFactorDir/Makefile.orig	2020-10-27 09:42:42 UTC
+++ src/AlgebraicCore/TmpFactorDir/Makefile
@@ -1,10 +1,5 @@
 # Makefile for CoCoALib/src/AlgebraicCore/TmpFactorDir/ directory
 
-COCOA_ROOT=../../..
-include $(COCOA_ROOT)/configuration/autoconf.mk
-CWD=src/AlgebraicCore/TmpFactorDir/
-DEPEND_FILE=Makefile_dependencies
-
 SUBDIRS=linalg multivariate
 
 SRCS=primes.c DUPFF.c FF.c FindPrimRoot.c DUPFFsqfrd.c DUPFFderiv.c \
@@ -19,79 +14,13 @@ SRCS=primes.c DUPFF.c FF.c FindPrimRoot.c DUPFFsqfrd.c
      jalloc.c add_logs.c jaaerror.c debug_malloc.c \
      DUPZfactor_liftq.c mpz_lift_recip.c mpq_to_FFelem.c
 
-OBJS=$(SRCS:.c=.o)
+all: ${SRCS:.c=.o}
+	for x in ${SUBDIRS}; do make -C $$x; done
+	ar rcs ../libcocoa.a ${.ALLSRC}
+	echo ${.ALLSRC} >> ../.ALLSRC
+	/bin/mv *.o ..
 
-%.o: %.c
-	$(COMPILE) -I. -Ilinalg -c -o $@ $<
+.SUFFIXES:.o
 
-.PHONY: default
-default: $(OBJS)
-	ar $(ARFLAGS) $(COCOA_LIB) $(OBJS)
-	for subdir in $(SUBDIRS); \
-	do \
-	  echo "Compiling directory $(CWD)$$subdir/"; \
-	  (cd "$$subdir"; $(MAKE) -s); \
-	done
-
-
-.PHONY: clean clean-local clean-subdirs
-clean: clean-local clean-subdirs
-	@echo "Cleaned CoCoALib/$(CWD)";
-
-clean-local:
-	@/bin/rm -f $(OBJS)  "$(DEPEND_FILE).old"  "$(DEPEND_FILE).new"  ./*~  ./.*~  ./.\#*
-	@/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
-	@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
-.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) $(INCLUDE_PATHS) -I. -Ilinalg -Imultivariate -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 $(DEPEND_FILE).new  $(DEPEND_FILE)
-
-
-$(DEPEND_FILE):
-	@touch "$(DEPEND_FILE)"
-
-include $(DEPEND_FILE)
-
-$(OBJS): $(COCOA_ROOT)/configuration/autoconf.mk
+.c.o:
+	${CXX} ${CXXFLAGS} -o ${.TARGET} -c ${.IMPSRC}