source: git/factory/GNUmakefile.in @ 264ca9

spielwiese
Last change on this file since 264ca9 was 264ca9, checked in by Hans Schönemann <hannes@…>, 18 years ago
*hannes: do not run autoconf automatically git-svn-id: file:///usr/local/Singular/svn/trunk@8791 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 16.3 KB
Line 
1# @configure_input@
2# $Id: GNUmakefile.in,v 1.45 2005-11-08 15:58:10 Singular Exp $
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
20SHELL =         /bin/sh
21
22#
23# - versions.  Do not change version here !!!
24#
25version =       @factory_version@
26distname =      factory-$(version)
27
28#
29# - paths.
30#
31prefix =        @prefix@
32exec_prefix =   @exec_prefix@
33libdir =        @libdir@
34datadir =       @datadir@
35gftabledir =    @gftabledir@
36includedir =    @includedir@
37templatedir =   @templatedir@
38
39srcdir =        @srcdir@
40VPATH =         @srcdir@
41
42#
43# - the name of the game.
44#
45libfactory =    @libfactory@
46
47#
48# - programs.
49#
50CC =            @CC@
51CXX =           @CXX@
52# seems configure sometimes finds non-BSD install, so we better
53# hardcode path to our install-sh
54INSTALL =       $(srcdir)/bin/install-sh -c
55INSTALL_DATA =  @INSTALL_DATA@
56INSTALL_PROGRAM=@INSTALL_PROGRAM@
57RANLIB =        @RANLIB@
58
59LN_S =          @LN_S@
60AR =            @AR@
61BISON =         @BISON@
62MKINSTALLDIRS = @FACTORY_MKINSTALLDIRS@
63MAKEHEADER =    @FACTORY_MAKEHEADER@
64
65#
66# - flags.
67#
68CFLAGS =        @CFLAGS@
69CPPFLAGS =      @CPPFLAGS@
70CXXFLAGS =      @CXXFLAGS@
71DEFS =          @DEFS@
72LDFLAGS =       @LDFLAGS@
73LIBS =          @LIBS@
74
75ARFLAGS =       @ARFLAGS@
76MAKEHEADERFLAGS=@MAKEHEADERFLAGS@
77
78#
79# - some other variables.
80#
81factorysrc =    @factorysrc@
82factoryincl =   @factoryincl@
83memmansrc =     @memmansrc@
84memmanincl =    @memmanincl@
85
86alltargets =    @alltargets@
87installtargets =@installtargets@
88uninstalltargets=@uninstalltargets@
89
90############### END OF CONFIGURABLE SECTION ###############
91
92#
93# - compiler flags.
94#
95WARNFLAGS =     -w
96
97# flags to translate library c files
98LIBCFLAGS =     $(WARNFLAGS) \
99                -I$(includedir) -I. -I$(srcdir) \
100                $(DEFS) $(CPPFLAGS) $(CFLAGS)
101
102# flags to translate library c++ files
103LIBCXXFLAGS =   $(WARNFLAGS) -fno-implicit-templates \
104                -I$(includedir) -I. -I$(srcdir) \
105                $(DEFS) $(CPPFLAGS) $(CXXFLAGS)
106
107# flags to translate ftmpl_inst.cc
108TMPLCXXFLAGS =  $(LIBCXXFLAGS)
109
110# flags to link test programs
111TESTCXXFLAGS =  $(LIBCXXFLAGS)
112
113# flags to link test programs
114TESTLDFLAGS =   $(LIBS) $(LDFLAGS)
115
116# flags to create dependency lists
117DEPCXXFLAGS =   -I$(includedir) -I. -I$(srcdir) \
118                $(DEFS) $(CPPFLAGS)
119
120#
121# - source files.
122#
123
124# factory source files
125basefactorysrc := \
126                canonicalform.cc \
127                cf_algorithm.cc \
128                cf_binom.cc \
129                cf_char.cc \
130                cf_chinese.cc \
131                cf_eval.cc \
132                cf_factor.cc \
133                cf_factory.cc \
134                cf_gcd.cc \
135                cf_generator.cc \
136                cf_globals.cc \
137                cf_inline.cc \
138                cf_irred.cc \
139                cf_iter.cc \
140                cf_iter_inline.cc \
141                cf_linsys.cc \
142                cf_map.cc \
143                cf_ops.cc \
144                cf_primes.cc \
145                cf_random.cc \
146                cf_resultant.cc \
147                cf_reval.cc \
148                cf_switches.cc \
149                cf_util.cc \
150                debug.cc \
151                fac_berlekamp.cc \
152                fac_cantzass.cc \
153                fac_distrib.cc \
154                fac_ezgcd.cc \
155                fac_iterfor.cc \
156                fac_multihensel.cc \
157                fac_multivar.cc \
158                fac_sqrfree.cc \
159                fac_univar.cc \
160                fac_util.cc \
161                ffops.cc \
162                gf_tabutil.cc \
163                gfops.cc \
164                imm.cc \
165                initgmp.cc \
166                int_cf.cc \
167                int_int.cc \
168                int_intdiv.cc \
169                int_poly.cc \
170                int_pp.cc \
171                int_rat.cc \
172                sm_sparsemod.cc \
173                sm_util.cc \
174                variable.cc \
175                NTLconvert.cc \
176                abs_fac.cc \
177                bifac.cc \
178                lgs.cc
179
180singfactorysrc := \
181                singext.cc
182useiofactorysrc := \
183                parseutil.cc \
184                readcf.y
185distfactorysrc := \
186                $(basefactorysrc) \
187                $(singfactorysrc) \
188                $(useiofactorysrc)
189doxysrc :=      \
190                $(basefactorysrc) \
191                parseutil.cc
192
193# factory object files and dependencies
194factoryobj :=   $(factorysrc:.cc=.o)
195factoryobj :=   $(factoryobj:.y=.o)
196factorydep :=   $(factorysrc:.cc=.d)
197factorydep :=   $(factorydep:.y=.d)
198
199# factory header files
200basefactoryincl := \
201                assert.h \
202                canonicalform.h \
203                cf_algorithm.h \
204                cf_binom.h \
205                cf_defs.h \
206                cf_eval.h \
207                cf_factory.h \
208                cf_generator.h \
209                cf_globals.h \
210                cf_gmp.h \
211                cf_irred.h \
212                cf_iter.h \
213                cf_map.h \
214                cf_primes.h \
215                cf_primetab.h \
216                cf_random.h \
217                cf_reval.h \
218                cf_switches.h \
219                cf_util.h \
220                debug.h \
221                fac_berlekamp.h \
222                fac_cantzass.h \
223                fac_distrib.h \
224                fac_iterfor.h \
225                fac_multivar.h \
226                fac_sqrfree.h \
227                fac_univar.h \
228                fac_util.h \
229                ffops.h \
230                ftmpl_array.h \
231                ftmpl_factor.h \
232                ftmpl_functions.h \
233                ftmpl_list.h \
234                ftmpl_matrix.h \
235                gf_tabutil.h \
236                gfops.h \
237                gmpext.h \
238                imm.h \
239                int_cf.h \
240                int_int.h \
241                int_poly.h \
242                int_pp.h \
243                int_rat.h \
244                sm_sparsemod.h \
245                sm_util.h \
246                timing.h \
247                variable.h \
248                NTLconvert.h \
249                bifac.h \
250                bifacConfig.h \
251                lgs.h
252
253singfactoryincl := \
254                singext.h
255useiofactoryincl := \
256                parseutil.h
257distfactoryincl := \
258                $(basefactoryincl) \
259                $(singfactoryincl) \
260                $(useiofactoryincl)
261doxyincl :=     \
262                $(basefactoryincl) \
263                parseutil.h
264
265# memory manager source files
266basememmansrc := \
267                newdelete.cc
268newmemmansrc := \
269                mmalloc.c \
270                mmallocb.c \
271                mmallocs.c \
272                mmblock.c \
273                mmheap.c \
274                mminit.c \
275                mmspec.c \
276                mmutil.c
277oldmemmansrc := \
278                memutil.c
279distmemmansrc := \
280                $(basememmansrc) \
281                $(newmemmansrc) \
282                $(oldmemmansrc)
283
284# memory manager object files and dependencies
285memmanobj :=    $(memmansrc:.cc=.o)
286memmanobj :=    $(memmanobj:.c=.o)
287memmandep :=    $(memmansrc:.cc=.d)
288memmandep :=    $(memmandep:.c=.d)
289
290# memory manager header files
291newmemmanincl := \
292                mmprivate.h \
293                memman.h
294oldmemmanincl := \
295                memutil.h
296distmemmanincl := \
297                $(newmemmanincl) \
298                $(oldmemmanincl)
299
300# factory template files
301templatesrc :=  \
302                ftmpl_array.cc \
303                ftmpl_factor.cc \
304                ftmpl_functions.h \
305                ftmpl_list.cc \
306                ftmpl_matrix.cc
307templateincl := \
308                ftmpl_array.h \
309                ftmpl_factor.h \
310                ftmpl_list.h \
311                ftmpl_matrix.h
312
313# header templates
314hdrtemplsrc := \
315                factoryconf.template \
316                factory.template
317hdrtempldep :=  $(hdrtemplsrc:.template=.d)
318
319# FTE source files
320ftestsrc :=     \
321                ftest_io.cc \
322                ftest_util.cc \
323                ntl_util.cc
324
325# FTE header files
326ftestincl :=    \
327                ftest_io.h \
328                ftest_util.h \
329                ntl_util.h
330
331# FTE m4 source files (exported for `GNUmakefile' in `ftest/').
332# The variable `$(ftestm4develsrc)' may be already initialized
333# from the development `GNUmakefile'.
334ftestm4src :=   $(ftestm4develsrc) \
335                commonden.m4 \
336                degree.m4 \
337                deriv.m4 \
338                divides.m4 \
339                divrem.m4 \
340                extgcd.m4 \
341                factorize.m4 \
342                fbinops.m4 \
343                feval.m4 \
344                gcd.m4 \
345                gcd.ntl.m4 \
346                insert.m4 \
347                norm.m4 \
348                resultant.m4 \
349                revert.m4 \
350                sqrfree.m4 \
351                size.m4 \
352                totaldegree.m4
353export ftestm4src
354
355# other files from the FTE
356ftestdistfiles := \
357                ChangeLog \
358                GNUmakefile.in \
359                ftest_util.m4
360
361# FTE executables
362ftestexec :=    $(ftestm4src:.m4=)
363
364# all the C/C++ source files in the distribution
365distsrc :=      \
366                $(distfactorysrc) $(distmemmansrc) \
367                $(addprefix templates/,$(templatesrc)) \
368                $(addprefix ftest/,$(ftestsrc)) \
369                readcf.cc ftmpl_inst.cc \
370                gengftables.cc test_install.cc
371
372# all the C/C++ include files in the distribution
373distincl :=     \
374                $(distfactoryincl) $(distmemmanincl) \
375                $(addprefix templates/,$(templateincl)) \
376                $(addprefix ftest/,$(ftestincl))
377
378# all files for the Windows NT environment
379distntfiles :=  \
380                config.h nt.mak \
381                factory.h factoryconf.h \
382                INSTALL.nt
383
384# all files in the distribution
385distfiles :=    \
386                $(distsrc) $(distincl) $(hdrtemplsrc) \
387                $(addprefix ftest/,$(ftestm4src)) \
388                $(addprefix ftest/,$(ftestdistfiles)) \
389                GNUmakefile.in configure.in config.h.in configure \
390                ChangeLog README NEWS INSTALL \
391                factory.cfg \
392                $(addprefix winnt/,$(distntfiles)) \
393                examples/GNUmakefile examples/application.cc \
394                examples/factorize.cc examples/gcd.cc \
395                bin/folding.el bin/fold-docu.el \
396                bin/install-sh bin/mkinstalldirs \
397                bin/makeheader
398
399#
400# - phony targets.
401#
402.PHONY:         all cf mem dist depend \
403                clean mostlyclean distclean maintainer-clean \
404                install installcf installmem installgftables installtest \
405                uninstall uninstallcf uninstallmem uninstallgftables \
406                ftestall ftestclean ftestdistclean \
407                doxy doxyclean
408
409# we make these targets phony to make sure that they are
410# up to date when a new distribution is built
411.PHONY:         $(srcdir)/winnt/factory.h $(srcdir)/winnt/factoryconf.h
412
413#
414# - pattern rules.
415#
416
417# how to create library objets
418%.o: %.cc config.h
419        $(CXX) -c $< $(LIBCXXFLAGS) -o $@
420%.o: %.c config.h
421        $(CC) -c $< $(LIBCFLAGS) -o $@
422
423# how to create dependency files.  To avoid broken dependency files
424# (which in turn break this GNUmakefile) we first generate them in
425# a temporary file which we then move to the destination file.
426%.d: %.cc factoryconf.h config.h
427        echo $@ "\\" > $@tmp
428        $(CXX) -MM $< $(DEPCXXFLAGS) >> $@tmp
429        mv $@tmp $@
430%.d: %.c factoryconf.h config.h
431        echo $@ "\\" > $@tmp
432        $(CXX) -MM $< $(DEPCXXFLAGS) >> $@tmp
433        mv $@tmp $@
434%.d: %.template
435        echo $@ $(@:.d=.h) : "\\" > $@tmp
436        sed -n '/^\/\*MAKEHEADER/!d; n; s/^#include "//; s/"//; p;' $< | tr '\012' ' ' >> $@tmp
437        echo >> $@tmp
438        mv $@tmp $@
439
440# how to create header files from header templates
441%.h: %.template
442        $(MAKEHEADER) $(MAKEHEADERFLAGS) $< $@
443
444#
445# - building factory.
446#
447all:            $(alltargets)
448
449cf:             factoryconf.h factory.h $(libfactory)
450
451mem:            libcfmem.a
452
453#
454# - explicit targets.
455#
456$(libfactory):  $(factoryobj)
457                $(AR) $(ARFLAGS) $@ $^
458                $(RANLIB) $@
459
460libcfmem.a:     $(memmanobj)
461                $(AR) $(ARFLAGS) $@ $^
462                $(RANLIB) $@
463
464ftmpl_inst.o:   ftmpl_inst.cc factoryconf.h factory.h \
465                $(addprefix templates/,$(templatesrc)) \
466                $(addprefix templates/,$(templateincl))
467                $(CXX) -c $< $(TMPLCXXFLAGS) -o $@
468
469# note that this is a non-source file which is distributed!
470$(srcdir)/readcf.cc: readcf.y
471                $(BISON) $< -o $@
472
473# note that these are non-source file which are distributed!
474# We do not specify any dependencies except the most important ones.
475$(srcdir)/winnt/factory.h: factory.template
476                $(MAKEHEADER) $(MAKEHEADERFLAGS) $< $@
477$(srcdir)/winnt/factoryconf.h: factoryconf.template winnt/config.h
478                $(MAKEHEADER) -I$(srcdir)/winnt $(MAKEHEADERFLAGS) $< $@
479
480# specify dependency in case user does not 'make depend'
481factoryconf.h:  config.h
482
483TAGS:
484                etags $(addprefix $(srcdir)/, $(distsrc) $(distincl))
485
486# check configuration before building executables
487conftest:
488                @if test -z "$(filter mem,$(alltargets))" \
489                  || test -z "$(filter readcf.y,$(factorysrc))" \
490                  || test -n "$(filter singext.cc,$(factorysrc))"; then \
491                  echo "To make this target you have to configure"; \
492                  echo "\`--without-Singular --with-memman --enable-streamio'."; \
493                  exit 1; \
494                fi
495
496#
497# - doxygen.
498#
499
500# files and environment variables to export for doxygen
501doxyfiles :=    $(addprefix $(srcdir)/,$(doxysrc) $(doxyincl))
502
503export version srcdir doxyfiles
504
505# doxygen targets
506doxy:           factory.cfg $(doxysrc) $(doxyincl)
507                doxygen $<
508
509doxyclean:
510                rm -rf doxygen
511
512#
513# - Factory Test Environment.
514#
515$(ftestexec):   conftest factoryconf.h factory.h libcf.a libcfmem.a ftmpl_inst.o
516                cd ftest && $(MAKE) $@
517                @if test -r "$@"; then \
518                  :; \
519                else \
520                  echo "$(LN_S) ftest/$@ $@"; \
521                  $(LN_S) ftest/$@ $@; \
522                fi
523
524ftestall:       $(ftestexec)
525
526ftestclean:
527                -cd ftest && $(MAKE) clean
528
529ftestdistclean:
530                -cd ftest && $(MAKE) distclean
531                -rmdir ftest
532
533#
534# - GF(q) table generation.
535#
536
537# these are not all dependencies, but the most important ones
538gengftables.o:  gengftables.cc conftest factory.h gf_tabutil.h
539                $(CXX) -c $< $(TESTCXXFLAGS) -o $@
540
541gengftables:    gengftables.o libcf.a libcfmem.a ftmpl_inst.o
542                $(CXX) $^ $(TESTLDFLAGS) -o $@
543
544gftables:       gengftables
545                @echo "This command will take quite a long time to execute;"
546                @echo "maybe you want to get the tables directly via ftp (see"
547                @echo "the INSTALL file)."
548                $(MKINSTALLDIRS) gftables
549                ./gengftables
550
551#
552# - installation test program.
553#
554
555# compile installation test program.  do not look up
556# header files in current directory or in $(srcdir), but use
557# the header files from the directory where they should be
558# after installation.
559test_install.o: test_install.cc
560                $(CXX) -c $< $(TESTCXXFLAGS) -I- -I$(includedir) -o $@
561
562# the same we do for ftmpl_inst.o which for this reason is named
563# iftmpl_inst.o
564iftmpl_inst.o:
565                $(CXX) -c $(templatedir)/ftmpl_inst.cc $(TMPLCXXFLAGS) -I- -I$(includedir) -o $@
566
567# link installation test program
568test_install:   test_install.o iftmpl_inst.o
569                $(CXX) $^ -L$(libdir) -lcf -lcfmem $(TESTLDFLAGS) -o $@
570
571installtest:    test_install
572                @-if ./test_install; then \
573                  echo "Installation seems ok."; \
574                else \
575                  echo "Please check path of your GF(q) tables in config.h."; \
576                fi
577
578#
579# - install targets.
580#
581install:        $(installtargets)
582
583installcf:      cf
584                $(MKINSTALLDIRS) $(libdir)
585                $(MKINSTALLDIRS) $(includedir)
586                $(MKINSTALLDIRS) $(templatedir)
587                $(INSTALL_DATA) $(libfactory) $(libdir)/$(libfactory)
588                $(INSTALL_DATA) factory.h $(includedir)/factory.h
589                $(INSTALL_DATA) factoryconf.h $(includedir)/factoryconf.h
590                $(INSTALL_DATA) $(srcdir)/ftmpl_inst.cc $(templatedir)/ftmpl_inst.cc
591                for file in $(templatesrc) $(templateincl); do \
592                  $(INSTALL_DATA) $(srcdir)/templates/$$file $(templatedir)/$$file; \
593                done
594# we run `ranlib' another time for SUN machines
595                $(RANLIB) $(libdir)/$(libfactory)
596
597installmem:     mem
598                $(MKINSTALLDIRS) $(libdir)
599                $(INSTALL_DATA) libcfmem.a $(libdir)/libcfmem.a
600# once again: another run for SUN
601                $(RANLIB) $(libdir)/libcfmem.a
602
603# to a pity, this cannot be done automatically ...
604installgftables:
605                @echo "Copying GF(q) tables ..."
606                @if test -d gftables; then \
607                  $(MKINSTALLDIRS) $(gftabledir); \
608                  for file in gftables/gftable.*.*; do \
609                    $(INSTALL_DATA) $$file $(gftabledir); \
610                  done \
611                elif test -d "$(srcdir)"/gftables; then \
612                  $(MKINSTALLDIRS) $(gftabledir); \
613                  for file in "$(srcdir)"/gftables/gftable.*.*; do \
614                    $(INSTALL_DATA) $$file $(gftabledir); \
615                  done \
616                else \
617                  echo "Run 'make gftables' before installing them"; \
618                  exit 1; \
619                fi
620
621#
622# - uninstall targets.
623#
624uninstall:      $(uninstalltargets)
625
626uninstallcf:
627                -for file in $(templatesrc) $(templateincl); do \
628                  rm -f $(templatedir)/$$file; \
629                done
630                -rm -f $(templatedir)/ftmpl_inst.cc
631                -rm -f $(includedir)/factoryconf.h
632                -rm -f $(includedir)/factory.h
633                -rm -f $(libdir)/$(libfactory)
634                -rmdir $(templatedir)
635                -rmdir $(includedir)
636                -rmdir $(libdir)
637
638uninstallmem:
639                -rm -f $(libdir)/libcfmem.a
640                -rmdir $(libdir)
641
642uninstallgftables:
643                -rm -f $(gftabledir)/gftable.*.*
644                -rmdir $(gftabledir)
645
646#
647# - building a distribution.
648#
649dist:           $(srcdir)/readcf.cc $(srcdir)/configure \
650                $(srcdir)/winnt/factory.h $(srcdir)/winnt/factoryconf.h
651                rm -f $(distname).tgz
652                rm -rf $(distname)
653                $(MKINSTALLDIRS) $(distname)/bin
654                $(MKINSTALLDIRS) $(distname)/examples
655                $(MKINSTALLDIRS) $(distname)/ftest
656                $(MKINSTALLDIRS) $(distname)/winnt
657                $(MKINSTALLDIRS) $(distname)/templates
658                @echo "Copying files to distribution directory ..."
659                @for file in $(distfiles); do \
660                  ln $(srcdir)/$$file $(distname)/$$file; \
661                done
662                tar cf $(distname).tar $(distname)
663                gzip $(distname).tar
664                mv $(distname).tar.gz $(distname).tgz
665
666#
667# - cleaning up.
668#
669clean:          ftestclean
670                -rm -f $(libfactory) libcfmem.a \
671                  $(ftestexec) gengftables test_install \
672                  factoryconf.h factory.h *.o *.d *.dtmp
673
674# remove gftables only if we built them
675mostlyclean:    clean doxyclean
676                -rm -f TAGS
677                -if test ! -f gftables/README; then \
678                  rm -rf gftables; \
679                fi
680
681distclean:      ftestdistclean mostlyclean
682                -rm -f $(distname).tgz GNUmakefile stamp-h \
683                  config.cache config.log config.status config.h
684                -rm -rf $(distname)
685
686maintainer-clean: distclean
687                @echo "This command is intended for maintainers to use;"
688                @echo "it deletes files that require bison to rebuild."
689                -rm -f $(srcdir)/readcf.cc
690
691#
692# - dependencies.
693#
694# Do not generate them automatically if there are not any
695# dependencies at all.  this trick saves some time when you do
696# not want to compile but do some maintenance which do not
697# require the dependencies.  say 'make depend' to create the
698# dependencies explicitly.
699#
700depend:         $(factorydep) $(memmandep) $(hdrtempldep)
701
702ifneq ($(wildcard *.d),)
703  include $(factorydep) $(memmandep) $(hdrtempldep)
704endif
705
706#
707# - configure stuff.
708#
709$(srcdir)/configure: configure.in
710                @echo "WARNING: You need to rerun autoconf. I am proceeding, for now."
711                touch configure
712
713#               -cd $(srcdir) && autoconf
714
715# seems gmake needs at least a trivial command.  otherwise all
716# files which depend on config.h will be remade even if congig.h
717# did not change.
718config.h:       stamp-h
719                @:
720
721stamp-h:        config.h.in config.status
722                CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status
723                echo timestamp > stamp-h
724
725GNUmakefile:    GNUmakefile.in config.status
726                CONFIG_FILES=GNUmakefile CONFIG_HEADERS= ./config.status
727
728ftest/GNUmakefile: ftest/GNUmakefile.in config.status
729                CONFIG_FILES=ftest/GNUmakefile CONFIG_HEADERS= ./config.status
730
731config.status:  configure
732                ./config.status --recheck
Note: See TracBrowser for help on using the repository browser.