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