source: git/factory/GNUmakefile.in @ 8c8415

fieker-DuValspielwiese
Last change on this file since 8c8415 was 063ebb, checked in by Jens Schmidt <schmidt@…>, 27 years ago
* GNUmakefile.in (distfiles): bin/folding.el and bin/fold-docu.el added git-svn-id: file:///usr/local/Singular/svn/trunk@577 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 11.8 KB
Line 
1# @configure_input@
2# $Id: GNUmakefile.in,v 1.11 1997-07-24 10:45:23 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 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 =  $(WARNFLAGS) \
108                -I. -I$(srcdir) \
109                $(DEFS) $(CPPFLAGS) $(CXXFLAGS)
110
111# flags to link test programs
112TESTCXXFLAGS =  $(LIBCXXFLAGS)
113
114# flags to link test programs
115TESTLDFLAGS =   $(LIBS) $(LDFLAGS)
116
117# flags to create dependency lists
118DEPCXXFLAGS =   -I. -I$(srcdir) \
119                $(DEFS) $(CPPFLAGS)
120
121#
122# - source files.
123#
124
125# factory source files
126basefactorysrc := \
127                canonicalform.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_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_binom.h \
191                cf_chinese.h \
192                cf_defs.h \
193                cf_eval.h \
194                cf_factor.h \
195                cf_factory.h \
196                cf_generator.h \
197                cf_globals.h \
198                cf_gmp.h \
199                cf_irred.h \
200                cf_iter.h \
201                cf_map.h \
202                cf_primes.h \
203                cf_primetab.h \
204                cf_random.h \
205                cf_reval.h \
206                cf_switches.h \
207                cf_util.h \
208                debug.h \
209                fac_berlekamp.h \
210                fac_cantzass.h \
211                fac_distrib.h \
212                fac_iterfor.h \
213                fac_multivar.h \
214                fac_sqrfree.h \
215                fac_univar.h \
216                fac_util.h \
217                ffops.h \
218                gf_tabutil.h \
219                gfops.h \
220                gmpext.h \
221                imm.h \
222                int_cf.h \
223                int_int.h \
224                int_poly.h \
225                int_pp.h \
226                int_rat.h \
227                sm_sparsemod.h \
228                sm_util.h \
229                timing.h \
230                variable.h
231singfactoryincl := \
232                singext.h
233useiofactoryincl := \
234                parseutil.h
235distfactoryincl := \
236                $(basefactoryincl) \
237                $(singfactoryincl) \
238                $(useiofactoryincl)
239
240# memory manager source files
241basememmansrc := \
242                newdelete.cc
243newmemmansrc := \
244                mmalloc.c \
245                mmallocb.c \
246                mmallocs.c \
247                mmblock.c \
248                mmheap.c \
249                mminit.c \
250                mmspec.c \
251                mmutil.c
252oldmemmansrc := \
253                memutil.c
254distmemmansrc := \
255                $(basememmansrc) \
256                $(newmemmansrc) \
257                $(oldmemmansrc)
258
259# memory manager object files and dependencies
260memmanobj :=    $(memmansrc:.cc=.o)
261memmanobj :=    $(memmanobj:.c=.o)
262memmandep :=    $(memmansrc:.cc=.d)
263memmandep :=    $(memmandep:.c=.d)
264
265# memory manager header files
266newmemmanincl := \
267                mmprivate.h \
268                memman.h
269oldmemmanincl := \
270                memutil.h
271distmemmanincl := \
272                $(newmemmanincl) \
273                $(oldmemmanincl)
274
275# factory template files
276templatesrc :=  \
277                ftmpl_array.cc \
278                ftmpl_factor.cc \
279                ftmpl_functions.h \
280                ftmpl_list.cc \
281                ftmpl_matrix.cc
282templateincl := \
283                ftmpl_array.h \
284                ftmpl_factor.h \
285                ftmpl_list.h \
286                ftmpl_matrix.h
287
288# header templates
289hdrtemplsrc := \
290                factoryconf.template \
291                factory.template
292hdrtempldep :=  $(hdrtemplsrc:.template=.d)
293
294# all the C/C++ source files in the distribution
295distsrc :=      \
296                $(distfactorysrc) $(distmemmansrc) \
297                $(addprefix templates/,$(templatesrc)) \
298                readcf.cc ftmpl_inst.cc gengftables.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 \
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 config.h
333        echo $@ "\\" > $@
334        $(CXX) -MM $< $(DEPCXXFLAGS) >> $@
335%.d: %.c 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# this are not all dependencies, but the most important ones
376gengftables.o:  gengftables.cc factory.h gf_tabutil.h \
377                factoryconf.h config.h
378                @if test -z "$(filter mem,$(alltargets))" \
379                  || test -z "$(filter readcf.y,$(factorysrc))"; then \
380                  echo "You have to configure --with-memman --enable-streamio"; \
381                  echo "to make gengftables."; \
382                  exit 1; \
383                fi
384                $(CXX) -c $< $(TESTCXXFLAGS) -o $@
385
386gengftables:    gengftables.o ftmpl_inst.o $(libfactory) libcfmem.a
387                $(CXX) $< ftmpl_inst.o -L. -lcf -lcfmem $(TESTLDFLAGS) -o $@
388
389gftables:       gengftables
390                @echo "This command will take quite a long time to execute;"
391                @echo "maybe you want to get the tables directly via ftp (see"
392                @echo "the INSTALL file)."
393                $(MKINSTALLDIRS) gftables
394                ./gengftables
395
396# specify dependency in case user does not 'make depend'
397factoryconf.h:  config.h
398
399TAGS:
400                etags $(addprefix $(srcdir)/, $(distsrc) $(distincl))
401
402#
403# - install targets.
404#
405install:        $(installtargets)
406
407installcf:      cf
408                $(MKINSTALLDIRS) $(libdir)
409                $(MKINSTALLDIRS) $(includedir)
410                $(MKINSTALLDIRS) $(templatedir)
411                $(INSTALL_DATA) $(libfactory) $(libdir)/$(libfactory)
412                $(INSTALL_DATA) factory.h $(includedir)/factory.h
413                $(INSTALL_DATA) factoryconf.h $(includedir)/factoryconf.h
414                $(INSTALL_DATA) $(srcdir)/ftmpl_inst.cc $(templatedir)/ftmpl_inst.cc
415                for file in $(templatesrc) $(templateincl); do \
416                  $(INSTALL_DATA) $(srcdir)/templates/$$file $(templatedir)/$$file; \
417                done
418
419installmem:     mem
420                $(MKINSTALLDIRS) $(libdir)
421                $(INSTALL_DATA) libcfmem.a $(libdir)/libcfmem.a
422
423# to a pity, this cannot be done automatically ...
424installgftables:
425                @echo "Copying GF(q) tables ..."
426                @if test -d gftables; then \
427                  $(MKINSTALLDIRS) $(gftabledir); \
428                  for file in gftables/gftable.*.*; do \
429                    $(INSTALL_DATA) $$file $(gftabledir); \
430                  done \
431                elif test -d "$(srcdir)"/gftables; then \
432                  $(MKINSTALLDIRS) $(gftabledir); \
433                  for file in "$(srcdir)"/gftables/gftable.*.*; do \
434                    $(INSTALL_DATA) $$file $(gftabledir); \
435                  done \
436                else \
437                  echo "Run 'make gftables' before installing them"; \
438                  exit 1; \
439                fi
440
441#
442# - uninstall targets.
443#
444uninstall:      $(uninstalltargets)
445
446uninstallcf:
447                -for file in $(templatesrc) $(templateincl); do \
448                  rm -f $(templatedir)/$$file; \
449                done
450                -rm -f $(templatedir)/ftmpl_inst.cc
451                -rm -f $(includedir)/factoryconf.h
452                -rm -f $(includedir)/factory.h
453                -rm -f $(libdir)/$(libfactory)
454                -rmdir $(templatedir)
455                -rmdir $(includedir)
456                -rmdir $(libdir)
457
458uninstallmem:
459                -rm -f $(libdir)/libcfmem.a
460                -rmdir $(libdir)
461
462uninstallgftables:
463                -rm -f $(gftabledir)/gftable.*.*
464                -rmdir $(gftabledir)
465
466#
467# - building a distribution.
468#
469dist:           $(srcdir)/readcf.cc $(srcdir)/configure
470                rm -f $(distname).tgz
471                rm -rf $(distname)
472                $(MKINSTALLDIRS) $(distname)/templates
473                $(MKINSTALLDIRS) $(distname)/bin
474                @echo "Copying files to distribution directory ..."
475                @for file in $(distfiles); do \
476                  ln $(srcdir)/$$file $(distname)/$$file; \
477                done
478                tar cf $(distname).tar $(distname)
479                gzip $(distname).tar
480                mv $(distname).tar.gz $(distname).tgz
481
482#
483# - cleaning up.
484#
485clean:         
486                -rm -f $(libfactory) libcfmem.a gengftables \
487                  factoryconf.h factory.h *.o *.d
488
489# remove gftables only if we built them
490mostlyclean:    clean
491                -rm -f TAGS
492                -if test ! -f gftables/README; then \
493                  rm -rf gftables; \
494                fi
495
496distclean:      mostlyclean
497                -rm -f $(distname).tgz GNUmakefile stamp-h \
498                  config.cache config.log config.status config.h
499                -rm -rf $(distname)
500
501maintainer-clean: distclean
502                @echo "This command is intended for maintainers to use;"
503                @echo "it deletes files that require bison to rebuild."
504                -rm -f $(srcdir)/readcf.cc
505
506#
507# - dependencies.
508#
509# Do not generate them automatically if there are not any
510# dependencies at all.  this trick saves some time when you do
511# not want to compile but do some maintenance which do not
512# require the dependencies.  say 'make depend' to create the
513# dependencies explicitly.
514#
515depend:         $(factorydep) $(memmandep) $(hdrtempldep)
516
517ifneq ($(wildcard *.d),)
518  include $(factorydep) $(memmandep) $(hdrtempldep)
519endif
520
521#
522# - configure stuff.
523#
524$(srcdir)/configure: configure.in
525                -cd $(srcdir) && autoconf
526
527# seems gmake needs at least a trivial command.  otherwise all
528# files which depend on config.h will be remade even if congig.h
529# did not change.
530config.h:       stamp-h
531                @:
532
533stamp-h:        config.h.in config.status
534                CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status
535                echo timestamp > stamp-h
536
537GNUmakefile:    GNUmakefile.in config.status
538                CONFIG_FILES=GNUmakefile CONFIG_HEADERS= ./config.status
539
540config.status:  configure
541                ./config.status --recheck
542
543#
544# - some extra targets inserted by configure.
545#
546@timingtargets@
547@debouttargets@
548@debtimingtargets@
Note: See TracBrowser for help on using the repository browser.