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