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