1 | # @configure_input@ |
---|
2 | # $Id$ |
---|
3 | |
---|
4 | # |
---|
5 | # GNUmakefile.in - used by `configure' to create `GNUmakefile', the |
---|
6 | # top level makefile for Factory. |
---|
7 | # |
---|
8 | # In general, you should let `configure' guess the correct values |
---|
9 | # for the variables below. But if something seriously goes wrong |
---|
10 | # in configuring, please inform the authors and feel free to |
---|
11 | # edit the marked section. |
---|
12 | # |
---|
13 | # See the `INSTALL' file for information on how to build Factory. |
---|
14 | # |
---|
15 | # Note: Use GNU `make' (`gmake') to make with this makefile. |
---|
16 | # |
---|
17 | |
---|
18 | ############### START OF CONFIGURABLE SECTION ############### |
---|
19 | |
---|
20 | SHELL = /bin/sh |
---|
21 | |
---|
22 | # |
---|
23 | # - versions. Do not change version here !!! |
---|
24 | # |
---|
25 | version = @factory_version@ |
---|
26 | distname = factory-$(version) |
---|
27 | |
---|
28 | # |
---|
29 | # - paths. |
---|
30 | # |
---|
31 | prefix = @prefix@ |
---|
32 | exec_prefix = @exec_prefix@ |
---|
33 | libdir = @libdir@ |
---|
34 | datadir = @datadir@ |
---|
35 | gftabledir = @gftabledir@ |
---|
36 | includedir = @includedir@ |
---|
37 | templatedir = @templatedir@ |
---|
38 | |
---|
39 | srcdir = @srcdir@ |
---|
40 | VPATH = @srcdir@ |
---|
41 | |
---|
42 | # |
---|
43 | # - the name of the game. |
---|
44 | # |
---|
45 | libfactory = @libfactory@ |
---|
46 | |
---|
47 | # |
---|
48 | # - programs. |
---|
49 | # |
---|
50 | CC = @CC@ |
---|
51 | CXX = @CXX@ |
---|
52 | # seems configure sometimes finds non-BSD install, so we better |
---|
53 | # hardcode path to our install-sh |
---|
54 | INSTALL = $(srcdir)/bin/install-sh -c |
---|
55 | INSTALL_DATA = @INSTALL_DATA@ |
---|
56 | INSTALL_PROGRAM=@INSTALL_PROGRAM@ |
---|
57 | RANLIB = @RANLIB@ |
---|
58 | |
---|
59 | LN_S = @LN_S@ |
---|
60 | AR = @AR@ |
---|
61 | BISON = @BISON@ |
---|
62 | MKINSTALLDIRS = @FACTORY_MKINSTALLDIRS@ |
---|
63 | MAKEHEADER = @FACTORY_MAKEHEADER@ |
---|
64 | |
---|
65 | # |
---|
66 | # - flags. |
---|
67 | # |
---|
68 | CFLAGS = @CFLAGS@ |
---|
69 | CPPFLAGS = @CPPFLAGS@ |
---|
70 | CXXFLAGS = @CXXFLAGS@ |
---|
71 | DEFS = @DEFS@ |
---|
72 | LDFLAGS = @LDFLAGS@ |
---|
73 | LIBS = @LIBS@ |
---|
74 | |
---|
75 | ARFLAGS = @ARFLAGS@ |
---|
76 | MAKEHEADERFLAGS=@MAKEHEADERFLAGS@ |
---|
77 | |
---|
78 | # |
---|
79 | # - some other variables. |
---|
80 | # |
---|
81 | factorysrc = @factorysrc@ |
---|
82 | factoryincl = @factoryincl@ |
---|
83 | memmansrc = @memmansrc@ |
---|
84 | memmanincl = @memmanincl@ |
---|
85 | |
---|
86 | alltargets = @alltargets@ |
---|
87 | installtargets =@installtargets@ |
---|
88 | uninstalltargets=@uninstalltargets@ |
---|
89 | |
---|
90 | ############### END OF CONFIGURABLE SECTION ############### |
---|
91 | |
---|
92 | # |
---|
93 | # - compiler flags. |
---|
94 | # |
---|
95 | WARNFLAGS = -w |
---|
96 | |
---|
97 | # flags to translate library c files |
---|
98 | LIBCFLAGS = $(WARNFLAGS) \ |
---|
99 | -I. -I$(srcdir) -I$(includedir) \ |
---|
100 | $(DEFS) $(CPPFLAGS) $(CFLAGS) |
---|
101 | |
---|
102 | # flags to translate library c++ files |
---|
103 | LIBCXXFLAGS = $(WARNFLAGS) -fno-implicit-templates \ |
---|
104 | -I. -I$(srcdir) -I$(includedir) \ |
---|
105 | $(DEFS) $(CPPFLAGS) $(CXXFLAGS) |
---|
106 | |
---|
107 | LIBCGGFLAGS = $(WARNFLAGS) -fno-implicit-templates \ |
---|
108 | -I. -I$(srcdir) -I$(includedir) \ |
---|
109 | $(DEFS) $(CPPFLAGS) |
---|
110 | |
---|
111 | # flags to translate ftmpl_inst.cc |
---|
112 | TMPLCXXFLAGS = $(LIBCXXFLAGS) |
---|
113 | |
---|
114 | # flags to link test programs |
---|
115 | TESTCXXFLAGS = $(LIBCXXFLAGS) |
---|
116 | |
---|
117 | # flags to link test programs |
---|
118 | TESTLDFLAGS = $(LIBS) $(LDFLAGS) |
---|
119 | |
---|
120 | # flags to create dependency lists |
---|
121 | DEPCXXFLAGS = -I. -I$(srcdir) -I$(includedir) \ |
---|
122 | $(DEFS) $(CPPFLAGS) |
---|
123 | |
---|
124 | # |
---|
125 | # - source files. |
---|
126 | # |
---|
127 | |
---|
128 | # factory source files |
---|
129 | basefactorysrc := \ |
---|
130 | canonicalform.cc \ |
---|
131 | cf_algorithm.cc \ |
---|
132 | cf_binom.cc \ |
---|
133 | cf_char.cc \ |
---|
134 | cf_chinese.cc \ |
---|
135 | cf_cyclo.cc\ |
---|
136 | cf_eval.cc \ |
---|
137 | cf_factor.cc \ |
---|
138 | cf_factory.cc \ |
---|
139 | cf_gcd.cc \ |
---|
140 | cf_gcd_charp.cc \ |
---|
141 | cf_gcd_smallp.cc \ |
---|
142 | cf_generator.cc \ |
---|
143 | cf_globals.cc \ |
---|
144 | cf_inline.cc \ |
---|
145 | cf_irred.cc \ |
---|
146 | cf_iter.cc \ |
---|
147 | cf_iter_inline.cc \ |
---|
148 | cf_linsys.cc \ |
---|
149 | cf_map.cc \ |
---|
150 | cf_map_ext.cc \ |
---|
151 | cf_ops.cc \ |
---|
152 | cf_primes.cc \ |
---|
153 | cf_random.cc \ |
---|
154 | cf_resultant.cc \ |
---|
155 | cf_reval.cc \ |
---|
156 | cf_switches.cc \ |
---|
157 | cf_util.cc \ |
---|
158 | debug.cc \ |
---|
159 | fac_berlekamp.cc \ |
---|
160 | fac_cantzass.cc \ |
---|
161 | fac_distrib.cc \ |
---|
162 | fac_ezgcd.cc \ |
---|
163 | fac_iterfor.cc \ |
---|
164 | fac_multihensel.cc \ |
---|
165 | fac_multivar.cc \ |
---|
166 | fac_sqrfree.cc \ |
---|
167 | fac_univar.cc \ |
---|
168 | fac_util.cc \ |
---|
169 | fieldGCD.cc \ |
---|
170 | ffops.cc \ |
---|
171 | ffreval.cc \ |
---|
172 | gf_tabutil.cc \ |
---|
173 | gfops.cc \ |
---|
174 | imm.cc \ |
---|
175 | initgmp.cc \ |
---|
176 | int_cf.cc \ |
---|
177 | int_int.cc \ |
---|
178 | int_intdiv.cc \ |
---|
179 | int_poly.cc \ |
---|
180 | int_pp.cc \ |
---|
181 | int_rat.cc \ |
---|
182 | sm_sparsemod.cc \ |
---|
183 | sm_util.cc \ |
---|
184 | variable.cc \ |
---|
185 | NTLconvert.cc \ |
---|
186 | abs_fac.cc \ |
---|
187 | bifac.cc \ |
---|
188 | lgs.cc |
---|
189 | |
---|
190 | singfactorysrc := \ |
---|
191 | singext.cc |
---|
192 | useiofactorysrc := \ |
---|
193 | parseutil.cc \ |
---|
194 | readcf.y |
---|
195 | distfactorysrc := \ |
---|
196 | $(basefactorysrc) \ |
---|
197 | $(singfactorysrc) \ |
---|
198 | $(useiofactorysrc) |
---|
199 | doxysrc := \ |
---|
200 | $(basefactorysrc) \ |
---|
201 | parseutil.cc |
---|
202 | |
---|
203 | # factory object files and dependencies |
---|
204 | factoryobj1 := $(factorysrc:%.cc=%.o) |
---|
205 | factoryobj := $(factoryobj1:%.y=%.o) |
---|
206 | factorygobj := $(factorysrc:%.cc=%.og) |
---|
207 | factorypobj := $(factorysrc:%.cc=%.op) |
---|
208 | factorydep := $(factorysrc:%.cc=%.d) |
---|
209 | factorydep := $(factorydep:%.y=%.d) |
---|
210 | |
---|
211 | # factory header files |
---|
212 | basefactoryincl := \ |
---|
213 | assert.h \ |
---|
214 | canonicalform.h \ |
---|
215 | cf_algorithm.h \ |
---|
216 | cf_binom.h \ |
---|
217 | cf_defs.h \ |
---|
218 | cf_eval.h \ |
---|
219 | cf_factory.h \ |
---|
220 | cf_gcd_smallp.h \ |
---|
221 | cf_generator.h \ |
---|
222 | cf_globals.h \ |
---|
223 | cf_irred.h \ |
---|
224 | cf_iter.h \ |
---|
225 | cf_map.h \ |
---|
226 | cf_primes.h \ |
---|
227 | cf_primetab.h \ |
---|
228 | cf_random.h \ |
---|
229 | cf_reval.h \ |
---|
230 | cf_switches.h \ |
---|
231 | cf_util.h \ |
---|
232 | debug.h \ |
---|
233 | fac_berlekamp.h \ |
---|
234 | fac_cantzass.h \ |
---|
235 | fac_distrib.h \ |
---|
236 | fac_iterfor.h \ |
---|
237 | fac_multivar.h \ |
---|
238 | fac_sqrfree.h \ |
---|
239 | fac_univar.h \ |
---|
240 | fac_util.h \ |
---|
241 | fieldGCD.h \ |
---|
242 | ffops.h \ |
---|
243 | ffreval.h \ |
---|
244 | ftmpl_array.h \ |
---|
245 | ftmpl_factor.h \ |
---|
246 | ftmpl_functions.h \ |
---|
247 | ftmpl_list.h \ |
---|
248 | ftmpl_matrix.h \ |
---|
249 | gf_tabutil.h \ |
---|
250 | gfops.h \ |
---|
251 | gmpext.h \ |
---|
252 | imm.h \ |
---|
253 | int_cf.h \ |
---|
254 | int_int.h \ |
---|
255 | int_poly.h \ |
---|
256 | int_pp.h \ |
---|
257 | int_rat.h \ |
---|
258 | sm_sparsemod.h \ |
---|
259 | sm_util.h \ |
---|
260 | timing.h \ |
---|
261 | variable.h \ |
---|
262 | NTLconvert.h \ |
---|
263 | bifac.h \ |
---|
264 | bifacConfig.h \ |
---|
265 | lgs.h \ |
---|
266 | algext.h |
---|
267 | |
---|
268 | singfactoryincl := \ |
---|
269 | singext.h |
---|
270 | useiofactoryincl := \ |
---|
271 | parseutil.h |
---|
272 | distfactoryincl := \ |
---|
273 | $(basefactoryincl) \ |
---|
274 | $(singfactoryincl) \ |
---|
275 | $(useiofactoryincl) |
---|
276 | doxyincl := \ |
---|
277 | $(basefactoryincl) \ |
---|
278 | parseutil.h |
---|
279 | |
---|
280 | # memory manager source files |
---|
281 | basememmansrc := \ |
---|
282 | newdelete.cc |
---|
283 | newmemmansrc := \ |
---|
284 | mmalloc.c \ |
---|
285 | mmallocb.c \ |
---|
286 | mmallocs.c \ |
---|
287 | mmblock.c \ |
---|
288 | mmheap.c \ |
---|
289 | mminit.c \ |
---|
290 | mmspec.c \ |
---|
291 | mmutil.c |
---|
292 | oldmemmansrc := \ |
---|
293 | memutil.c |
---|
294 | distmemmansrc := \ |
---|
295 | $(basememmansrc) \ |
---|
296 | $(newmemmansrc) \ |
---|
297 | $(oldmemmansrc) |
---|
298 | |
---|
299 | # memory manager object files and dependencies |
---|
300 | memmanobj := $(memmansrc:.cc=.o) |
---|
301 | memmanobj := $(memmanobj:.c=.o) |
---|
302 | memmandep := $(memmansrc:.cc=.d) |
---|
303 | memmandep := $(memmandep:.c=.d) |
---|
304 | |
---|
305 | # memory manager header files |
---|
306 | newmemmanincl := \ |
---|
307 | mmprivate.h \ |
---|
308 | memman.h |
---|
309 | oldmemmanincl := \ |
---|
310 | memutil.h |
---|
311 | distmemmanincl := \ |
---|
312 | $(newmemmanincl) \ |
---|
313 | $(oldmemmanincl) |
---|
314 | |
---|
315 | # factory template files |
---|
316 | templatesrc := \ |
---|
317 | ftmpl_array.cc \ |
---|
318 | ftmpl_factor.cc \ |
---|
319 | ftmpl_functions.h \ |
---|
320 | ftmpl_list.cc \ |
---|
321 | ftmpl_matrix.cc |
---|
322 | templateincl := \ |
---|
323 | ftmpl_array.h \ |
---|
324 | ftmpl_factor.h \ |
---|
325 | ftmpl_list.h \ |
---|
326 | ftmpl_matrix.h |
---|
327 | |
---|
328 | # header templates |
---|
329 | hdrtemplsrc := \ |
---|
330 | factoryconf.template \ |
---|
331 | factory.template |
---|
332 | hdrtempldep := $(hdrtemplsrc:.template=.d) |
---|
333 | |
---|
334 | # FTE source files |
---|
335 | ftestsrc := \ |
---|
336 | ftest_io.cc \ |
---|
337 | ftest_util.cc \ |
---|
338 | ntl_util.cc |
---|
339 | |
---|
340 | # FTE header files |
---|
341 | ftestincl := \ |
---|
342 | ftest_io.h \ |
---|
343 | ftest_util.h \ |
---|
344 | ntl_util.h |
---|
345 | |
---|
346 | # FTE m4 source files (exported for `GNUmakefile' in `ftest/'). |
---|
347 | # The variable `$(ftestm4develsrc)' may be already initialized |
---|
348 | # from the development `GNUmakefile'. |
---|
349 | ftestm4src := $(ftestm4develsrc) \ |
---|
350 | commonden.m4 \ |
---|
351 | degree.m4 \ |
---|
352 | deriv.m4 \ |
---|
353 | divides.m4 \ |
---|
354 | divrem.m4 \ |
---|
355 | extgcd.m4 \ |
---|
356 | factorize.m4 \ |
---|
357 | fbinops.m4 \ |
---|
358 | feval.m4 \ |
---|
359 | gcd.m4 \ |
---|
360 | gcd.ntl.m4 \ |
---|
361 | insert.m4 \ |
---|
362 | norm.m4 \ |
---|
363 | resultant.m4 \ |
---|
364 | revert.m4 \ |
---|
365 | sqrfree.m4 \ |
---|
366 | size.m4 \ |
---|
367 | totaldegree.m4 |
---|
368 | export ftestm4src |
---|
369 | |
---|
370 | # other files from the FTE |
---|
371 | ftestdistfiles := \ |
---|
372 | ChangeLog \ |
---|
373 | GNUmakefile.in \ |
---|
374 | ftest_util.m4 |
---|
375 | |
---|
376 | # FTE executables |
---|
377 | ftestexec := $(ftestm4src:.m4=) |
---|
378 | |
---|
379 | # all the C/C++ source files in the distribution |
---|
380 | distsrc := \ |
---|
381 | $(distfactorysrc) $(distmemmansrc) \ |
---|
382 | $(addprefix templates/,$(templatesrc)) \ |
---|
383 | $(addprefix ftest/,$(ftestsrc)) \ |
---|
384 | readcf.cc ftmpl_inst.cc \ |
---|
385 | gengftables.cc gengftables-conway.cc test_install.cc |
---|
386 | |
---|
387 | # all the C/C++ include files in the distribution |
---|
388 | distincl := \ |
---|
389 | $(distfactoryincl) $(distmemmanincl) \ |
---|
390 | $(addprefix templates/,$(templateincl)) \ |
---|
391 | $(addprefix ftest/,$(ftestincl)) |
---|
392 | |
---|
393 | # all files for the Windows NT environment |
---|
394 | distntfiles := \ |
---|
395 | config.h nt.mak \ |
---|
396 | factory.h factoryconf.h \ |
---|
397 | INSTALL.nt |
---|
398 | |
---|
399 | # all files in the distribution |
---|
400 | distfiles := \ |
---|
401 | $(distsrc) $(distincl) $(hdrtemplsrc) \ |
---|
402 | $(addprefix ftest/,$(ftestm4src)) \ |
---|
403 | $(addprefix ftest/,$(ftestdistfiles)) \ |
---|
404 | GNUmakefile.in configure.in config.h.in configure \ |
---|
405 | ChangeLog README NEWS INSTALL \ |
---|
406 | factory.cfg gen_cf_gmp.template \ |
---|
407 | $(addprefix winnt/,$(distntfiles)) \ |
---|
408 | examples/GNUmakefile examples/application.cc \ |
---|
409 | examples/factorize.cc examples/gcd.cc \ |
---|
410 | bin/folding.el bin/fold-docu.el \ |
---|
411 | bin/install-sh bin/mkinstalldirs \ |
---|
412 | bin/makeheader bin/gen-readcf |
---|
413 | |
---|
414 | # |
---|
415 | # - phony targets. |
---|
416 | # |
---|
417 | .PHONY: all cf mem dist depend \ |
---|
418 | clean mostlyclean distclean maintainer-clean \ |
---|
419 | install installcf installmem installgftables installtest \ |
---|
420 | uninstall uninstallcf uninstallmem uninstallgftables \ |
---|
421 | ftestall ftestclean ftestdistclean \ |
---|
422 | doxy doxyclean |
---|
423 | |
---|
424 | # we make these targets phony to make sure that they are |
---|
425 | # up to date when a new distribution is built |
---|
426 | .PHONY: $(srcdir)/winnt/factory.h $(srcdir)/winnt/factoryconf.h |
---|
427 | |
---|
428 | # |
---|
429 | # - pattern rules. |
---|
430 | # |
---|
431 | |
---|
432 | # how to create library objets |
---|
433 | %.o: %.cc config.h |
---|
434 | $(CXX) -c $< $(LIBCXXFLAGS) -o $@ |
---|
435 | %.o: %.c config.h |
---|
436 | $(CC) -c $< $(LIBCFLAGS) -o $@ |
---|
437 | # the debug version: |
---|
438 | %.og: %.cc config.h |
---|
439 | $(CXX) -g -c $< $(LIBCGGFLAGS) -o $@ |
---|
440 | # the profiling version: |
---|
441 | %.op: %.cc config.h |
---|
442 | $(CXX) -O -pg -c $< $(LIBCGGFLAGS) -o $@ |
---|
443 | |
---|
444 | # how to create dependency files. To avoid broken dependency files |
---|
445 | # (which in turn break this GNUmakefile) we first generate them in |
---|
446 | # a temporary file which we then move to the destination file. |
---|
447 | %.d: %.cc factoryconf.h config.h |
---|
448 | echo $@ "\\" > $@tmp |
---|
449 | $(CXX) -MM $< $(DEPCXXFLAGS) >> $@tmp |
---|
450 | mv $@tmp $@ |
---|
451 | %.d: %.c factoryconf.h config.h |
---|
452 | echo $@ "\\" > $@tmp |
---|
453 | $(CXX) -MM $< $(DEPCXXFLAGS) >> $@tmp |
---|
454 | mv $@tmp $@ |
---|
455 | %.d: %.template |
---|
456 | echo $@ $(@:.d=.h) : "\\" > $@tmp |
---|
457 | sed -n '/^\/\*MAKEHEADER/!d; n; s/^#include "//; s/"//; p;' $< | tr '\012' ' ' >> $@tmp |
---|
458 | echo >> $@tmp |
---|
459 | mv $@tmp $@ |
---|
460 | |
---|
461 | # how to create header files from header templates |
---|
462 | %.h: %.template |
---|
463 | $(MAKEHEADER) $(MAKEHEADERFLAGS) $< $@ |
---|
464 | |
---|
465 | # |
---|
466 | # - building factory. |
---|
467 | # |
---|
468 | all: $(alltargets) |
---|
469 | |
---|
470 | cf: factoryconf.h factory.h $(libfactory) libsingcf_g.a |
---|
471 | |
---|
472 | mem: libcfmem.a |
---|
473 | |
---|
474 | # |
---|
475 | # - explicit targets. |
---|
476 | # |
---|
477 | $(libfactory): $(factoryobj) |
---|
478 | $(AR) $(ARFLAGS) $@ $^ |
---|
479 | $(RANLIB) $@ |
---|
480 | |
---|
481 | libsingcf_g.a: $(factorygobj) |
---|
482 | $(AR) $(ARFLAGS) $@ $^ |
---|
483 | $(RANLIB) $@ |
---|
484 | |
---|
485 | libsingcf_p.a: $(factorypobj) |
---|
486 | $(AR) $(ARFLAGS) $@ $^ |
---|
487 | $(RANLIB) $@ |
---|
488 | |
---|
489 | libcfmem.a: $(memmanobj) |
---|
490 | $(AR) $(ARFLAGS) $@ $^ |
---|
491 | $(RANLIB) $@ |
---|
492 | |
---|
493 | ftmpl_inst.o: ftmpl_inst.cc factoryconf.h factory.h \ |
---|
494 | $(addprefix templates/,$(templatesrc)) \ |
---|
495 | $(addprefix templates/,$(templateincl)) |
---|
496 | $(CXX) -c $< $(TMPLCXXFLAGS) -o $@ |
---|
497 | |
---|
498 | # note that this is a non-source file which is distributed! |
---|
499 | $(srcdir)/readcf.cc: readcf.y |
---|
500 | @./bin/gen-readcf "${BISON}" |
---|
501 | |
---|
502 | # note that these are non-source file which are distributed! |
---|
503 | # We do not specify any dependencies except the most important ones. |
---|
504 | $(srcdir)/winnt/factory.h: factory.template |
---|
505 | $(MAKEHEADER) $(MAKEHEADERFLAGS) $< $@ |
---|
506 | $(srcdir)/winnt/factoryconf.h: factoryconf.template winnt/config.h |
---|
507 | $(MAKEHEADER) -I$(srcdir)/winnt $(MAKEHEADERFLAGS) $< $@ |
---|
508 | |
---|
509 | # specify dependency in case user does not 'make depend' |
---|
510 | factoryconf.h: config.h cf_gmp.h |
---|
511 | |
---|
512 | TAGS: |
---|
513 | etags $(addprefix $(srcdir)/, $(distsrc) $(distincl)) |
---|
514 | |
---|
515 | # check configuration before building executables |
---|
516 | conftest: |
---|
517 | @if test -z "$(filter mem,$(alltargets))" \ |
---|
518 | || test -z "$(filter readcf.y,$(factorysrc))" \ |
---|
519 | || test -n "$(filter singext.cc,$(factorysrc))"; then \ |
---|
520 | echo "To make this target you have to configure"; \ |
---|
521 | echo "\`--without-Singular --with-memman --enable-streamio'."; \ |
---|
522 | exit 1; \ |
---|
523 | fi |
---|
524 | |
---|
525 | # |
---|
526 | # - doxygen. |
---|
527 | # |
---|
528 | |
---|
529 | # files and environment variables to export for doxygen |
---|
530 | doxyfiles := $(addprefix $(srcdir)/,$(doxysrc) $(doxyincl)) |
---|
531 | |
---|
532 | export version srcdir doxyfiles |
---|
533 | |
---|
534 | # doxygen targets |
---|
535 | doxy: factory.cfg $(doxysrc) $(doxyincl) |
---|
536 | doxygen $< |
---|
537 | |
---|
538 | doxyclean: |
---|
539 | rm -rf doxygen |
---|
540 | |
---|
541 | # |
---|
542 | # - Factory Test Environment. |
---|
543 | # |
---|
544 | $(ftestexec): conftest factoryconf.h factory.h libcf.a libcfmem.a ftmpl_inst.o |
---|
545 | cd ftest && $(MAKE) $@ |
---|
546 | @if test -r "$@"; then \ |
---|
547 | :; \ |
---|
548 | else \ |
---|
549 | echo "$(LN_S) ftest/$@ $@"; \ |
---|
550 | $(LN_S) ftest/$@ $@; \ |
---|
551 | fi |
---|
552 | |
---|
553 | ftestall: $(ftestexec) |
---|
554 | |
---|
555 | ftestclean: |
---|
556 | -cd ftest && $(MAKE) clean |
---|
557 | |
---|
558 | ftestdistclean: |
---|
559 | -cd ftest && $(MAKE) distclean |
---|
560 | -rmdir ftest |
---|
561 | |
---|
562 | # |
---|
563 | # - GF(q) table generation. |
---|
564 | # |
---|
565 | |
---|
566 | # these are not all dependencies, but the most important ones |
---|
567 | gengftables.o: gengftables-conway.cc conftest factory.h gf_tabutil.h |
---|
568 | $(CXX) -c $< $(TESTCXXFLAGS) -o $@ |
---|
569 | |
---|
570 | gengftables: gengftables.o libcf.a libcfmem.a ftmpl_inst.o |
---|
571 | $(CXX) $^ $(TESTLDFLAGS) -o $@ |
---|
572 | |
---|
573 | gftables: gengftables |
---|
574 | @echo "This command will take quite a long time to execute;" |
---|
575 | @echo "maybe you want to get the tables directly via ftp (see" |
---|
576 | @echo "the INSTALL file)." |
---|
577 | $(MKINSTALLDIRS) gftables |
---|
578 | ./gengftables |
---|
579 | |
---|
580 | # |
---|
581 | # - installation test program. |
---|
582 | # |
---|
583 | |
---|
584 | # compile installation test program. do not look up |
---|
585 | # header files in current directory or in $(srcdir), but use |
---|
586 | # the header files from the directory where they should be |
---|
587 | # after installation. |
---|
588 | test_install.o: test_install.cc |
---|
589 | $(CXX) -c $< $(TESTCXXFLAGS) -I- -I$(includedir) -o $@ |
---|
590 | |
---|
591 | # the same we do for ftmpl_inst.o which for this reason is named |
---|
592 | # iftmpl_inst.o |
---|
593 | iftmpl_inst.o: |
---|
594 | $(CXX) -c $(templatedir)/ftmpl_inst.cc $(TMPLCXXFLAGS) -I- -I$(includedir) -o $@ |
---|
595 | |
---|
596 | # link installation test program |
---|
597 | test_install: test_install.o iftmpl_inst.o |
---|
598 | $(CXX) $^ -L$(libdir) -lcf -lcfmem $(TESTLDFLAGS) -o $@ |
---|
599 | |
---|
600 | installtest: test_install |
---|
601 | @-if ./test_install; then \ |
---|
602 | echo "Installation seems ok."; \ |
---|
603 | else \ |
---|
604 | echo "Please check path of your GF(q) tables in config.h."; \ |
---|
605 | fi |
---|
606 | |
---|
607 | # |
---|
608 | # - install targets. |
---|
609 | # |
---|
610 | install: $(installtargets) |
---|
611 | |
---|
612 | install_all: install libsingcf_p.a |
---|
613 | -$(INSTALL_DATA) libsingcf_p.a $(libdir)/libsingcf_p.a |
---|
614 | |
---|
615 | install-nolns: install |
---|
616 | |
---|
617 | installcf: cf |
---|
618 | $(MKINSTALLDIRS) $(libdir) |
---|
619 | $(MKINSTALLDIRS) $(includedir) |
---|
620 | $(MKINSTALLDIRS) $(templatedir) |
---|
621 | $(INSTALL_DATA) $(libfactory) $(libdir)/$(libfactory) |
---|
622 | -$(INSTALL_DATA) libsingcf_g.a $(libdir)/libsingcf_g.a |
---|
623 | $(INSTALL_DATA) factory.h $(includedir)/factory.h |
---|
624 | $(INSTALL_DATA) cf_gmp.h $(includedir)/cf_gmp.h |
---|
625 | $(INSTALL_DATA) factoryconf.h $(includedir)/factoryconf.h |
---|
626 | $(INSTALL_DATA) $(srcdir)/ftmpl_inst.cc $(templatedir)/ftmpl_inst.cc |
---|
627 | for file in $(templatesrc) $(templateincl); do \ |
---|
628 | $(INSTALL_DATA) $(srcdir)/templates/$$file $(templatedir)/$$file; \ |
---|
629 | done |
---|
630 | # we run `ranlib' another time for SUN machines |
---|
631 | $(RANLIB) $(libdir)/$(libfactory) |
---|
632 | |
---|
633 | installmem: mem |
---|
634 | $(MKINSTALLDIRS) $(libdir) |
---|
635 | $(INSTALL_DATA) libcfmem.a $(libdir)/libcfmem.a |
---|
636 | # once again: another run for SUN |
---|
637 | $(RANLIB) $(libdir)/libcfmem.a |
---|
638 | |
---|
639 | # to a pity, this cannot be done automatically ... |
---|
640 | installgftables: |
---|
641 | @echo "Copying GF(q) tables ..." |
---|
642 | @if test -d gftables; then \ |
---|
643 | $(MKINSTALLDIRS) $(gftabledir); \ |
---|
644 | for file in gftables/gftable.*.*; do \ |
---|
645 | $(INSTALL_DATA) $$file $(gftabledir); \ |
---|
646 | done \ |
---|
647 | elif test -d "$(srcdir)"/gftables; then \ |
---|
648 | $(MKINSTALLDIRS) $(gftabledir); \ |
---|
649 | for file in "$(srcdir)"/gftables/gftable.*.*; do \ |
---|
650 | $(INSTALL_DATA) $$file $(gftabledir); \ |
---|
651 | done \ |
---|
652 | else \ |
---|
653 | echo "Run 'make gftables' before installing them"; \ |
---|
654 | exit 1; \ |
---|
655 | fi |
---|
656 | |
---|
657 | # |
---|
658 | # - uninstall targets. |
---|
659 | # |
---|
660 | uninstall: $(uninstalltargets) |
---|
661 | |
---|
662 | uninstallcf: |
---|
663 | -for file in $(templatesrc) $(templateincl); do \ |
---|
664 | rm -f $(templatedir)/$$file; \ |
---|
665 | done |
---|
666 | -rm -f $(templatedir)/ftmpl_inst.cc |
---|
667 | -rm -f $(includedir)/factoryconf.h |
---|
668 | -rm -f $(includedir)/factory.h |
---|
669 | -rm -f $(libdir)/$(libfactory) |
---|
670 | -rm -f $(libdir)/libsingcf_g.a |
---|
671 | -rm -f $(libdir)/libsingcf_p.a |
---|
672 | -rmdir $(templatedir) |
---|
673 | -rmdir $(includedir) |
---|
674 | -rmdir $(libdir) |
---|
675 | |
---|
676 | uninstallmem: |
---|
677 | -rm -f $(libdir)/libcfmem.a |
---|
678 | -rmdir $(libdir) |
---|
679 | |
---|
680 | uninstallgftables: |
---|
681 | -rm -f $(gftabledir)/gftable.*.* |
---|
682 | -rmdir $(gftabledir) |
---|
683 | |
---|
684 | # |
---|
685 | # - building a distribution. |
---|
686 | # |
---|
687 | dist: $(srcdir)/readcf.cc $(srcdir)/configure \ |
---|
688 | $(srcdir)/winnt/factory.h $(srcdir)/winnt/factoryconf.h |
---|
689 | rm -f $(distname).tgz |
---|
690 | rm -rf $(distname) |
---|
691 | $(MKINSTALLDIRS) $(distname)/bin |
---|
692 | $(MKINSTALLDIRS) $(distname)/examples |
---|
693 | $(MKINSTALLDIRS) $(distname)/ftest |
---|
694 | $(MKINSTALLDIRS) $(distname)/winnt |
---|
695 | $(MKINSTALLDIRS) $(distname)/templates |
---|
696 | @echo "Copying files to distribution directory ..." |
---|
697 | @for file in $(distfiles); do \ |
---|
698 | ln $(srcdir)/$$file $(distname)/$$file; \ |
---|
699 | done |
---|
700 | tar cf $(distname).tar $(distname) |
---|
701 | gzip $(distname).tar |
---|
702 | mv $(distname).tar.gz $(distname).tgz |
---|
703 | |
---|
704 | # |
---|
705 | # - cleaning up. |
---|
706 | # |
---|
707 | clean: ftestclean |
---|
708 | -rm -f $(libfactory) libcfmem.a libsingcf_g.a libsingcf_p.a \ |
---|
709 | $(ftestexec) gengftables test_install \ |
---|
710 | factoryconf.h factory.h *.o *.og *.op *.d *.dtmp cf_gmp.h |
---|
711 | |
---|
712 | # remove gftables only if we built them |
---|
713 | mostlyclean: clean doxyclean |
---|
714 | -rm -f TAGS |
---|
715 | -if test ! -f gftables/README; then \ |
---|
716 | rm -rf gftables; \ |
---|
717 | fi |
---|
718 | |
---|
719 | distclean: ftestdistclean mostlyclean |
---|
720 | -rm -f $(distname).tgz GNUmakefile stamp-h \ |
---|
721 | config.cache config.log config.status config.h |
---|
722 | -rm -rf $(distname) |
---|
723 | |
---|
724 | maintainer-clean: distclean |
---|
725 | @echo "This command is intended for maintainers to use;" |
---|
726 | @echo "it deletes files that require bison to rebuild." |
---|
727 | -rm -f $(srcdir)/readcf.cc |
---|
728 | |
---|
729 | # |
---|
730 | # - dependencies. |
---|
731 | # |
---|
732 | # Do not generate them automatically if there are not any |
---|
733 | # dependencies at all. this trick saves some time when you do |
---|
734 | # not want to compile but do some maintenance which do not |
---|
735 | # require the dependencies. say 'make depend' to create the |
---|
736 | # dependencies explicitly. |
---|
737 | # |
---|
738 | depend: $(factorydep) $(memmandep) $(hdrtempldep) |
---|
739 | |
---|
740 | ifneq ($(wildcard *.d),) |
---|
741 | include $(factorydep) $(memmandep) $(hdrtempldep) |
---|
742 | endif |
---|
743 | |
---|
744 | # |
---|
745 | # - configure stuff. |
---|
746 | # |
---|
747 | $(srcdir)/configure: configure.in |
---|
748 | @echo "WARNING: You need to rerun autoconf. I am proceeding, for now." |
---|
749 | touch configure |
---|
750 | |
---|
751 | # -cd $(srcdir) && autoconf |
---|
752 | |
---|
753 | # seems gmake needs at least a trivial command. otherwise all |
---|
754 | # files which depend on config.h will be remade even if congig.h |
---|
755 | # did not change. |
---|
756 | config.h: stamp-h |
---|
757 | @: |
---|
758 | |
---|
759 | stamp-h: config.h.in config.status |
---|
760 | CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status |
---|
761 | echo timestamp > stamp-h |
---|
762 | |
---|
763 | GNUmakefile: GNUmakefile.in config.status |
---|
764 | CONFIG_FILES=GNUmakefile CONFIG_HEADERS= ./config.status |
---|
765 | |
---|
766 | ftest/GNUmakefile: ftest/GNUmakefile.in config.status |
---|
767 | CONFIG_FILES=ftest/GNUmakefile CONFIG_HEADERS= ./config.status |
---|
768 | |
---|
769 | config.status: configure |
---|
770 | ./config.status --recheck |
---|
771 | |
---|
772 | # create cf_gmp.h |
---|
773 | cf_gmp.h: GNUmakefile gen_cf_gmp.template |
---|
774 | echo "#!/bin/sh" >gen_cf_gmp.sh |
---|
775 | echo "GMP_H_T=\"`$(CXX) $(LIBCXXFLAGS) -M gen_cf_gmp.cc|grep gmp.h` \"" >>gen_cf_gmp.sh |
---|
776 | cat gen_cf_gmp.template >>gen_cf_gmp.sh |
---|
777 | $(SHELL) gen_cf_gmp.sh |
---|