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