source: git/factory/GNUmakefile.in @ fcfd6c

spielwiese
Last change on this file since fcfd6c was fcfd6c, checked in by Jens Schmidt <schmidt@…>, 27 years ago
* GNUmakefile.in (uninstallgftables): brute force ('rm -rf') replaced by a safer variant * GNUmakefile.in (basefactoryincl): files sm_util.h and sm_sparsemod.h added (basefactorysrc): files sm_util.cc and sm_sparsemod.cc added git-svn-id: file:///usr/local/Singular/svn/trunk@544 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 11.2 KB
Line 
1# @configure_input@
2# $Id: GNUmakefile.in,v 1.8 1997-07-19 08:42:05 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 \
310                bin/install-sh bin/makeheader bin/mkinstalldirs
311
312#
313# - phony targets.
314#
315.PHONY:         all cf mem dist depend \
316                clean mostlyclean distclean maintainer-clean \
317                install installcf installmem installgftables \
318                uninstall uninstallcf uninstallmem uninstallgftables
319
320#
321# - pattern rules.
322#
323
324# how to create library objets
325%.o: %.cc config.h
326        $(CXX) -c $< $(LIBCXXFLAGS) -o $@
327%.o: %.c config.h
328        $(CC) -c $< $(LIBCFLAGS) -o $@
329
330# how to create dependency files
331%.d: %.cc config.h
332        echo $@ "\\" > $@
333        $(CXX) -MM $< $(DEPCXXFLAGS) >> $@
334%.d: %.c config.h
335        echo $@ "\\" > $@
336        $(CXX) -MM $< $(DEPCXXFLAGS) >> $@
337%.d: %.template
338        echo $@ $(@:.d=.h) : "\\" > $@
339        sed -n '/^\/\*MAKEHEADER/!d; n; s/^#include "//; s/"//; p;' $< | tr '\012' ' ' >> $@
340        echo >> $@
341
342# how to create header files from header templates
343%.h: %.template
344        $(MAKEHEADER) $(MAKEHEADERFLAGS) $< $@
345
346#
347# - building factory.
348#
349all:            $(alltargets)
350
351cf:             factoryconf.h factory.h $(libfactory)
352
353mem:            libcfmem.a
354
355#
356# - explicit targets.
357#
358$(libfactory):  $(factoryobj)
359                $(AR) $(ARFLAGS) $@ $^
360                $(RANLIB) $@
361
362libcfmem.a:     $(memmanobj)
363                $(AR) $(ARFLAGS) $@ $^
364                $(RANLIB) $@
365
366$(srcdir)/readcf.cc: readcf.y
367                $(BISON) $< -o $@
368
369ftmpl_inst.o:   ftmpl_inst.cc factoryconf.h factory.h \
370                $(addprefix templates/,$(templatesrc)) \
371                $(addprefix templates/,$(templateincl))
372                $(CXX) -c $< $(TMPLCXXFLAGS) -o $@
373
374# this are not all dependencies, but the most important ones
375gengftables.o:  gengftables.cc factory.h gf_tabutil.h \
376                factoryconf.h config.h
377                @if test -z "$(filter mem,$(alltargets))" \
378                  || test -z "$(filter readcf.y,$(factorysrc))"; then \
379                  echo "You have to configure --with-memman --enable-streamio"; \
380                  echo "to make gengftables."; \
381                  exit 1; \
382                fi
383                $(CXX) -c $< $(TESTCXXFLAGS) -o $@
384
385gengftables:    gengftables.o ftmpl_inst.o $(libfactory) libcfmem.a
386                $(CXX) $< ftmpl_inst.o -L. -lcf -lcfmem $(TESTLDFLAGS) -o $@
387
388gftables:       gengftables
389                @echo "This command will take quite a long time to execute;"
390                @echo "maybe you want to get the tables directly via ftp (see"
391                @echo "the INSTALL file)."
392                $(MKINSTALLDIRS) gftables
393                ./gengftables
394
395# specify dependency in case user does not 'make depend'
396factoryconf.h:  config.h
397
398TAGS:
399                etags $(addprefix $(srcdir)/, $(distsrc) $(distincl))
400
401#
402# - install targets.
403#
404install:        $(installtargets)
405
406installcf:      cf
407                $(MKINSTALLDIRS) $(libdir)
408                $(MKINSTALLDIRS) $(includedir)
409                $(MKINSTALLDIRS) $(templatedir)
410                $(INSTALL_DATA) $(libfactory) $(libdir)/$(libfactory)
411                $(INSTALL_DATA) factory.h $(includedir)/factory.h
412                $(INSTALL_DATA) factoryconf.h $(includedir)/factoryconf.h
413                $(INSTALL_DATA) $(srcdir)/ftmpl_inst.cc $(templatedir)/ftmpl_inst.cc
414                for file in $(templatesrc) $(templateincl); do \
415                  $(INSTALL_DATA) $(srcdir)/templates/$$file $(templatedir)/$$file; \
416                done
417
418installmem:     mem
419                $(MKINSTALLDIRS) $(libdir)
420                $(INSTALL_DATA) libcfmem.a $(libdir)/libcfmem.a
421
422installgftables: gftables
423                $(MKINSTALLDIRS) $(gftabledir)
424                for file in $</*; do \
425                  $(INSTALL_DATA) $$file $(gftabledir)/$$file; \
426                done
427
428#
429# - uninstall targets.
430#
431uninstall:      $(uninstalltargets)
432
433uninstallcf:
434                -for file in $(templatesrc) $(templateincl); do \
435                  rm -f $(templatedir)/$$file; \
436                done
437                -rm -f $(templatedir)/ftmpl_inst.cc
438                -rm -f $(includedir)/factoryconf.h
439                -rm -f $(includedir)/factory.h
440                -rm -f $(libdir)/$(libfactory)
441                -rmdir $(templatedir)
442                -rmdir $(includedir)
443                -rmdir $(libdir)
444
445uninstallmem:
446                -rm -f $(libdir)/libcfmem.a
447                -rmdir $(libdir)
448
449uninstallgftables:
450                -rm -f $(gftabledir)/gftable.*.*
451                -rmdir $(gftabledir)
452
453#
454# - building a distribution.
455#
456dist:           $(srcdir)/readcf.cc $(srcdir)/configure
457                rm -f $(distname).tar.gz
458                rm -rf $(distname)
459                $(MKINSTALLDIRS) $(distname)/templates
460                $(MKINSTALLDIRS) $(distname)/bin
461                for file in $(distfiles); do \
462                  ln $(srcdir)/$$file $(distname)/$$file; \
463                done
464                tar cf $(distname).tar $(distname)
465                gzip $(distname).tar
466
467#
468# - cleaning up.
469#
470clean:         
471                -rm -f $(libfactory) libcfmem.a gengftables \
472                  factoryconf.h factory.h *.o *.d
473
474# remove gftables only if we built them
475mostlyclean:    clean
476                -rm -f TAGS
477                -if test ! -f gftables/README; then \
478                  rm -rf gftables; \
479                fi
480
481distclean:      mostlyclean
482                -rm -f $(distname).tar.gz GNUmakefile stamp-h \
483                  config.cache config.log config.status config.h
484                -rm -rf $(distname)
485
486maintainer-clean: distclean
487                @echo "This command is intended for maintainers to use;"
488                @echo "it deletes files that require bison to rebuild."
489                -rm -f $(srcdir)/readcf.cc
490
491#
492# - dependencies.
493#
494# Do not generate them automatically if there are not any
495# dependencies at all.  this trick saves some time when you do
496# not want to compile but do some maintenance which do not
497# require the dependencies.  say 'make depend' to create the
498# dependencies explicitly.
499#
500depend:         $(factorydep) $(memmandep) $(hdrtempldep)
501
502ifneq ($(wildcard *.d),)
503  include $(factorydep) $(memmandep) $(hdrtempldep)
504endif
505
506#
507# - configure stuff.
508#
509$(srcdir)/configure: configure.in
510                -cd $(srcdir) && autoconf
511
512# seems gmake needs at least a trivial command.  otherwise all
513# files which depend on config.h will be remade even if congig.h
514# did not change.
515config.h:       stamp-h
516                @:
517
518stamp-h:        config.h.in config.status
519                CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status
520                echo timestamp > stamp-h
521
522GNUmakefile:    GNUmakefile.in config.status
523                CONFIG_FILES=GNUmakefile CONFIG_HEADERS= ./config.status
524
525config.status:  configure
526                ./config.status --recheck
527
528#
529# - some extra targets inserted by configure.
530#
531@timingtargets@
532@debouttargets@
533@debtimingtargets@
Note: See TracBrowser for help on using the repository browser.