blob: 806a782b087dc1b549cfa9b15531c0a9f15f5944 (
plain)
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
|
default: esolid
ESOLID_dir = .
### 1. System configuration
#### 1-1. Hardware and operating system
##### Pick your architecture.
CFLAGS = -D_Linux_i386_
#CFLAGS = -D_EXPERIMENT -D_Linux_i386_
#CFLAGS = -D_SunOS_
#CFLAGS = -D_IRIX_
#### 1-2. Compiler
##### Pick your compiler.
##### Currently, the library is tested only with g++.
CC = g++
#CC = g++-2.95
#CC = g++-3.0
#CC = g++-3.2
##### Define g++ compiler flags.
CFLAGS += -g
CFLAGS += -O
#CFLAGS += -O2
#CFLAGS += -Wno-deprecated
##### Pick your archiver and stripper.
###### "ar -ru" replaces the objects only if they are updated.
#AR = ar -r
AR = ar -ru
###### "strip --strip-unneeded" strips all symbols
###### that are not needed for relocation.
###### "strip -g" strips debugging symbols only.
#STRIP = strip --strip-unneeded
STRIP = strip -g --strip-unneeded
###### For debugging, do not strip, so use the "echo" (dummy) definition:
#STRIP = echo
### 3. Header files and library locations
#### 3-1. GMP
#IFLAGS_gmp = -I/usr/include
LFLAGS_gmp = -lgmp
#### 3-2. LPACK
#IFLAGS_lapack = -I/usr/local/include
#LFLAGS_lapack = -L/usr/local/lib -lclapack -lcblas -lF77
LFLAGS_lapack = -lclapack -lcblas -lF77
### 4. Making
#### 4-1. Objects
%.o: %.cc
$(CC) $(CFLAGS) -c $(ESOLID_dir)/$< -o $(ESOLID_dir)/$(basename $<).o
config_objects = \
$(ESOLID_dir)/src/timer.o \
$(ESOLID_dir)/src/config.o \
bignum_objects = \
$(ESOLID_dir)/src/bigint.o \
$(ESOLID_dir)/src/bigint_vector.o \
$(ESOLID_dir)/src/bigint_matrix.o \
$(ESOLID_dir)/src/bigrational.o \
$(ESOLID_dir)/src/bigrational_vector.o \
$(ESOLID_dir)/src/bigrational_matrix.o \
fp_objects = \
$(ESOLID_dir)/src/fpfilter.o \
$(ESOLID_dir)/src/fpconversion.o \
mapc_objects = \
$(ESOLID_dir)/src/kratpoly.o \
$(ESOLID_dir)/src/kfloatpoly.o \
$(ESOLID_dir)/src/root1.o \
$(ESOLID_dir)/src/VDM.o \
$(ESOLID_dir)/src/kpoint1d.o \
$(ESOLID_dir)/src/kpoint2d.o \
$(ESOLID_dir)/src/kboxco2.o \
$(ESOLID_dir)/src/ksegment.o \
$(ESOLID_dir)/src/kcurve.o \
esolid_objects = \
$(ESOLID_dir)/src/kbox3d.o \
$(ESOLID_dir)/src/pt_surf_assoc.o \
$(ESOLID_dir)/src/pascal.o \
$(ESOLID_dir)/src/ksurf.o \
$(ESOLID_dir)/src/kpatch.o \
$(ESOLID_dir)/src/kpartition.o \
$(ESOLID_dir)/src/kgraph.o \
$(ESOLID_dir)/src/genbox.o \
$(ESOLID_dir)/src/gencyl.o \
$(ESOLID_dir)/src/genell.o \
$(ESOLID_dir)/src/gentor.o \
$(ESOLID_dir)/src/ksolid.o \
#### 4-2. Archives
IFLAGS = -Iinclude $(IFLAGS_gmp) $(IFLAGS_lapack)
CFLAGS += $(IFLAGS)
LFLAGS = $(LFLAGS_gmp) $(LFLAGS_lapack)
LFLAGS += -lm
##### Make mapc static library.
libmapc: $(config_objects) $(bignum_objects) $(fp_objects) $(mapc_objects)
$(AR) $(ESOLID_dir)/$@.a $(config_objects) $(bignum_objects) $(fp_objects) $(mapc_objects)
$(STRIP) $(ESOLID_dir)/$@.a
##### Make mapc shared library.
#libmapc: $(config_objects) $(bignum_objects) $(fp_objects) $(mapc_objects)
# $(CC) -shared -Wl -o $(ESOLID_dir)/$@.so $(config_objects) $(bignum_objects) $(fp_objects) $(mapc_objects)
# $(STRIP) $(ESOLID_dir)/$@.so
##### Make esolid static library.
libesolid: $(config_objects) $(bignum_objects) $(fp_objects) $(mapc_objects) $(esolid_objects)
$(AR) $(ESOLID_dir)/$@.a $(config_objects) $(bignum_objects) $(fp_objects) $(mapc_objects) $(esolid_objects)
$(STRIP) $(ESOLID_dir)/$@.a
##### Make esolid shared library
#libesolid: $(config_objects) $(bignum_objects) $(fp_objects) $(mapc_objects) $(esolid_objects)
# $(CC) -shared -Wl -o $(ESOLID_dir)/$@.so $(config_objects) $(bignum_objects) $(fp_objects) $(mapc_objects) $(esolid_objects)
# $(STRIP) $(ESOLID_dir)/$@.so
#### 4-3. main functions
##### Make executable
mapc_poly: $(ESOLID_dir)/main/mapc_poly_main.o libmapc
$(CC) -o $(ESOLID_dir)/$@ $(ESOLID_dir)/main/mapc_poly_main.o -L$(ESOLID_dir) -lmapc $(CFLAGS) $(LFLAGS)
mapc_sturm: $(ESOLID_dir)/main/mapc_sturm_main.o libmapc
$(CC) -o $(ESOLID_dir)/$@ $(ESOLID_dir)/main/mapc_sturm_main.o -L$(ESOLID_dir) -lmapc $(CFLAGS) $(LFLAGS)
#mapc_rt1: $(ESOLID_dir)/main/mapc_rt1_main.o libmapc
# $(CC) -o $(ESOLID_dir)/$@ $(ESOLID_dir)/main/mapc_rt1_main.o -L$(ESOLID_dir) -lmapc $(CFLAGS) $(LFLAGS)
mapc_pt1: $(ESOLID_dir)/main/mapc_pt1_main.o libmapc
$(CC) -o $(ESOLID_dir)/$@ $(ESOLID_dir)/main/mapc_pt1_main.o -L$(ESOLID_dir) -lmapc $(CFLAGS) $(LFLAGS)
#mapc_pt2: $(ESOLID_dir)/main/mapc_pt2_main.o libmapc
# $(CC) -o $(ESOLID_dir)/$@ $(ESOLID_dir)/main/mapc_pt2_main.o -L$(ESOLID_dir) -lmapc $(CFLAGS) $(LFLAGS)
mapc: $(ESOLID_dir)/main/mapc_main.o libmapc
$(CC) -o $(ESOLID_dir)/$@ $(ESOLID_dir)/main/mapc_main.o -L$(ESOLID_dir) -lmapc $(CFLAGS) $(LFLAGS)
esolid: $(ESOLID_dir)/main/esolid_main.o libesolid
$(CC) -o $(ESOLID_dir)/$@ $(ESOLID_dir)/main/esolid_main.o -L$(ESOLID_dir) -l$@ $(CFLAGS) $(LFLAGS)
### 5. Cleaning
clean:
rm -f $(ESOLID_dir)/src/*.o $(bignum_objects) $(esolid_objects) $(general_objects) $(mapc_objects) $(pseudoroot_objects)
rm -f $(ESOLID_dir)/libmapc.a $(ESOLID_dir)/libmapc.so $(ESOLID_dir)/libesolid.a $(ESOLID_dir)/libesolid.so
rm -f $(ESOLID_dir)/main/*.o
rm -f $(ESOLID_dir)/mapc* $(ESOLID_dir)/esolid
|