source: git/factory/GNUmakefile.in @ f21a7c

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