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