source: git/Singular/Makefile.in @ 400884

spielwiese
Last change on this file since 400884 was 402a67, checked in by Hans Schönemann <hannes@…>, 27 years ago
* hannes: moved floating point arithm. from C++ to C (weight.cc weight0.c Makefile.in) git-svn-id: file:///usr/local/Singular/svn/trunk@500 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 10.7 KB
Line 
1#################################################################
2###
3### Makefile for Singular
4###
5#################################################################
6
7SHELL           = /bin/sh
8
9##
10## versions
11##
12SINGULAR_MAJOR_VERSION  = @SINGULAR_MAJOR_VERSION@
13SINGULAR_MINOR_VERSION  = @SINGULAR_MINOR_VERSION@
14DIST_NAME       = Singular-${SINGULAR_MAJOR_VERSION}.${SINGULAR_MINOR_VERSION}
15
16##
17## various paths
18##
19srcdir          = @srcdir@
20prefix          = @prefix@
21exec_prefix     = @exec_prefix@
22libdir          = @libdir@
23# program executable goes here
24bindir          = @bindir@
25# Singular libs go here
26singulardatadir = @singulardatadir@
27includedir      = @includedir@
28
29##
30## various programs
31##
32CC              = @CC@
33CXX             = @CXX@
34BISON           = bison
35LEX             = flex
36@SET_MAKE@
37INSTALL         = ./install-sh -c
38INSTALL_PROGRAM = ${INSTALL}
39INSTALL_DATA    = ${INSTALL} -m 644
40MKINSTALLDIRS   = ./mkinstalldirs
41
42##
43## compiler and linker options
44##
45CFLAGS          = @CFLAGS@
46CXXFLAGS        = @CXXFLAGS@
47CXXTEMPLFLAGS   = @CXXTEMPLFLAGS@
48CPPFLAGS        = -I${srcdir} @CPPFLAGS@
49DEFS            = @DEFS@ -DNDEBUG
50LDFLAGS         = @LDFLAGS@
51LIBS            = @NEED_LIBS@
52
53##
54## subdirectories
55##
56# where the doumentation files are
57docdir          = doc
58# where the tests files are
59testdir         = tests
60
61##
62## the configuration
63##
64WITH_MP         = @WITH_MP@
65WITH_FACTORY    = @WITH_FACTORY@
66WITH_LIBFAC     = @WITH_LIBFAC@
67
68##
69## End configuration dependend stuff
70#################################################################
71
72###
73### file sets
74###
75
76CXXSOURCES=grammar.cc scanner.cc algmap.cc attrib.cc binom.cc clapconv.cc \
77    clapmem.cc clapsing.cc claptmpl.cc cntrlc.cc \
78    extra.cc febase.cc feread.cc \
79    ffields.cc hdegree.cc hilb.cc hutil.cc \
80    ideals.cc intvec.cc iparith.cc \
81    ipassign.cc ipconv.cc ipid.cc iplib.cc \
82    ipprint.cc ipshell.cc khstd.cc kstdfac.cc \
83    kstd1.cc kstd2.cc kutil.cc lists.cc \
84    longalg.cc longrat.cc \
85    longrat0.cc maps.cc matpol.cc misc.cc \
86    mminit.cc modulop.cc \
87    fglm.cc fglmzero.cc fglmvec.cc \
88    numbers.cc polys.cc polys0.cc polys1.cc polys2.cc \
89    ring.cc shortfl.cc silink.cc sing_mp.cc\
90    sing_dld.cc sing_dbm.cc spolys.cc spolys0.cc \
91    subexpr.cc syz.cc syz0.cc syz1.cc \
92    tesths.cc timer.cc weight.cc \
93    mpsr_Put.cc mpsr_PutPoly.cc mpsr_Tok.cc mpsr_GetPoly.cc \
94    mpsr_Get.cc mpsr_GetMisc.cc mpsr_Error.cc
95
96CSOURCES=mmalloc.c mmallocb.c mmallocs.c mmblock.c mmheap.c mmspec.c mmutil.c weight0.c
97
98SOURCES=${CSOURCES} ${CXXSOURCES} grammar.y scanner.l
99
100HEADERS=algmap.h hutil.h lists.h stairc.h attrib.h ideals.h \
101        longalg.h mpsr_Tok.h structs.h binom.h intvec.h longrat.h \
102        numbers.h stype.h clapconv.h ipconv.h maps.h page.h \
103        subexpr.h clapsing.h ipid.h matpol.h polys.h syz.h \
104        cntrlc.h ipprint.h mmemory.h ring.h timer.h \
105        febase.h ipshell.h mmprivat.h shortfl.h tok.h \
106        ffields.h khstd.h silink.h \
107        fglm.h kstd1.h modulop.h sing_dbm.h weight.h \
108        fglmvec.h kstd2.h mpsr.h sing_mp.h \
109        kstdfac.h mpsr_Get.h spolys.h \
110        kutil.h mpsr_Put.h spolys0.h
111
112TESTS=${testdir}/comparecheck ${testdir}/fac_test.in ${testdir}/fac_test.out\
113        ${testdir}/general_test.in ${testdir}/general_test.out \
114        ${testdir}/mpcheck ${testdir}/mpcheck.data
115
116DOCS=${docdir}/Makefile.in ${docdir}/copyright.tex ${docdir}/doc2tex.c \
117        ${docdir}/examples.doc ${docdir}/examples.tex ${docdir}/proc.tex \
118        ${docdir}/singular.doc ${docdir}/start.doc \
119        ${docdir}/start.tex ${docdir}/tutor.tex ${docdir}/singular.tex
120
121DISTFILES=${SOURCES} ${HEADERS} Makefile.in configure.in configure \
122        mod2.h.in grammar.h testgh install-sh mkinstalldirs \
123        ${TESTS} ${DOCS}
124
125OBJS=grammar.o scanner.o matpol.o binom.o\
126     febase.o feread.o timer.o intvec.o attrib.o lists.o\
127     longrat.o longrat0.o misc.o ring.o numbers.o maps.o\
128     hilb.o kstd1.o kstd2.o kutil.o khstd.o kstdfac.o modulop.o spolys.o\
129     ideals.o subexpr.o hdegree.o hutil.o ffields.o shortfl.o \
130     longalg.o spolys0.o syz.o syz0.o syz1.o weight.o weight0.o \
131     ipid.o ipshell.o iplib.o ipassign.o ipconv.o ipprint.o\
132     polys.o polys0.o polys1.o polys2.o extra.o\
133     mminit.o mmutil.o mmalloc.o mmallocb.o mmallocs.o \
134     mmspec.o mmblock.o mmheap.o sing_dld.o sing_dbm.o silink.o \
135     sing_mp.o fglm.o fglmzero.o fglmvec.o cntrlc.o \
136     algmap.o clapconv.o  clapmem.o clapsing.o claptmpl.o\
137     mpsr_Error.o mpsr_Put.o mpsr_PutPoly.o mpsr_GetPoly.o \
138     mpsr_Get.o mpsr_GetMisc.o
139
140##
141## PRIMARY Targets
142##
143
144
145.l.cc:
146        ${LEX} -s -I -t $< > scanner.cc
147
148.y.cc:
149        ${BISON} -d -t -o grammar.cc $<
150        chmod +x testgh
151        ./testgh
152
153.cc.o: 
154        ${CXX} ${CXXFLAGS} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFS} -c $<
155.c.o:
156        ${CC} ${CFLAGS} ${CPPFLAGS} ${DEFS} -c $<
157
158all:    Singular
159
160Singular: mod2.h Makefile version.h scanner.cc ${OBJS} iparith.o \
161                                                mpsr_Tok.o tesths.cc
162        ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${DEFS} -o Singular \
163        tesths.cc iparith.o mpsr_Tok.o ${OBJS} ${LDFLAGS} ${LIBS}
164
165iparith.o mpsr_Tok.o : iparith.inc mpsr_Tok.inc
166
167claptmpl.o: claptmpl.cc mod2.h
168        ${CXX} ${CXXFLAGS}  ${CPPFLAGS} ${DEFS} -c $<   
169
170iparith.inc mpsr_Tok.inc: iparith.cc ipconv.cc tok.h mpsr_Tok.cc grammar.h mod2.h
171        ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${DEFS} -DGENTABLE -o gentable \
172        iparith.cc tesths.cc mpsr_Tok.cc ${OBJS} ${LDFLAGS} ${LIBS}
173        ./gentable
174        /bin/rm gentable
175
176version.h: ${SOURCES} ${HEADERS} Makefile.in mod2.h.in configure.in
177        echo "#define SINGULAR_VERSION_ID " `date '+%y%m%d%H'` >version.h
178
179mod2.h: stamp-h
180
181stamp-h : config.status mod2.h.in
182        CONFIG_FILES= CONFIG_HEADERS=mod2.h ./config.status
183
184Makefile: Makefile.in config.status
185        CONFIG_FILES="Makefile" CONFIG_HEADERS= ./config.status
186
187doc/Makefile: doc/Makefile.in config.status
188        CONFIG_FILES="doc/Makefile" CONFIG_HEADERS= ./config.status
189
190config.status: configure
191        ./config.status --recheck
192
193configure: configure.in
194        @echo "WARNING: You need to rerun autoconf. I am proceeding, for now."
195        @touch configure
196#       autoconf
197
198##
199## install targets
200##
201install: all installbin installdata installinfo
202
203installbin: Singular
204        ${MKINSTALLDIRS} ${bindir}
205        ${INSTALL_PROGRAM} Singular ${bindir}
206
207installdata:
208        ${MKINSTALLDIRS} ${singulardatadir}
209        ${MKINSTALLDIRS} ${singulardatadir}/gftables
210        for file in ${srcdir}/LIB/gftables/[0-9]*; do \
211                ${INSTALL_DATA} $${file} ${singulardatadir}/gftables; \
212        done
213        for file in ${srcdir}/LIB/*.lib; do \
214                ${INSTALL_DATA} $${file} ${singulardatadir}; \
215        done
216
217installinfo:
218        cd ${docdir}; ${MAKE} install
219
220uninstall: uninstallbin uninstalldata uninstallinfo
221
222uninstallbin:
223        -rm -f ${bindir}/Singular
224        -rmdir ${bindir}
225
226uninstalldata:
227        -rm -rf ${singulardatadir}/*.lib ${singulardatadir}/gftables
228        -rmdir ${singulardatadir}
229
230unistallinfo:
231        cd ${docdir}; ${MAKE} uninstall
232
233##
234## clean targest
235##
236mostlyclean: clean
237
238clean:
239        -rm -rf Singular* *.o *.og core *.d *.dd *~ \#* /tmp/mp* \
240                *.got *dump* *.diff
241        cd ${docdir}; ${MAKE} clean
242
243distclean: clean
244        -rm -rf depend iparith.inc mpsr_Tok.inc ${DIST_NAME} ${testdir}/out stamp-h
245        -rm mod2.h Makefile TAGS* config.status config.cache config.log
246        cd ${docdir}; ${MAKE} distclean
247
248maintainer-clean: distclean
249        @echo "This command is intended for maintainers to use;"
250        @echo "Rebuilding the deleted files requires flex (version 2.3) "
251        @echo "bison and autoconf"
252        -rm configure scanner.cc grammar.h grammar.cc
253
254info dvi ps html:
255        cd ${docdir}; ${MAKE} $@
256
257check:  Singular ${testdir}/general_test.in ${testdir}/general_test.out
258        - @ SINGULARPATH=`pwd`/LIB; export SINGULARPATH; \
259        PATH=`pwd`:${PATH}; export PATH;\
260        ${testdir}/comparecheck ${testdir}/general_test.in ${testdir}/general_test.out
261        @ if test "${WITH_MP}" = yes; then ${MAKE} mpcheck; fi;
262        @ if test "${WITH_FACTORY}" = yes && test "${WITH_LIBFAC}" = yes; then \
263          ${MAKE} factorycheck;\
264        fi     
265                   
266
267mpcheck: Singular ${testdir}/mpcheck ${testdir}/mpcheck.data
268        - @ SINGULARPATH=`pwd`/LIB; export SINGULARPATH; \
269        PATH=`pwd`:${PATH}; export PATH;\
270        ${testdir}/mpcheck ${testdir}/mpcheck.data
271
272factorycheck: Singular ${testdir}/comparecheck ${testdir}/fac_test.in \
273                ${testdir}/fac_test.out
274        - @ SINGULARPATH=`pwd`/LIB; export SINGULARPATH; \
275        PATH=`pwd`:${PATH}; export PATH;\
276        ${testdir}/comparecheck ${testdir}/fac_test.in ${testdir}/fac_test.out
277       
278##
279## miscellanous targets
280##
281
282dist:
283        rm -rf ${DISTNAME}.tar* ${TEMPDIR}/${DISTNAME}*
284        mkdir ${TEMPDIR}/${DISTNAME}
285        - cp -pR . ${TEMPDIR}/${DISTNAME}
286        cd ${TEMPDIR}/${DISTNAME}; ${MAKE} distclean;
287        cd ${TEMPDIR}; tar cf ${DISTNAME}.tar ${DISTNAME}
288        rm -rf ${TEMPDIR}/${DISTNAME}
289        - gzip -9 ${TEMPDIR}/${DISTNAME}.tar
290        - mv ${TEMPDIR}/${DISTNAME}.tar.gz .
291
292TAGS:
293        etags ${SOURCES} ${HEADERS}
294
295##
296## Below here is stuff for developpers
297#################################################################
298
299##
300## compiler and linker options for debug version
301##
302
303CCG             = gcc
304CXXG            = gcc
305CXXM            = gcc -MM
306CCM             = gcc -MM
307
308CFLAGSG         = -g -Wall -Wno-unused
309CXXFLAGSG       = -g -Wall -Wno-unused
310CXXTEMPLFLAGSG  = -fno-implicit-templates
311DEFSG           = @DEFS@
312
313##
314## .og files for having -O and -g object versions available at the same time
315##
316
317OBJG1=  grammar.og scanner.og matpol.og binom.og\
318     febase.og feread.og timer.og intvec.og attrib.og lists.og\
319     longrat.og longrat0.og misc.og ring.og numbers.og maps.og\
320     hilb.og kstd1.og kstd2.og kutil.og khstd.og kstdfac.og modulop.og \
321     spolys.og ideals.og subexpr.og hdegree.og hutil.og ffields.og shortfl.og \
322     longalg.og spolys0.og syz.og syz0.og syz1.og weight.og \
323     ipid.og ipshell.og iplib.og ipassign.og ipconv.og ipprint.og\
324     polys.og polys0.og polys1.og polys2.og extra.og\
325     mminit.og sing_dld.og sing_dbm.og silink.og \
326     sing_mp.og fglm.og fglmzero.og fglmvec.og \
327     algmap.og clapconv.og  clapmem.og clapsing.og \
328     cntrlc.og  \
329     mpsr_Error.og mpsr_Put.og mpsr_PutPoly.og mpsr_GetPoly.og \
330     mpsr_Get.og mpsr_GetMisc.og
331
332OBJG2= mmalloc.og mmallocb.og mmallocs.og mmblock.og mmheap.og \
333     mmspec.og mmutil.og weight0.og
334
335OBJG=$(OBJG1) $(OBJG2) claptmpl.og
336
337##
338## Debug Targets
339##
340
341claptmpl.og: claptmpl.cc mod2.h
342        $(CXXG)  ${CXXFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
343$(OBJG1): %.og: %.cc
344        $(CXXG) ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
345
346$(OBJG2): %.og: %.c
347        $(CCG)  ${CFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
348
349Singularg: scanner.cc $(OBJG) iparith.og mpsr_Tok.og tesths.cc version.h
350        $(CXXG) ${CXXFLAGSG} ${CPPFLAGS} ${DEFSG} -o Singularg \
351        tesths.cc iparith.og mpsr_Tok.og $(OBJG) ${LDFLAGS} ${LIBS}
352
353iparith.og: iparith.inc iparith.cc
354        $(CXXG)  ${CXXFLAGSG} ${CPPFLAGS} ${DEFSG} -c iparith.cc -o iparith.og
355
356mpsr_Tok.og: iparith.inc mpsr_Tok.cc
357        $(CXXG) ${CXXFLAGSG} ${CPPFLAGS} ${DEFSG} -c mpsr_Tok.cc -o mpsr_Tok.og
358
359installg: Singularg
360        ${MKINSTALLDIRS} ${bindir}
361        ${INSTALL_PROGRAM} Singularg ${bindir} 
362
363
364##
365## dependencies
366##
367       
368%.dd: %.cc mod2.h
369        echo $@ $(@:.dd=.og) " " \\ > $@
370        $(CXXM) -DGENTABLE ${CPPFLAGS} ${DEFSG} $< >> $@
371
372%.d: %.c mod2.h
373        echo $@ $(@:.d=.og) " " \\ > $@
374        $(CCM) ${CPPFLAGS} ${DEFSG} $< >> $@
375
376depend: $(CXXSOURCES:.cc=.dd) $(CSOURCES:.c=.d) mod2.h
377        cat *.d *.dd >depend
378
379#include $(SOURCES:.cc=.dd) $(CSOURCES:.c=.d)
380#include *.d *.dd
381ifeq (depend,$(wildcard depend))
382include depend
383endif
384
385
Note: See TracBrowser for help on using the repository browser.