source: git/factory/GNUmakefile.in @ e6d2f45

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