source: git/factory/GNUmakefile.in @ 3dfd7c

spielwiese
Last change on this file since 3dfd7c was 3dfd7c, checked in by Jens Schmidt <schmidt@…>, 27 years ago
* GNUmakefile.in (basefactorysrc): cf_algorithm.cc added to distribution git-svn-id: file:///usr/local/Singular/svn/trunk@660 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.14 1997-09-04 15:18:09 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_algorithm.cc \
129                cf_binom.cc \
130                cf_char.cc \
131                cf_chinese.cc \
132                cf_eval.cc \
133                cf_factor.cc \
134                cf_factory.cc \
135                cf_gcd.cc \
136                cf_generator.cc \
137                cf_globals.cc \
138                cf_irred.cc \
139                cf_iter.cc \
140                cf_linsys.cc \
141                cf_map.cc \
142                cf_ops.cc \
143                cf_primes.cc \
144                cf_random.cc \
145                cf_resultant.cc \
146                cf_reval.cc \
147                cf_switches.cc \
148                cf_util.cc \
149                debug.cc \
150                fac_berlekamp.cc \
151                fac_cantzass.cc \
152                fac_distrib.cc \
153                fac_ezgcd.cc \
154                fac_iterfor.cc \
155                fac_multihensel.cc \
156                fac_multivar.cc \
157                fac_sqrfree.cc \
158                fac_univar.cc \
159                fac_util.cc \
160                ffops.cc \
161                gf_tabutil.cc \
162                gfops.cc \
163                initgmp.cc \
164                int_cf.cc \
165                int_int.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                gf_tabutil.h \
220                gfops.h \
221                gmpext.h \
222                imm.h \
223                int_cf.h \
224                int_int.h \
225                int_poly.h \
226                int_pp.h \
227                int_rat.h \
228                sm_sparsemod.h \
229                sm_util.h \
230                timing.h \
231                variable.h
232singfactoryincl := \
233                singext.h
234useiofactoryincl := \
235                parseutil.h
236distfactoryincl := \
237                $(basefactoryincl) \
238                $(singfactoryincl) \
239                $(useiofactoryincl)
240
241# memory manager source files
242basememmansrc := \
243                newdelete.cc
244newmemmansrc := \
245                mmalloc.c \
246                mmallocb.c \
247                mmallocs.c \
248                mmblock.c \
249                mmheap.c \
250                mminit.c \
251                mmspec.c \
252                mmutil.c
253oldmemmansrc := \
254                memutil.c
255distmemmansrc := \
256                $(basememmansrc) \
257                $(newmemmansrc) \
258                $(oldmemmansrc)
259
260# memory manager object files and dependencies
261memmanobj :=    $(memmansrc:.cc=.o)
262memmanobj :=    $(memmanobj:.c=.o)
263memmandep :=    $(memmansrc:.cc=.d)
264memmandep :=    $(memmandep:.c=.d)
265
266# memory manager header files
267newmemmanincl := \
268                mmprivate.h \
269                memman.h
270oldmemmanincl := \
271                memutil.h
272distmemmanincl := \
273                $(newmemmanincl) \
274                $(oldmemmanincl)
275
276# factory template files
277templatesrc :=  \
278                ftmpl_array.cc \
279                ftmpl_factor.cc \
280                ftmpl_functions.h \
281                ftmpl_list.cc \
282                ftmpl_matrix.cc
283templateincl := \
284                ftmpl_array.h \
285                ftmpl_factor.h \
286                ftmpl_list.h \
287                ftmpl_matrix.h
288
289# header templates
290hdrtemplsrc := \
291                factoryconf.template \
292                factory.template
293hdrtempldep :=  $(hdrtemplsrc:.template=.d)
294
295# all the C/C++ source files in the distribution
296distsrc :=      \
297                $(distfactorysrc) $(distmemmansrc) \
298                $(addprefix templates/,$(templatesrc)) \
299                readcf.cc ftmpl_inst.cc gengftables.cc
300
301# all the C/C++ include files in the distribution
302distincl :=     \
303                $(distfactoryincl) $(distmemmanincl) \
304                $(addprefix templates/,$(templateincl))
305
306# all files in the distribution
307distfiles :=    \
308                $(distsrc) $(distincl) $(hdrtemplsrc) \
309                GNUmakefile.in configure.in config.h.in configure \
310                ChangeLog README NEWS INSTALL \
311                bin/folding.el bin/fold-docu.el \
312                bin/install-sh bin/makeheader bin/mkinstalldirs
313
314#
315# - phony targets.
316#
317.PHONY:         all cf mem dist depend \
318                clean mostlyclean distclean maintainer-clean \
319                install installcf installmem installgftables \
320                uninstall uninstallcf uninstallmem uninstallgftables
321
322#
323# - pattern rules.
324#
325
326# how to create library objets
327%.o: %.cc config.h
328        $(CXX) -c $< $(LIBCXXFLAGS) -o $@
329%.o: %.c config.h
330        $(CC) -c $< $(LIBCFLAGS) -o $@
331
332# how to create dependency files
333%.d: %.cc config.h
334        echo $@ "\\" > $@
335        $(CXX) -MM $< $(DEPCXXFLAGS) >> $@
336%.d: %.c config.h
337        echo $@ "\\" > $@
338        $(CXX) -MM $< $(DEPCXXFLAGS) >> $@
339%.d: %.template
340        echo $@ $(@:.d=.h) : "\\" > $@
341        sed -n '/^\/\*MAKEHEADER/!d; n; s/^#include "//; s/"//; p;' $< | tr '\012' ' ' >> $@
342        echo >> $@
343
344# how to create header files from header templates
345%.h: %.template
346        $(MAKEHEADER) $(MAKEHEADERFLAGS) $< $@
347
348#
349# - building factory.
350#
351all:            $(alltargets)
352
353cf:             factoryconf.h factory.h $(libfactory)
354
355mem:            libcfmem.a
356
357#
358# - explicit targets.
359#
360$(libfactory):  $(factoryobj)
361                $(AR) $(ARFLAGS) $@ $^
362                $(RANLIB) $@
363
364libcfmem.a:     $(memmanobj)
365                $(AR) $(ARFLAGS) $@ $^
366                $(RANLIB) $@
367
368$(srcdir)/readcf.cc: readcf.y
369                $(BISON) $< -o $@
370
371ftmpl_inst.o:   ftmpl_inst.cc factoryconf.h factory.h \
372                $(addprefix templates/,$(templatesrc)) \
373                $(addprefix templates/,$(templateincl))
374                $(CXX) -c $< $(TMPLCXXFLAGS) -o $@
375
376# this are not all dependencies, but the most important ones
377gengftables.o:  gengftables.cc factory.h gf_tabutil.h \
378                factoryconf.h config.h
379                @if test -z "$(filter mem,$(alltargets))" \
380                  || test -z "$(filter readcf.y,$(factorysrc))"; then \
381                  echo "You have to configure --with-memman --enable-streamio"; \
382                  echo "to make gengftables."; \
383                  exit 1; \
384                fi
385                $(CXX) -c $< $(TESTCXXFLAGS) -o $@
386
387gengftables:    gengftables.o ftmpl_inst.o $(libfactory) libcfmem.a
388                $(CXX) $< ftmpl_inst.o -L. -lcf -lcfmem $(TESTLDFLAGS) -o $@
389
390gftables:       gengftables
391                @echo "This command will take quite a long time to execute;"
392                @echo "maybe you want to get the tables directly via ftp (see"
393                @echo "the INSTALL file)."
394                $(MKINSTALLDIRS) gftables
395                ./gengftables
396
397# specify dependency in case user does not 'make depend'
398factoryconf.h:  config.h
399
400TAGS:
401                etags $(addprefix $(srcdir)/, $(distsrc) $(distincl))
402
403#
404# - install targets.
405#
406install:        $(installtargets)
407
408installcf:      cf
409                $(MKINSTALLDIRS) $(libdir)
410                $(MKINSTALLDIRS) $(includedir)
411                $(MKINSTALLDIRS) $(templatedir)
412                $(INSTALL_DATA) $(libfactory) $(libdir)/$(libfactory)
413                $(INSTALL_DATA) factory.h $(includedir)/factory.h
414                $(INSTALL_DATA) factoryconf.h $(includedir)/factoryconf.h
415                $(INSTALL_DATA) $(srcdir)/ftmpl_inst.cc $(templatedir)/ftmpl_inst.cc
416                for file in $(templatesrc) $(templateincl); do \
417                  $(INSTALL_DATA) $(srcdir)/templates/$$file $(templatedir)/$$file; \
418                done
419
420installmem:     mem
421                $(MKINSTALLDIRS) $(libdir)
422                $(INSTALL_DATA) libcfmem.a $(libdir)/libcfmem.a
423
424# to a pity, this cannot be done automatically ...
425installgftables:
426                @echo "Copying GF(q) tables ..."
427                @if test -d gftables; then \
428                  $(MKINSTALLDIRS) $(gftabledir); \
429                  for file in gftables/gftable.*.*; do \
430                    $(INSTALL_DATA) $$file $(gftabledir); \
431                  done \
432                elif test -d "$(srcdir)"/gftables; then \
433                  $(MKINSTALLDIRS) $(gftabledir); \
434                  for file in "$(srcdir)"/gftables/gftable.*.*; do \
435                    $(INSTALL_DATA) $$file $(gftabledir); \
436                  done \
437                else \
438                  echo "Run 'make gftables' before installing them"; \
439                  exit 1; \
440                fi
441
442#
443# - uninstall targets.
444#
445uninstall:      $(uninstalltargets)
446
447uninstallcf:
448                -for file in $(templatesrc) $(templateincl); do \
449                  rm -f $(templatedir)/$$file; \
450                done
451                -rm -f $(templatedir)/ftmpl_inst.cc
452                -rm -f $(includedir)/factoryconf.h
453                -rm -f $(includedir)/factory.h
454                -rm -f $(libdir)/$(libfactory)
455                -rmdir $(templatedir)
456                -rmdir $(includedir)
457                -rmdir $(libdir)
458
459uninstallmem:
460                -rm -f $(libdir)/libcfmem.a
461                -rmdir $(libdir)
462
463uninstallgftables:
464                -rm -f $(gftabledir)/gftable.*.*
465                -rmdir $(gftabledir)
466
467#
468# - building a distribution.
469#
470dist:           $(srcdir)/readcf.cc $(srcdir)/configure
471                rm -f $(distname).tgz
472                rm -rf $(distname)
473                $(MKINSTALLDIRS) $(distname)/templates
474                $(MKINSTALLDIRS) $(distname)/bin
475                @echo "Copying files to distribution directory ..."
476                @for file in $(distfiles); do \
477                  ln $(srcdir)/$$file $(distname)/$$file; \
478                done
479                tar cf $(distname).tar $(distname)
480                gzip $(distname).tar
481                mv $(distname).tar.gz $(distname).tgz
482
483#
484# - cleaning up.
485#
486clean:         
487                -rm -f $(libfactory) libcfmem.a gengftables \
488                  factoryconf.h factory.h *.o *.d
489
490# remove gftables only if we built them
491mostlyclean:    clean
492                -rm -f TAGS
493                -if test ! -f gftables/README; then \
494                  rm -rf gftables; \
495                fi
496
497distclean:      mostlyclean
498                -rm -f $(distname).tgz GNUmakefile stamp-h \
499                  config.cache config.log config.status config.h
500                -rm -rf $(distname)
501
502maintainer-clean: distclean
503                @echo "This command is intended for maintainers to use;"
504                @echo "it deletes files that require bison to rebuild."
505                -rm -f $(srcdir)/readcf.cc
506
507#
508# - dependencies.
509#
510# Do not generate them automatically if there are not any
511# dependencies at all.  this trick saves some time when you do
512# not want to compile but do some maintenance which do not
513# require the dependencies.  say 'make depend' to create the
514# dependencies explicitly.
515#
516depend:         $(factorydep) $(memmandep) $(hdrtempldep)
517
518ifneq ($(wildcard *.d),)
519  include $(factorydep) $(memmandep) $(hdrtempldep)
520endif
521
522#
523# - configure stuff.
524#
525$(srcdir)/configure: configure.in
526                -cd $(srcdir) && autoconf
527
528# seems gmake needs at least a trivial command.  otherwise all
529# files which depend on config.h will be remade even if congig.h
530# did not change.
531config.h:       stamp-h
532                @:
533
534stamp-h:        config.h.in config.status
535                CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status
536                echo timestamp > stamp-h
537
538GNUmakefile:    GNUmakefile.in config.status
539                CONFIG_FILES=GNUmakefile CONFIG_HEADERS= ./config.status
540
541config.status:  configure
542                ./config.status --recheck
543
544#
545# - some extra targets inserted by configure.
546#
547@timingtargets@
548@debouttargets@
549@debtimingtargets@
Note: See TracBrowser for help on using the repository browser.