1 | ############################################################### |
---|
2 | # |
---|
3 | # First, choose a C and C++ compilers, and set compiler flags. |
---|
4 | # This is done by setting the variables CXX, CC, CFLAGS, and |
---|
5 | # CXXFLAGS. |
---|
6 | # |
---|
7 | ############################################################### |
---|
8 | |
---|
9 | |
---|
10 | CC=gcc |
---|
11 | # A C or C++ compiler, e. g., gcc, cc, xlc. |
---|
12 | # There are a few components written in C which may be compiled |
---|
13 | # under C++, but C compilers tend to generate slightly better code. |
---|
14 | # The C++ and C compilers (if different) must generate |
---|
15 | # compatible code. |
---|
16 | |
---|
17 | |
---|
18 | CXX=g++ |
---|
19 | # A C++ compiler, e.g., g++, CC, xlC |
---|
20 | |
---|
21 | |
---|
22 | CFLAGS=-O2 |
---|
23 | # Flags for the C compiler |
---|
24 | # Some useful flags: |
---|
25 | # -O2 -- recommended level of optimization |
---|
26 | # -m64 -- needed to get 64-bit longs on some platforms |
---|
27 | # -g -- debugging |
---|
28 | # -mcpu=v8 -- needed with gcc/g++ to get the full instruction set |
---|
29 | # of a SparcStation |
---|
30 | # -qarch=ppc -- needed with xlc/C to get the full instruction set |
---|
31 | # of a PowerPC |
---|
32 | |
---|
33 | |
---|
34 | |
---|
35 | CXXFLAGS=$(CFLAGS) |
---|
36 | # Flags for the C++ compiler (usually the same as CFLAGS) |
---|
37 | # Some useful flags: |
---|
38 | # -+ -- needed with xlC to make it treat .c files as C++ files |
---|
39 | |
---|
40 | # Here are a few more variables for standard utilities. |
---|
41 | # The defaults should almost always be OK. |
---|
42 | |
---|
43 | |
---|
44 | AR=ar |
---|
45 | # command to make a library |
---|
46 | |
---|
47 | ARFLAGS=ruv |
---|
48 | # arguments for AR |
---|
49 | |
---|
50 | RANLIB=ranlib |
---|
51 | # set to echo if you want to disable it completely |
---|
52 | |
---|
53 | LDFLAGS= |
---|
54 | # arguments for linker for C programs |
---|
55 | |
---|
56 | LDFLAGS_CXX=$(LDFLAGS) |
---|
57 | # libraries for linking C++ programs |
---|
58 | |
---|
59 | LDLIBS=-lm |
---|
60 | # libraries for linking C programs |
---|
61 | |
---|
62 | LDLIBS_CXX=$(LDLIBS) |
---|
63 | # libraries for linking C++ programs |
---|
64 | |
---|
65 | CPPFLAGS= |
---|
66 | # arguments for the C preprocessor |
---|
67 | |
---|
68 | LIBTOOL=libtool |
---|
69 | # libtool command |
---|
70 | |
---|
71 | DEF_PREFIX=/usr/local |
---|
72 | |
---|
73 | PREFIX=$(DEF_PREFIX) |
---|
74 | LIBDIR=$(PREFIX)/lib |
---|
75 | INCLUDEDIR=$(PREFIX)/include |
---|
76 | DOCDIR=$(PREFIX)/share/doc |
---|
77 | # where to install NTL |
---|
78 | |
---|
79 | ############################################################### |
---|
80 | # |
---|
81 | # Second, if you want to use GMP (the GNU Multi-Precision library), |
---|
82 | # define the variables GMP_OPT_INCDIR, GMP_OPT_LIBDIR, GMP_OPT_LIB below. |
---|
83 | # You also will have to set either NTL_GMP_LIP or NTL_GMP_HACK |
---|
84 | # in the config.h file. |
---|
85 | # |
---|
86 | # Using GMP can lead to significant performance gains on some |
---|
87 | # platforms. You can obtain GMP from http://www.swox.com/gmp. |
---|
88 | # Once you unpack it into a directory, just execute |
---|
89 | # ./configure; make |
---|
90 | # in that directory. |
---|
91 | # |
---|
92 | ############################################################### |
---|
93 | |
---|
94 | |
---|
95 | GMP_PREFIX=$(DEF_PREFIX) |
---|
96 | |
---|
97 | GMP_INCDIR=$(GMP_PREFIX)/include |
---|
98 | # directory containing gmp.h if using GMP |
---|
99 | |
---|
100 | GMP_LIBDIR=$(GMP_PREFIX)/lib |
---|
101 | # directory containing libgmp.a if using GMP |
---|
102 | |
---|
103 | GMP_OPT_INCDIR=# -I$(GMP_INCDIR) # GMP |
---|
104 | GMP_OPT_LIBDIR=# -L$(GMP_LIBDIR) # GMP |
---|
105 | GMP_OPT_LIB=# -lgmp # GMP |
---|
106 | # uncomment these if using GMP |
---|
107 | |
---|
108 | |
---|
109 | ############################################################### |
---|
110 | # |
---|
111 | # Third, if you want to use gf2x (a library for fast |
---|
112 | # multiplication over GF(2)[X]), you need to |
---|
113 | # define the variables GF2X_OPT_INCDIR, GF2X_OPT_LIBDIR, GF2X_OPT_LIB below. |
---|
114 | # You also will have to set NTL_GF2X_LIB |
---|
115 | # in the config.h file. |
---|
116 | # |
---|
117 | ############################################################### |
---|
118 | |
---|
119 | GF2X_PREFIX=$(DEF_PREFIX) |
---|
120 | |
---|
121 | GF2X_INCDIR=$(GF2X_PREFIX)/include |
---|
122 | # directory containing gf2x.h if using gf2x |
---|
123 | |
---|
124 | GF2X_LIBDIR=$(GF2X_PREFIX)/lib |
---|
125 | # directory containing libgf2x.a |
---|
126 | |
---|
127 | GF2X_OPT_INCDIR=# -I$(GF2X_INCDIR) # GF2X |
---|
128 | GF2X_OPT_LIBDIR=# -L$(GF2X_LIBDIR) # GF2X |
---|
129 | GF2X_OPT_LIB=# -lgf2x # GF2X |
---|
130 | # uncomment these if using gf2x |
---|
131 | |
---|
132 | |
---|
133 | ############################################################### |
---|
134 | # |
---|
135 | # Fourth, if you do not want to run the wizard that automagically |
---|
136 | # sets some performace related flags in config.h, set the flag below. |
---|
137 | # |
---|
138 | ############################################################### |
---|
139 | |
---|
140 | |
---|
141 | WIZARD=on |
---|
142 | # Set to off if you want to bypass the wizard; otherwise, set to on. |
---|
143 | |
---|
144 | |
---|
145 | ################################################################# |
---|
146 | # |
---|
147 | # That's it! You can ignore everything else in this file! |
---|
148 | # |
---|
149 | ################################################################# |
---|
150 | |
---|
151 | |
---|
152 | # object files |
---|
153 | |
---|
154 | O01=FFT.o FacVec.o GF2.o GF2E.o GF2EX.o GF2EXFactoring.o GF2X.o GF2X1.o |
---|
155 | O02=$(O01) GF2XFactoring.o GF2XVec.o GetTime.o HNF.o ctools.o LLL.o LLL_FP.o |
---|
156 | O03=$(O02) LLL_QP.o LLL_RR.o LLL_XD.o RR.o WordVector.o ZZ.o ZZVec.o |
---|
157 | O04=$(O03) ZZX.o ZZX1.o ZZXCharPoly.o ZZXFactoring.o ZZ_p.o ZZ_pE.o ZZ_pEX.o |
---|
158 | O05=$(O04) ZZ_pEXFactoring.o ZZ_pX.o ZZ_pX1.o ZZ_pXCharPoly.o ZZ_pXFactoring.o |
---|
159 | O06=$(O05) fileio.o lip.o lzz_p.o lzz_pE.o lzz_pEX.o lzz_pEXFactoring.o |
---|
160 | O07=$(O06) lzz_pX.o lzz_pX1.o lzz_pXCharPoly.o lzz_pXFactoring.o |
---|
161 | O08=$(O07) mat_GF2.o mat_GF2E.o mat_RR.o mat_ZZ.o mat_ZZ_p.o |
---|
162 | O09=$(O08) mat_ZZ_pE.o mat_lzz_p.o mat_lzz_pE.o mat_poly_ZZ.o |
---|
163 | O10=$(O09) mat_poly_ZZ_p.o mat_poly_lzz_p.o pair_GF2EX_long.o |
---|
164 | O11=$(O10) pair_GF2X_long.o pair_ZZX_long.o pair_ZZ_pEX_long.o |
---|
165 | O12=$(O11) pair_ZZ_pX_long.o pair_lzz_pEX_long.o pair_lzz_pX_long.o |
---|
166 | O13=$(O12) quad_float.o tools.o vec_GF2.o vec_GF2E.o vec_GF2XVec.o |
---|
167 | O14=$(O13) vec_RR.o vec_ZZ.o vec_ZZVec.o vec_ZZ_p.o vec_ZZ_pE.o |
---|
168 | O15=$(O14) vec_double.o vec_long.o vec_lzz_p.o vec_lzz_pE.o vec_quad_float.o |
---|
169 | O16=$(O15) vec_vec_GF2.o vec_vec_GF2E.o vec_vec_RR.o vec_vec_ZZ.o |
---|
170 | O17=$(O16) vec_vec_ZZ_p.o vec_vec_ZZ_pE.o vec_vec_long.o vec_vec_lzz_p.o |
---|
171 | O18=$(O17) vec_vec_lzz_pE.o vec_xdouble.o xdouble.o |
---|
172 | O19=$(O18) G_LLL_FP.o G_LLL_QP.o G_LLL_XD.o G_LLL_RR.o vec_ulong.o vec_vec_ulong.o |
---|
173 | |
---|
174 | OBJ=$(O19) |
---|
175 | |
---|
176 | # library source files |
---|
177 | |
---|
178 | |
---|
179 | S01=FFT.c FacVec.c GF2.c GF2E.c GF2EX.c GF2EXFactoring.c GF2X.c GF2X1.c |
---|
180 | S02=$(S01) GF2XFactoring.c GF2XVec.c HNF.c ctools.c LLL.c LLL_FP.c LLL_QP.c |
---|
181 | S03=$(S02) LLL_RR.c LLL_XD.c RR.c WordVector.c ZZ.c ZZVec.c ZZX.c ZZX1.c |
---|
182 | S04=$(S03) ZZXCharPoly.c ZZXFactoring.c ZZ_p.c ZZ_pE.c ZZ_pEX.c |
---|
183 | S05=$(S04) ZZ_pEXFactoring.c ZZ_pX.c ZZ_pX1.c ZZ_pXCharPoly.c |
---|
184 | S06=$(S05) ZZ_pXFactoring.c fileio.c lip.c lzz_p.c lzz_pE.c lzz_pEX.c |
---|
185 | S07=$(S06) lzz_pEXFactoring.c lzz_pX.c lzz_pX1.c |
---|
186 | S08=$(S07) lzz_pXCharPoly.c lzz_pXFactoring.c mat_GF2.c mat_GF2E.c |
---|
187 | S09=$(S08) mat_RR.c mat_ZZ.c mat_ZZ_p.c mat_ZZ_pE.c mat_lzz_p.c mat_lzz_pE.c |
---|
188 | S10=$(S09) mat_poly_ZZ.c mat_poly_ZZ_p.c mat_poly_lzz_p.c pair_GF2EX_long.c |
---|
189 | S11=$(S10) pair_GF2X_long.c pair_ZZX_long.c pair_ZZ_pEX_long.c |
---|
190 | S12=$(S11) pair_ZZ_pX_long.c pair_lzz_pEX_long.c pair_lzz_pX_long.c |
---|
191 | S13=$(S12) quad_float.c tools.c vec_GF2.c vec_GF2E.c vec_GF2XVec.c vec_RR.c |
---|
192 | S14=$(S13) vec_ZZ.c vec_ZZVec.c vec_ZZ_p.c vec_ZZ_pE.c vec_double.c |
---|
193 | S15=$(S14) vec_long.c vec_lzz_p.c vec_lzz_pE.c vec_quad_float.c |
---|
194 | S16=$(S15) vec_vec_GF2.c vec_vec_GF2E.c vec_vec_RR.c vec_vec_ZZ.c |
---|
195 | S17=$(S16) vec_vec_ZZ_p.c vec_vec_ZZ_pE.c vec_vec_long.c vec_vec_lzz_p.c |
---|
196 | S18=$(S17) vec_vec_lzz_pE.c vec_xdouble.c xdouble.c |
---|
197 | S19=$(S18) G_LLL_FP.c G_LLL_QP.c G_LLL_XD.c G_LLL_RR.c |
---|
198 | S20=$(S19) vec_ulong.c vec_vec_ulong.c |
---|
199 | |
---|
200 | SRC = $(S20) |
---|
201 | |
---|
202 | # library source files that are header files |
---|
203 | |
---|
204 | SINC = c_lip_impl.h g_lip_impl.h |
---|
205 | |
---|
206 | |
---|
207 | |
---|
208 | |
---|
209 | |
---|
210 | # library header files |
---|
211 | |
---|
212 | IN01= FFT.h FacVec.h GF2.h GF2E.h GF2EX.h GF2EXFactoring.h GF2X.h |
---|
213 | IN02=$(IN01) GF2XFactoring.h GF2XVec.h HNF.h ctools.h LLL.h |
---|
214 | IN03=$(IN02) RR.h SPMM_ASM.h WordVector.h ZZ.h ZZVec.h ZZX.h ZZXFactoring.h |
---|
215 | IN04=$(IN03) ZZ_p.h ZZ_pE.h ZZ_pEX.h ZZ_pEXFactoring.h ZZ_pX.h ZZ_pXFactoring.h |
---|
216 | IN05=$(IN04) fileio.h lip.h lzz_p.h lzz_pE.h lzz_pEX.h lzz_pEXFactoring.h |
---|
217 | IN06=$(IN05) lzz_pX.h lzz_pXFactoring.h mat_GF2.h mat_GF2E.h mat_RR.h |
---|
218 | IN07=$(IN06) mat_ZZ.h mat_ZZ_p.h mat_ZZ_pE.h mat_lzz_p.h mat_lzz_pE.h |
---|
219 | IN08=$(IN07) mat_poly_ZZ.h mat_poly_ZZ_p.h mat_poly_lzz_p.h matrix.h |
---|
220 | IN09=$(IN08) pair.h vector.h pair_GF2EX_long.h pair_GF2X_long.h |
---|
221 | IN10=$(IN09) pair_ZZX_long.h pair_ZZ_pEX_long.h pair_ZZ_pX_long.h |
---|
222 | IN11=$(IN10) pair_lzz_pEX_long.h pair_lzz_pX_long.h quad_float.h |
---|
223 | IN12=$(IN11) tools.h vec_GF2.h vec_GF2E.h vec_GF2XVec.h vec_RR.h |
---|
224 | IN13=$(IN12) vec_ZZ.h vec_ZZVec.h vec_ZZ_p.h vec_ZZ_pE.h vec_double.h |
---|
225 | IN14=$(IN13) vec_long.h vec_lzz_p.h vec_lzz_pE.h vec_quad_float.h |
---|
226 | IN15=$(IN14) vec_vec_GF2.h vec_vec_GF2E.h vec_vec_RR.h vec_vec_ZZ.h |
---|
227 | IN16=$(IN15) vec_vec_ZZ_p.h vec_vec_ZZ_pE.h vec_vec_long.h vec_vec_lzz_p.h |
---|
228 | IN17=$(IN16) vec_vec_lzz_pE.h vec_xdouble.h xdouble.h config.h version.h |
---|
229 | IN18=$(IN17) def_config.h new.h vec_ulong.h vec_vec_ulong.h c_lip.h g_lip.h |
---|
230 | |
---|
231 | INCL=$(IN18) |
---|
232 | |
---|
233 | |
---|
234 | |
---|
235 | # test data |
---|
236 | |
---|
237 | TD1=BerlekampTestIn BerlekampTestOut CanZassTestIn CanZassTestOut |
---|
238 | TD2=$(TD1) ZZXFacTestIn ZZXFacTestOut MoreFacTestIn LLLTestIn LLLTestOut RRTestIn RRTestOut |
---|
239 | TD3=$(TD2) MatrixTestIn MatrixTestOut CharPolyTestIn |
---|
240 | TD4=$(TD3) CharPolyTestOut QuadTestIn QuadTestOut |
---|
241 | |
---|
242 | TD = $(TD4) |
---|
243 | |
---|
244 | # test source files |
---|
245 | |
---|
246 | TS1=QuickTest.c BerlekampTest.c CanZassTest.c ZZXFacTest.c MoreFacTest.c LLLTest.c |
---|
247 | TS2=$(TS1) subset.c MatrixTest.c CharPolyTest.c RRTest.c QuadTest.c |
---|
248 | TS3=$(TS2) GF2XTest.c GF2EXTest.c BitMatTest.c ZZ_pEXTest.c lzz_pEXTest.c |
---|
249 | |
---|
250 | TS = $(TS3) |
---|
251 | |
---|
252 | # scripts |
---|
253 | |
---|
254 | SCRIPTS1=MakeGetTime TestScript dosify unixify RemoveProg |
---|
255 | SCRIPTS2=$(SCRIPTS1) configure DoConfig mfile cfile |
---|
256 | |
---|
257 | SCRIPTS=$(SCRIPTS2) |
---|
258 | |
---|
259 | # auxilliary source |
---|
260 | |
---|
261 | MD=MakeDesc.c MakeDescAux.c newnames.c gen_lip_gmp_aux.c gen_gmp_aux.c |
---|
262 | |
---|
263 | GT=GetTime1.c GetTime2.c GetTime3.c GetTime4.c GetTime5.c TestGetTime.c |
---|
264 | |
---|
265 | |
---|
266 | # documentation |
---|
267 | |
---|
268 | |
---|
269 | D01=copying.txt GF2.txt GF2E.txt GF2EX.txt GF2EXFactoring.txt GF2X.txt |
---|
270 | D02=$(D01) GF2XFactoring.txt GF2XVec.txt HNF.txt LLL.txt RR.txt |
---|
271 | D03=$(D02) ZZ.txt ZZVec.txt ZZX.txt ZZXFactoring.txt ZZ_p.txt ZZ_pE.txt |
---|
272 | D04=$(D03) ZZ_pEX.txt ZZ_pEXFactoring.txt ZZ_pX.txt ZZ_pXFactoring.txt |
---|
273 | D05=$(D04) conversions.txt flags.txt lzz_p.txt lzz_pE.txt lzz_pEX.txt |
---|
274 | D06=$(D05) lzz_pEXFactoring.txt lzz_pX.txt lzz_pXFactoring.txt mat_GF2.txt |
---|
275 | D07=$(D06) mat_GF2E.txt mat_RR.txt mat_ZZ.txt mat_ZZ_p.txt mat_ZZ_pE.txt |
---|
276 | D08=$(D07) mat_lzz_p.txt mat_lzz_pE.txt mat_poly_ZZ.txt mat_poly_ZZ_p.txt |
---|
277 | D09=$(D08) mat_poly_lzz_p.txt matrix.txt pair.txt vector.txt |
---|
278 | D10=$(D09) quad_float.txt sedscript.txt tools.txt vec_GF2.txt |
---|
279 | D11=$(D10) vec_GF2E.txt vec_RR.txt vec_ZZ.txt vec_ZZ_p.txt vec_ZZ_pE.txt |
---|
280 | D12=$(D11) vec_lzz_p.txt vec_lzz_pE.txt xdouble.txt names.txt |
---|
281 | D13=$(D12) tour-ack.html tour-intro.html tour-time.html tour-changes.html |
---|
282 | D14=$(D13) tour-modules.html tour-stdcxx.html tour-unix.html tour-examples.html |
---|
283 | D15=$(D14) tour-roadmap.html tour-win.html tour-impl.html tour-struct.html |
---|
284 | D16=$(D15) tour.html tour-ex1.html tour-ex2.html tour-ex3.html tour-ex4.html |
---|
285 | D17=$(D16) tour-ex5.html tour-ex6.html arrow1.gif arrow2.gif arrow3.gif |
---|
286 | D18=$(D17) tour-gmp.html tour-gf2x.html tour-tips.html config.txt version.txt |
---|
287 | |
---|
288 | DOC = $(D18) |
---|
289 | |
---|
290 | |
---|
291 | |
---|
292 | # test program executables |
---|
293 | |
---|
294 | PROG1=QuickTest BerlekampTest CanZassTest ZZXFacTest MoreFacTest LLLTest BitMatTest |
---|
295 | PROG2=$(PROG1) MatrixTest CharPolyTest RRTest QuadTest |
---|
296 | PROG3=$(PROG2) GF2XTest GF2EXTest subset ZZ_pEXTest lzz_pEXTest |
---|
297 | PROGS = $(PROG3) |
---|
298 | |
---|
299 | # things to save to a tar file |
---|
300 | |
---|
301 | SFI1=makefile $(SRC) $(SINC) $(SCRIPTS) $(MD) $(GT) $(TS) $(TD) mach_desc.win |
---|
302 | SFI2=$(SFI1) MulTimeTest.c PolyTimeTest.c Poly1TimeTest.c GF2XTimeTest.c |
---|
303 | SFI3=$(SFI2) InitSettings.c DispSettings.c WizardAux Wizard def_makefile |
---|
304 | SFILES=$(SFI3) |
---|
305 | |
---|
306 | |
---|
307 | ################################################################# |
---|
308 | # |
---|
309 | # Rules for compiling the library |
---|
310 | # |
---|
311 | ################################################################# |
---|
312 | |
---|
313 | |
---|
314 | NTL_INCLUDE = -I../include -I. |
---|
315 | # NTL needs this to find its include files |
---|
316 | |
---|
317 | COMPILE = $(CC) $(NTL_INCLUDE) $(CPPFLAGS) $(CFLAGS) -c |
---|
318 | COMPILE_CXX = $(CXX) $(NTL_INCLUDE) $(CPPFLAGS) $(CXXFLAGS) -c |
---|
319 | |
---|
320 | LINK = $(CC) $(NTL_INCLUDE) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) |
---|
321 | LINK_CXX = $(CXX) $(NTL_INCLUDE) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS_CXX) |
---|
322 | |
---|
323 | |
---|
324 | |
---|
325 | # 'make all' does a complete make, including all setup. |
---|
326 | # It also creates the file 'all', which means you should |
---|
327 | # run 'make clobber' before running 'make' or 'make all' |
---|
328 | # again. |
---|
329 | |
---|
330 | all: |
---|
331 | make setup1 |
---|
332 | make setup2 |
---|
333 | make setup3 |
---|
334 | make setup4 |
---|
335 | make ntl.a |
---|
336 | touch all |
---|
337 | |
---|
338 | |
---|
339 | # setup1 generates the file ../incluse/NTL/mach_desc.h |
---|
340 | |
---|
341 | setup1: |
---|
342 | $(COMPILE) MakeDescAux.c |
---|
343 | $(LINK) -o MakeDesc MakeDesc.c MakeDescAux.o $(LDLIBS) |
---|
344 | ./MakeDesc |
---|
345 | mv mach_desc.h ../include/NTL/mach_desc.h |
---|
346 | |
---|
347 | # setup2 generates the file GetTime.c |
---|
348 | |
---|
349 | setup2: |
---|
350 | sh MakeGetTime "$(LINK)" "$(LDLIBS)" |
---|
351 | |
---|
352 | # setup3 generates the files lip_gmp_aux_impl.h and ../include/NTL/gmp_aux.h |
---|
353 | # The file lip_gmp_aux_impl.h is included when lip.c when NTL_GMP_HACK is set. |
---|
354 | # The file ../include/NTL/gmp_aux.h is included in ../include/NTL/lip.h |
---|
355 | # when NTL_GMP_LIP is set. |
---|
356 | # When these flags are not set, empty files are produced. |
---|
357 | |
---|
358 | setup3: |
---|
359 | $(LINK) $(GMP_OPT_INCDIR) -o gen_lip_gmp_aux gen_lip_gmp_aux.c $(GMP_OPT_LIBDIR) $(GMP_OPT_LIB) $(LDLIBS) |
---|
360 | ./gen_lip_gmp_aux > lip_gmp_aux_impl.h |
---|
361 | $(LINK) $(GMP_OPT_INCDIR) -o gen_gmp_aux gen_gmp_aux.c $(GMP_OPT_LIBDIR) $(GMP_OPT_LIB) $(LDLIBS) |
---|
362 | ./gen_gmp_aux > ../include/NTL/gmp_aux.h |
---|
363 | |
---|
364 | # setup4 runs the wizard |
---|
365 | |
---|
366 | setup4: |
---|
367 | sh Wizard $(WIZARD) |
---|
368 | |
---|
369 | |
---|
370 | ntl.a: $(OBJ) |
---|
371 | $(AR) $(ARFLAGS) ntl.a $(OBJ) #LSTAT |
---|
372 | - $(RANLIB) ntl.a #LSTAT |
---|
373 | # $(LIBTOOL) --mode=link $(LINK_CXX) -o libntl.la $(OBJ:.o=.lo) $(GMP_OPT_LIBDIR) $(GMP_OPT_LIB) $(GF2X_OPT_LIBDIR) $(GF2X_OPT_LIB) $(LDLIBS_CXX) -rpath $(LIBDIR) -version-info `cat VERSION_INFO` #LSHAR |
---|
374 | |
---|
375 | LCOMP= #LSTAT |
---|
376 | # LCOMP=$(LIBTOOL) --mode=compile #LSHAR |
---|
377 | |
---|
378 | lip.o: lip.c g_lip_impl.h c_lip_impl.h lip_gmp_aux_impl.h |
---|
379 | $(LCOMP) $(COMPILE) $(GMP_OPT_INCDIR) lip.c |
---|
380 | |
---|
381 | ctools.o: ctools.c |
---|
382 | $(LCOMP) $(COMPILE) ctools.c |
---|
383 | |
---|
384 | |
---|
385 | GetTime.o: GetTime.c |
---|
386 | $(LCOMP) $(COMPILE) GetTime.c |
---|
387 | |
---|
388 | |
---|
389 | |
---|
390 | .c.o: |
---|
391 | $(LCOMP) $(COMPILE_CXX) $(GF2X_OPT_INCDIR) $< |
---|
392 | |
---|
393 | .c: |
---|
394 | $(LINK_CXX) -o $@ $< ntl.a $(GMP_OPT_LIBDIR) $(GMP_OPT_LIB) $(GF2X_OPT_LIBDIR) $(GF2X_OPT_LIB) $(LDLIBS_CXX) #LSTAT |
---|
395 | # $(LIBTOOL) --mode=link $(LINK_CXX) -o $@ $< libntl.la #LSHAR |
---|
396 | |
---|
397 | ################################################################# |
---|
398 | # |
---|
399 | # Rule for running tests |
---|
400 | # make check runs a series of tests |
---|
401 | # |
---|
402 | ################################################################# |
---|
403 | |
---|
404 | check: |
---|
405 | sh RemoveProg $(PROGS) |
---|
406 | make QuickTest |
---|
407 | ./QuickTest |
---|
408 | sh RemoveProg QuickTest |
---|
409 | sh TestScript |
---|
410 | |
---|
411 | ################################################################# |
---|
412 | # |
---|
413 | # Rule for installing |
---|
414 | # make install just does a simple copy of the include file |
---|
415 | # and library. The -p option is used to preserve file attributes. |
---|
416 | # This helps avoid some problems (especially when copying ntl.a). |
---|
417 | # Also, an attempt is made to make everything that is |
---|
418 | # installed readable by everyone. |
---|
419 | # |
---|
420 | # make uninstall removes these files |
---|
421 | # |
---|
422 | ################################################################# |
---|
423 | |
---|
424 | |
---|
425 | |
---|
426 | |
---|
427 | install: |
---|
428 | mkdir -p -m 755 $(INCLUDEDIR) |
---|
429 | rm -rf $(INCLUDEDIR)/NTL |
---|
430 | mkdir -m 755 $(INCLUDEDIR)/NTL |
---|
431 | cp -p ../include/NTL/*.h $(INCLUDEDIR)/NTL |
---|
432 | - chmod -R a+r $(INCLUDEDIR)/NTL |
---|
433 | mkdir -p -m 755 $(DOCDIR) |
---|
434 | rm -rf $(DOCDIR)/NTL |
---|
435 | mkdir -m 755 $(DOCDIR)/NTL |
---|
436 | cp -p ../doc/*.txt $(DOCDIR)/NTL |
---|
437 | cp -p ../doc/*.html $(DOCDIR)/NTL |
---|
438 | cp -p ../doc/*.gif $(DOCDIR)/NTL |
---|
439 | - chmod -R a+r $(DOCDIR)/NTL |
---|
440 | mkdir -p -m 755 $(LIBDIR) |
---|
441 | cp -p ntl.a $(LIBDIR)/libntl.a #LSTAT |
---|
442 | - chmod a+r $(LIBDIR)/libntl.a #LSTAT |
---|
443 | # $(LIBTOOL) --mode=install cp -p libntl.la $(LIBDIR) #LSHAR |
---|
444 | |
---|
445 | |
---|
446 | uninstall: |
---|
447 | rm -f $(LIBDIR)/libntl.a #LSTAT |
---|
448 | # $(LIBTOOL) --mode=uninstall rm -f $(LIBDIR)/libntl.la #LSHAR |
---|
449 | rm -rf $(INCLUDEDIR)/NTL |
---|
450 | rm -rf $(DOCDIR)/NTL |
---|
451 | |
---|
452 | ################################################################# |
---|
453 | # |
---|
454 | # Rules for cleaning up |
---|
455 | # |
---|
456 | # make clobber removes *everything* created by make, |
---|
457 | # but it does not restore config.h to its default. |
---|
458 | # |
---|
459 | # make clean tidies up a bit |
---|
460 | # |
---|
461 | ################################################################# |
---|
462 | |
---|
463 | clobber: |
---|
464 | rm -f ntl.a mach_desc.h ../include/NTL/mach_desc.h GetTime.c |
---|
465 | rm -f lip_gmp_aux_impl.h ../include/NTL/gmp_aux.h |
---|
466 | sh RemoveProg $(PROGS) MakeDesc TestGetTime gen_lip_gmp_aux gen_gmp_aux |
---|
467 | rm -f *.o |
---|
468 | rm -rf small |
---|
469 | rm -f cfileout mfileout |
---|
470 | rm -rf .libs *.lo libntl.la |
---|
471 | rm -f all |
---|
472 | |
---|
473 | clean: |
---|
474 | sh RemoveProg MakeDesc TestGetTime gen_lip_gmp_aux gen_gmp_aux |
---|
475 | rm -f *.o |
---|
476 | rm -rf small |
---|
477 | # - $(LIBTOOL) --mode=clean rm -f libntl.la *.lo #LSHAR |
---|
478 | |
---|
479 | ################################################################# |
---|
480 | # |
---|
481 | # Rules for making tar and zip files |
---|
482 | # |
---|
483 | # make package creates a tar.gz file suitable for Unix |
---|
484 | # |
---|
485 | # make winpack creates a zip file suitable for Windows |
---|
486 | # |
---|
487 | ################################################################# |
---|
488 | |
---|
489 | |
---|
490 | package: |
---|
491 | sh unixify "$(SFILES) DIRNAME WINDIR VERSION_INFO NOTES" "$(INCL)" "$(DOC)" |
---|
492 | rm -rf `cat DIRNAME` |
---|
493 | rm -f `cat DIRNAME`.tar |
---|
494 | rm -f `cat DIRNAME`.tar.gz |
---|
495 | mv unix `cat DIRNAME` |
---|
496 | chmod -R a+rX `cat DIRNAME` |
---|
497 | tar -cvf `cat DIRNAME`.tar `cat DIRNAME` |
---|
498 | gzip `cat DIRNAME`.tar |
---|
499 | rm -rf `cat DIRNAME` |
---|
500 | |
---|
501 | winpack: |
---|
502 | sh dosify "$(SRC)" "$(INCL)" "$(DOC)" "$(TS)" "$(TD)" "$(SINC)" |
---|
503 | rm -rf `cat WINDIR` |
---|
504 | rm -f `cat WINDIR`.zip |
---|
505 | mv dos `cat WINDIR` |
---|
506 | chmod -R a+rX `cat WINDIR` |
---|
507 | find ./`cat WINDIR` '!' -name '*.gif' -print | zip -l `cat WINDIR` -@ |
---|
508 | find ./`cat WINDIR` -name '*.gif' -print | zip -u `cat WINDIR` -@ |
---|
509 | rm -rf `cat WINDIR` |
---|
510 | |
---|
511 | |
---|
512 | ###################################################################### |
---|
513 | # |
---|
514 | # config wizard related stuff |
---|
515 | # |
---|
516 | ###################################################################### |
---|
517 | |
---|
518 | WO1 = FFT.o GetTime.o ctools.o ZZ.o ZZVec.o ZZ_p.o ZZ_pX.o |
---|
519 | WO2 = $(WO1) ZZ_pX1.o lip.o tools.o vec_ZZ.o vec_ZZ_p.o vec_long.o |
---|
520 | WO3 = $(WO2) GF2.o WordVector.o vec_GF2.o GF2X.o GF2X1.o |
---|
521 | |
---|
522 | WOBJ = $(WO3) |
---|
523 | |
---|
524 | # wntl.a: LCOMP= #LSHAR |
---|
525 | wntl.a: $(WOBJ) |
---|
526 | $(AR) $(ARFLAGS) wntl.a $(WOBJ) |
---|
527 | - $(RANLIB) wntl.a |
---|
528 | |
---|
529 | MulTimeTest: |
---|
530 | $(LINK_CXX) -o MulTimeTest MulTimeTest.c wntl.a $(GMP_OPT_LIBDIR) $(GMP_OPT_LIB) $(LDLIBS_CXX) |
---|
531 | |
---|
532 | PolyTimeTest: |
---|
533 | $(LINK_CXX) -o PolyTimeTest PolyTimeTest.c wntl.a $(GMP_OPT_LIBDIR) $(GMP_OPT_LIB) $(LDLIBS_CXX) |
---|
534 | |
---|
535 | Poly1TimeTest: |
---|
536 | $(LINK_CXX) -o Poly1TimeTest Poly1TimeTest.c wntl.a $(GMP_OPT_LIBDIR) $(GMP_OPT_LIB) $(LDLIBS_CXX) |
---|
537 | |
---|
538 | |
---|
539 | GF2XTimeTest: |
---|
540 | $(LINK_CXX) -o GF2XTimeTest GF2XTimeTest.c wntl.a $(GMP_OPT_LIBDIR) $(GMP_OPT_LIB) $(LDLIBS_CXX) |
---|
541 | |
---|
542 | InitSettings: |
---|
543 | $(LINK_CXX) -o InitSettings InitSettings.c $(LDLIBS_CXX) |
---|
544 | |
---|
545 | |
---|
546 | DispSettings: |
---|
547 | $(LINK_CXX) -o DispSettings DispSettings.c $(LDLIBS_CXX) |
---|
548 | |
---|
549 | |
---|
550 | |
---|
551 | |
---|