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