source: git/factory/GNUmakefile.in @ 365819b

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