source: git/factory/GNUmakefile.in @ 0cc8979

fieker-DuValspielwiese
Last change on this file since 0cc8979 was f2c84a, checked in by Jens Schmidt <schmidt@…>, 27 years ago
* GNUmakefile.in (TMPLCXXFLAGS): set to `$(LIBCXXFLAGS)' git-svn-id: file:///usr/local/Singular/svn/trunk@845 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 12.6 KB
Line 
1# @configure_input@
2# $Id: GNUmakefile.in,v 1.18 1997-10-24 18:54:52 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
59AR =            @AR@
60BISON =         @BISON@
61MKINSTALLDIRS = @MKINSTALLDIRS@
62MAKEHEADER =    @MAKEHEADER@
63
64#
65# - flags.
66#
67CFLAGS =        @CFLAGS@
68CPPFLAGS =      @CPPFLAGS@
69CXXFLAGS =      @CXXFLAGS@
70DEFS =          @DEFS@
71LDFLAGS =       @LDFLAGS@
72LIBS =          @LIBS@
73
74ARFLAGS =       @ARFLAGS@
75MAKEHEADERFLAGS=@MAKEHEADERFLAGS@
76
77#
78# - some other variables.
79#
80factorysrc =    @factorysrc@
81factoryincl =   @factoryincl@
82memmansrc =     @memmansrc@
83memmanincl =    @memmanincl@
84
85alltargets =    @alltargets@
86installtargets =@installtargets@
87uninstalltargets=@uninstalltargets@
88
89############### END OF CONFIGURABLE SECTION ###############
90
91#
92# - compiler flags.
93#
94WARNFLAGS =     -w
95
96# flags to translate library c files
97LIBCFLAGS =     $(WARNFLAGS) \
98                -I. -I$(srcdir) \
99                $(DEFS) $(CPPFLAGS) $(CFLAGS)
100
101# flags to translate library c++ files
102LIBCXXFLAGS =   $(WARNFLAGS) -fno-implicit-templates \
103                -I. -I$(srcdir) \
104                $(DEFS) $(CPPFLAGS) $(CXXFLAGS)
105
106# flags to translate ftmpl_inst.cc
107TMPLCXXFLAGS =  $(LIBCXXFLAGS)
108
109# flags to link test programs
110TESTCXXFLAGS =  $(LIBCXXFLAGS)
111
112# flags to link test programs
113TESTLDFLAGS =   $(LIBS) $(LDFLAGS)
114
115# flags to create dependency lists
116DEPCXXFLAGS =   -I. -I$(srcdir) \
117                $(DEFS) $(CPPFLAGS)
118
119#
120# - source files.
121#
122
123# factory source files
124basefactorysrc := \
125                canonicalform.cc \
126                cf_algorithm.cc \
127                cf_binom.cc \
128                cf_char.cc \
129                cf_chinese.cc \
130                cf_eval.cc \
131                cf_factor.cc \
132                cf_factory.cc \
133                cf_gcd.cc \
134                cf_generator.cc \
135                cf_globals.cc \
136                cf_irred.cc \
137                cf_iter.cc \
138                cf_linsys.cc \
139                cf_map.cc \
140                cf_ops.cc \
141                cf_primes.cc \
142                cf_random.cc \
143                cf_resultant.cc \
144                cf_reval.cc \
145                cf_switches.cc \
146                cf_util.cc \
147                debug.cc \
148                fac_berlekamp.cc \
149                fac_cantzass.cc \
150                fac_distrib.cc \
151                fac_ezgcd.cc \
152                fac_iterfor.cc \
153                fac_multihensel.cc \
154                fac_multivar.cc \
155                fac_sqrfree.cc \
156                fac_univar.cc \
157                fac_util.cc \
158                ffops.cc \
159                gf_tabutil.cc \
160                gfops.cc \
161                initgmp.cc \
162                int_cf.cc \
163                int_int.cc \
164                int_poly.cc \
165                int_pp.cc \
166                int_rat.cc \
167                sm_sparsemod.cc \
168                sm_util.cc \
169                variable.cc
170singfactorysrc := \
171                singext.cc
172useiofactorysrc := \
173                parseutil.cc \
174                readcf.y
175distfactorysrc := \
176                $(basefactorysrc) \
177                $(singfactorysrc) \
178                $(useiofactorysrc)
179
180# factory object files and dependencies
181factoryobj :=   $(factorysrc:.cc=.o)
182factoryobj :=   $(factoryobj:.y=.o)
183factorydep :=   $(factorysrc:.cc=.d)
184factorydep :=   $(factorydep:.y=.d)
185
186# factory header files
187basefactoryincl := \
188                assert.h \
189                canonicalform.h \
190                cf_algorithm.h \
191                cf_binom.h \
192                cf_defs.h \
193                cf_eval.h \
194                cf_factory.h \
195                cf_generator.h \
196                cf_globals.h \
197                cf_gmp.h \
198                cf_irred.h \
199                cf_iter.h \
200                cf_map.h \
201                cf_primes.h \
202                cf_primetab.h \
203                cf_random.h \
204                cf_reval.h \
205                cf_switches.h \
206                cf_util.h \
207                debug.h \
208                fac_berlekamp.h \
209                fac_cantzass.h \
210                fac_distrib.h \
211                fac_iterfor.h \
212                fac_multivar.h \
213                fac_sqrfree.h \
214                fac_univar.h \
215                fac_util.h \
216                ffops.h \
217                gf_tabutil.h \
218                gfops.h \
219                gmpext.h \
220                imm.h \
221                int_cf.h \
222                int_int.h \
223                int_poly.h \
224                int_pp.h \
225                int_rat.h \
226                sm_sparsemod.h \
227                sm_util.h \
228                timing.h \
229                variable.h
230singfactoryincl := \
231                singext.h
232useiofactoryincl := \
233                parseutil.h
234distfactoryincl := \
235                $(basefactoryincl) \
236                $(singfactoryincl) \
237                $(useiofactoryincl)
238
239# memory manager source files
240basememmansrc := \
241                newdelete.cc
242newmemmansrc := \
243                mmalloc.c \
244                mmallocb.c \
245                mmallocs.c \
246                mmblock.c \
247                mmheap.c \
248                mminit.c \
249                mmspec.c \
250                mmutil.c
251oldmemmansrc := \
252                memutil.c
253distmemmansrc := \
254                $(basememmansrc) \
255                $(newmemmansrc) \
256                $(oldmemmansrc)
257
258# memory manager object files and dependencies
259memmanobj :=    $(memmansrc:.cc=.o)
260memmanobj :=    $(memmanobj:.c=.o)
261memmandep :=    $(memmansrc:.cc=.d)
262memmandep :=    $(memmandep:.c=.d)
263
264# memory manager header files
265newmemmanincl := \
266                mmprivate.h \
267                memman.h
268oldmemmanincl := \
269                memutil.h
270distmemmanincl := \
271                $(newmemmanincl) \
272                $(oldmemmanincl)
273
274# factory template files
275templatesrc :=  \
276                ftmpl_array.cc \
277                ftmpl_factor.cc \
278                ftmpl_functions.h \
279                ftmpl_list.cc \
280                ftmpl_matrix.cc
281templateincl := \
282                ftmpl_array.h \
283                ftmpl_factor.h \
284                ftmpl_list.h \
285                ftmpl_matrix.h
286
287# header templates
288hdrtemplsrc := \
289                factoryconf.template \
290                factory.template
291hdrtempldep :=  $(hdrtemplsrc:.template=.d)
292
293# all the C/C++ source files in the distribution
294distsrc :=      \
295                $(distfactorysrc) $(distmemmansrc) \
296                $(addprefix templates/,$(templatesrc)) \
297                readcf.cc ftmpl_inst.cc \
298                gengftables.cc test_install.cc
299
300# all the C/C++ include files in the distribution
301distincl :=     \
302                $(distfactoryincl) $(distmemmanincl) \
303                $(addprefix templates/,$(templateincl))
304
305# all files in the distribution
306distfiles :=    \
307                $(distsrc) $(distincl) $(hdrtemplsrc) \
308                GNUmakefile.in configure.in config.h.in configure \
309                ChangeLog README NEWS INSTALL \
310                bin/folding.el bin/fold-docu.el \
311                bin/install-sh bin/makeheader bin/mkinstalldirs
312
313#
314# - phony targets.
315#
316.PHONY:         all cf mem dist depend \
317                clean mostlyclean distclean maintainer-clean \
318                install installcf installmem installgftables installtest \
319                uninstall uninstallcf uninstallmem uninstallgftables
320
321#
322# - pattern rules.
323#
324
325# how to create library objets
326%.o: %.cc config.h
327        $(CXX) -c $< $(LIBCXXFLAGS) -o $@
328%.o: %.c config.h
329        $(CC) -c $< $(LIBCFLAGS) -o $@
330
331# how to create dependency files
332%.d: %.cc factoryconf.h config.h
333        echo $@ "\\" > $@
334        $(CXX) -MM $< $(DEPCXXFLAGS) >> $@
335%.d: %.c factoryconf.h config.h
336        echo $@ "\\" > $@
337        $(CXX) -MM $< $(DEPCXXFLAGS) >> $@
338%.d: %.template
339        echo $@ $(@:.d=.h) : "\\" > $@
340        sed -n '/^\/\*MAKEHEADER/!d; n; s/^#include "//; s/"//; p;' $< | tr '\012' ' ' >> $@
341        echo >> $@
342
343# how to create header files from header templates
344%.h: %.template
345        $(MAKEHEADER) $(MAKEHEADERFLAGS) $< $@
346
347#
348# - building factory.
349#
350all:            $(alltargets)
351
352cf:             factoryconf.h factory.h $(libfactory)
353
354mem:            libcfmem.a
355
356#
357# - explicit targets.
358#
359$(libfactory):  $(factoryobj)
360                $(AR) $(ARFLAGS) $@ $^
361                $(RANLIB) $@
362
363libcfmem.a:     $(memmanobj)
364                $(AR) $(ARFLAGS) $@ $^
365                $(RANLIB) $@
366
367$(srcdir)/readcf.cc: readcf.y
368                $(BISON) $< -o $@
369
370ftmpl_inst.o:   ftmpl_inst.cc factoryconf.h factory.h \
371                $(addprefix templates/,$(templatesrc)) \
372                $(addprefix templates/,$(templateincl))
373                $(CXX) -c $< $(TMPLCXXFLAGS) -o $@
374
375# specify dependency in case user does not 'make depend'
376factoryconf.h:  config.h
377
378TAGS:
379                etags $(addprefix $(srcdir)/, $(distsrc) $(distincl))
380
381#
382# - GF(q) table generation.
383#
384
385# these are not all dependencies, but the most important ones
386gengftables.o:  gengftables.cc factory.h gf_tabutil.h \
387                factoryconf.h config.h
388                @if test -z "$(filter mem,$(alltargets))" \
389                  || test -z "$(filter readcf.y,$(factorysrc))"; then \
390                  echo "You have to configure --with-memman --enable-streamio"; \
391                  echo "to make gengftables."; \
392                  exit 1; \
393                fi
394                $(CXX) -c $< $(TESTCXXFLAGS) -o $@
395
396gengftables:    gengftables.o ftmpl_inst.o $(libfactory) libcfmem.a
397                $(CXX) $< ftmpl_inst.o -L. -lcf -lcfmem $(TESTLDFLAGS) -o $@
398
399gftables:       gengftables
400                @echo "This command will take quite a long time to execute;"
401                @echo "maybe you want to get the tables directly via ftp (see"
402                @echo "the INSTALL file)."
403                $(MKINSTALLDIRS) gftables
404                ./gengftables
405
406#
407# - installation test program.
408#
409
410# compile installation test program.  do not look up
411# header files in current directory or in $(srcdir), but use
412# the header files from the directory where they should be
413# after installation.
414test_install.o: test_install.cc
415                $(CXX) -c $< $(TESTCXXFLAGS) -I- -I$(includedir) -o $@
416
417# the same we do for ftmpl_inst.o which for this reason is named
418# iftmpl_inst.o
419iftmpl_inst.o:
420                $(CXX) -c $(templatedir)/ftmpl_inst.cc $(TMPLCXXFLAGS) -I- -I$(includedir) -o $@
421
422# link installation test program
423test_install:   test_install.o iftmpl_inst.o
424                $(CXX) $^ -L$(libdir) -lcf -lcfmem $(TESTLDFLAGS) -o $@
425
426installtest:    test_install
427                @-if ./test_install; then \
428                  echo "Installation seems ok."; \
429                else \
430                  echo "Please check path of your GF(q) tables in config.h."; \
431                fi
432
433#
434# - install targets.
435#
436install:        $(installtargets)
437
438installcf:      cf
439                $(MKINSTALLDIRS) $(libdir)
440                $(MKINSTALLDIRS) $(includedir)
441                $(MKINSTALLDIRS) $(templatedir)
442                $(INSTALL_DATA) $(libfactory) $(libdir)/$(libfactory)
443                $(INSTALL_DATA) factory.h $(includedir)/factory.h
444                $(INSTALL_DATA) factoryconf.h $(includedir)/factoryconf.h
445                $(INSTALL_DATA) $(srcdir)/ftmpl_inst.cc $(templatedir)/ftmpl_inst.cc
446                for file in $(templatesrc) $(templateincl); do \
447                  $(INSTALL_DATA) $(srcdir)/templates/$$file $(templatedir)/$$file; \
448                done
449
450installmem:     mem
451                $(MKINSTALLDIRS) $(libdir)
452                $(INSTALL_DATA) libcfmem.a $(libdir)/libcfmem.a
453
454# to a pity, this cannot be done automatically ...
455installgftables:
456                @echo "Copying GF(q) tables ..."
457                @if test -d gftables; then \
458                  $(MKINSTALLDIRS) $(gftabledir); \
459                  for file in gftables/gftable.*.*; do \
460                    $(INSTALL_DATA) $$file $(gftabledir); \
461                  done \
462                elif test -d "$(srcdir)"/gftables; then \
463                  $(MKINSTALLDIRS) $(gftabledir); \
464                  for file in "$(srcdir)"/gftables/gftable.*.*; do \
465                    $(INSTALL_DATA) $$file $(gftabledir); \
466                  done \
467                else \
468                  echo "Run 'make gftables' before installing them"; \
469                  exit 1; \
470                fi
471
472#
473# - uninstall targets.
474#
475uninstall:      $(uninstalltargets)
476
477uninstallcf:
478                -for file in $(templatesrc) $(templateincl); do \
479                  rm -f $(templatedir)/$$file; \
480                done
481                -rm -f $(templatedir)/ftmpl_inst.cc
482                -rm -f $(includedir)/factoryconf.h
483                -rm -f $(includedir)/factory.h
484                -rm -f $(libdir)/$(libfactory)
485                -rmdir $(templatedir)
486                -rmdir $(includedir)
487                -rmdir $(libdir)
488
489uninstallmem:
490                -rm -f $(libdir)/libcfmem.a
491                -rmdir $(libdir)
492
493uninstallgftables:
494                -rm -f $(gftabledir)/gftable.*.*
495                -rmdir $(gftabledir)
496
497#
498# - building a distribution.
499#
500dist:           $(srcdir)/readcf.cc $(srcdir)/configure
501                rm -f $(distname).tgz
502                rm -rf $(distname)
503                $(MKINSTALLDIRS) $(distname)/templates
504                $(MKINSTALLDIRS) $(distname)/bin
505                @echo "Copying files to distribution directory ..."
506                @for file in $(distfiles); do \
507                  ln $(srcdir)/$$file $(distname)/$$file; \
508                done
509                tar cf $(distname).tar $(distname)
510                gzip $(distname).tar
511                mv $(distname).tar.gz $(distname).tgz
512
513#
514# - cleaning up.
515#
516clean:         
517                -rm -f $(libfactory) libcfmem.a \
518                  gengftables test_install \
519                  factoryconf.h factory.h *.o *.d
520
521# remove gftables only if we built them
522mostlyclean:    clean
523                -rm -f TAGS
524                -if test ! -f gftables/README; then \
525                  rm -rf gftables; \
526                fi
527
528distclean:      mostlyclean
529                -rm -f $(distname).tgz GNUmakefile stamp-h \
530                  config.cache config.log config.status config.h
531                -rm -rf $(distname)
532
533maintainer-clean: distclean
534                @echo "This command is intended for maintainers to use;"
535                @echo "it deletes files that require bison to rebuild."
536                -rm -f $(srcdir)/readcf.cc
537
538#
539# - dependencies.
540#
541# Do not generate them automatically if there are not any
542# dependencies at all.  this trick saves some time when you do
543# not want to compile but do some maintenance which do not
544# require the dependencies.  say 'make depend' to create the
545# dependencies explicitly.
546#
547depend:         $(factorydep) $(memmandep) $(hdrtempldep)
548
549ifneq ($(wildcard *.d),)
550  include $(factorydep) $(memmandep) $(hdrtempldep)
551endif
552
553#
554# - configure stuff.
555#
556$(srcdir)/configure: configure.in
557                -cd $(srcdir) && autoconf
558
559# seems gmake needs at least a trivial command.  otherwise all
560# files which depend on config.h will be remade even if congig.h
561# did not change.
562config.h:       stamp-h
563                @:
564
565stamp-h:        config.h.in config.status
566                CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status
567                echo timestamp > stamp-h
568
569GNUmakefile:    GNUmakefile.in config.status
570                CONFIG_FILES=GNUmakefile CONFIG_HEADERS= ./config.status
571
572config.status:  configure
573                ./config.status --recheck
574
575#
576# - some extra targets inserted by configure.
577#
578@timingtargets@
579@debouttargets@
580@debtimingtargets@
Note: See TracBrowser for help on using the repository browser.