source: git/Singular/Makefile.in @ ca7a56

fieker-DuValspielwiese
Last change on this file since ca7a56 was f4404c, checked in by Kai Krüger <krueger@…>, 26 years ago
fixed use of correct Singular during checks git-svn-id: file:///usr/local/Singular/svn/trunk@1032 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 14.2 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@ -pipe
46CXXFLAGS        = @CXXFLAGS@ -pipe
47CXXTEMPLFLAGS   = @CXXTEMPLFLAGS@
48CPPFLAGS        = -I${srcdir} @CPPFLAGS@
49DEFS            = @DEFS@ -DNDEBUG
50LDFLAGS         = @LDFLAGS@
51STATIC_LDFLAGS  = @STATIC_LDFLAGS@
52LIBS            = @NEED_LIBS@
53
54##
55## subdirectories
56##
57# where the doumentation files are
58docdir          = doc
59# where the tests files are
60testdir         = tests
61
62##
63## the configuration
64##
65WITH_MP         = @WITH_MP@
66WITH_FACTORY    = @WITH_FACTORY@
67WITH_LIBFAC     = @WITH_LIBFAC@
68WITH_DBM        = @WITH_DBM@
69DOS_CROSS       = @DOS_CROSS@
70
71##
72## End configuration dependend stuff
73#################################################################
74
75###
76### file sets
77###
78
79CXXSOURCES=grammar.cc scanner.cc algmap.cc attrib.cc binom.cc clapconv.cc \
80    clapmem.cc clapsing.cc claptmpl.cc cntrlc.cc \
81    extra.cc febase.cc feread.cc \
82    ffields.cc hdegree.cc hilb.cc hutil.cc \
83    ideals.cc intvec.cc iparith.cc \
84    ipassign.cc ipconv.cc ipid.cc iplib.cc \
85    ipprint.cc ipshell.cc khstd.cc kstdfac.cc \
86    comm.cc kstd1.cc kstd2.cc kutil.cc lists.cc \
87    longalg.cc longrat.cc \
88    longrat0.cc maps.cc matpol.cc misc.cc \
89    mminit.cc modulop.cc \
90    fglm.cc fglmzero.cc fglmvec.cc fglmgauss.cc fglmhom.cc \
91    numbers.cc polys.cc polys0.cc polys1.cc polys-impl.cc \
92    ring.cc shortfl.cc silink.cc sing_mp.cc\
93    sing_dld.cc sing_dbm.cc spolys.cc spolys0.cc \
94    subexpr.cc syz.cc syz0.cc syz1.cc \
95    tesths.cc timer.cc weight.cc \
96    mpsr_Put.cc mpsr_PutPoly.cc mpsr_Tok.cc mpsr_GetPoly.cc \
97    mpsr_Get.cc mpsr_GetMisc.cc mpsr_Error.cc \
98    ndbm.cc spSpolyLoop.cc
99
100CSOURCES=mmalloc.c mmallocb.c mmallocs.c mmblock.c mmheap.c mmspec.c mmutil.c weight0.c
101
102SOURCES=${CSOURCES} ${CXXSOURCES} grammar.y scanner.l
103
104HEADERS=algmap.h hutil.h lists.h stairc.h attrib.h ideals.h \
105        longalg.h mpsr_Tok.h structs.h binom.h intvec.h longrat.h \
106        numbers.h stype.h clapconv.h ipconv.h maps.h page.h \
107        subexpr.h clapsing.h ipid.h matpol.h polys.h syz.h \
108        cntrlc.h ipprint.h mmemory.h ring.h timer.h \
109        febase.h ipshell.h mmprivat.h shortfl.h tok.h \
110        ffields.h khstd.h silink.h \
111        fglm.h comm.h kstd1.h modulop.h sing_dbm.h weight.h \
112        fglmgauss.h fglmvec.h kstd2.h mpsr.h sing_mp.h \
113        kstdfac.h mpsr_Get.h spolys.h \
114        kutil.h mpsr_Put.h spolys0.h \
115        ndbm.h spSpolyLoop.h polys-impl.h polys-comp.h
116
117TESTS=${testdir}/comparecheck ${testdir}/fac_test.in ${testdir}/fac_test.out\
118        ${testdir}/general_test.in ${testdir}/general_test.out \
119        ${testdir}/mpcheck ${testdir}/mpcheck.data \
120        ${testdir}/dbm_test.in ${testdir}/dbm_test.out
121
122DOCS=${docdir}/Makefile.in ${docdir}/copyright.tex ${docdir}/doc2tex.c \
123        ${docdir}/examples.doc ${docdir}/examples.tex ${docdir}/proc.tex \
124        ${docdir}/singular.doc ${docdir}/start.doc \
125        ${docdir}/start.tex ${docdir}/tutor.tex ${docdir}/singular.tex
126
127DISTFILES=${SOURCES} ${HEADERS} Makefile.in configure.in configure \
128        mod2.h.in grammar.h testgh install-sh mkinstalldirs \
129        ${TESTS} ${DOCS}
130
131OBJS=grammar.o scanner.o matpol.o binom.o\
132     febase.o feread.o timer.o intvec.o attrib.o lists.o\
133     longrat.o longrat0.o misc.o ring.o numbers.o maps.o\
134     hilb.o comm.o kstd1.o kstd2.o kutil.o khstd.o kstdfac.o modulop.o spolys.o\
135     ideals.o subexpr.o hdegree.o hutil.o ffields.o shortfl.o \
136     longalg.o spolys0.o syz.o syz0.o syz1.o weight.o weight0.o \
137     ipid.o ipshell.o iplib.o ipassign.o ipconv.o ipprint.o\
138     polys.o polys0.o polys1.o polys-impl.o extra.o\
139     mminit.o mmutil.o mmalloc.o mmallocb.o mmallocs.o \
140     mmspec.o mmblock.o mmheap.o sing_dld.o sing_dbm.o silink.o \
141     sing_mp.o fglm.o fglmzero.o fglmvec.o fglmhom.o fglmgauss.o cntrlc.o \
142     algmap.o clapconv.o  clapmem.o clapsing.o claptmpl.o\
143     mpsr_Error.o mpsr_Put.o mpsr_PutPoly.o mpsr_GetPoly.o \
144     mpsr_Get.o mpsr_GetMisc.o ndbm.o spSpolyLoop.o
145
146##
147## PRIMARY Targets
148##
149
150
151.l.cc:
152        ${LEX} -s -I -t $< > scanner.cc
153
154.y.cc:
155        ${BISON} -d -t -o grammar.cc $<
156        chmod +x testgh
157        ./testgh
158
159.cc.o: 
160        ${CXX} ${CXXFLAGS} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFS} -c $<
161.c.o:
162        ${CC} ${CFLAGS} ${CPPFLAGS} ${DEFS} -c $<
163
164all:    Singular
165
166Singular: mod2.h Makefile version.h scanner.cc ${OBJS} iparith.o \
167                                                mpsr_Tok.o tesths.cc
168        ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${DEFS} -o Singular \
169        tesths.cc iparith.o mpsr_Tok.o ${OBJS} ${LDFLAGS} ${LIBS}
170
171Singular-static: mod2.h Makefile version.h scanner.cc ${OBJS} iparith.o \
172                                                mpsr_Tok.o tesths.cc
173        ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${DEFS} -o Singular-static \
174        tesths.cc iparith.o mpsr_Tok.o \
175        ${OBJS} ${STATIC_LDFLAGS} ${LDFLAGS} ${LIBS}
176
177iparith.o mpsr_Tok.o : iparith.inc mpsr_Tok.inc
178
179claptmpl.o: claptmpl.cc mod2.h
180        ${CXX} ${CXXFLAGS}  ${CPPFLAGS} ${DEFS} -c $<   
181
182iparith.inc mpsr_Tok.inc: iparith.cc ipconv.cc tok.h mpsr_Tok.cc grammar.h mod2.h
183        @if test "${DOS_CROSS}" = yes; then \
184                echo "NEED TO GENERATE inc FILES -- Please be patient" ;\
185                cd ..; \
186                ./configure.dos --generate-inc; \
187        else \
188                echo ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${DEFS} -DGENTABLE \
189                     -o gentable iparith.cc tesths.cc mpsr_Tok.cc \
190                     ${OBJS} ${LDFLAGS} ${LIBS};\
191                ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${DEFS} -DGENTABLE \
192                     -o gentable iparith.cc tesths.cc mpsr_Tok.cc \
193                     ${OBJS} ${LDFLAGS} ${LIBS};\
194                echo ./gentable; \
195                ./gentable; \
196                echo /bin/rm gentable;\
197                /bin/rm gentable; \
198        fi
199
200version.h: ${SOURCES} ${HEADERS} Makefile.in mod2.h.in configure.in
201        echo "#define SINGULAR_VERSION_ID " `date '+%y%m%d%H'` >version.h
202
203mod2.h: stamp-h
204
205stamp-h : config.status mod2.h.in
206        CONFIG_FILES= CONFIG_HEADERS=mod2.h ./config.status
207
208Makefile: Makefile.in config.status
209        CONFIG_FILES="Makefile" CONFIG_HEADERS= ./config.status
210
211doc/Makefile: doc/Makefile.in config.status
212        CONFIG_FILES="doc/Makefile" CONFIG_HEADERS= ./config.status
213
214config.status: configure
215        ./config.status --recheck
216
217configure: configure.in
218        @echo "WARNING: You need to rerun autoconf. I am proceeding, for now."
219        @touch configure
220#       autoconf
221
222##
223## install targets
224##
225install: all installbin installdata installinfo
226
227installbin: Singular
228        ${MKINSTALLDIRS} ${bindir}
229        ${INSTALL_PROGRAM} Singular ${bindir}
230
231installdata:
232        ${MKINSTALLDIRS} ${singulardatadir}
233        ${MKINSTALLDIRS} ${singulardatadir}/gftables
234        for file in ${srcdir}/LIB/gftables/[0-9]*; do \
235                ${INSTALL_DATA} $${file} ${singulardatadir}/gftables; \
236        done
237        for file in ${srcdir}/LIB/*.lib; do \
238                ${INSTALL_DATA} $${file} ${singulardatadir}; \
239        done
240
241installinfo:
242        cd ${docdir}; ${MAKE} install
243
244uninstall: uninstallbin uninstalldata uninstallinfo
245
246uninstallbin:
247        -rm -f ${bindir}/Singular
248        -rmdir ${bindir}
249
250uninstalldata:
251        -rm -rf ${singulardatadir}/*.lib ${singulardatadir}/gftables
252        -rmdir ${singulardatadir}
253
254unistallinfo:
255        cd ${docdir}; ${MAKE} uninstall
256
257##
258## clean targest
259##
260mostlyclean: clean
261
262clean:
263        -rm -rf Singular* *.o *.og core *.d *.dd *~ \#* /tmp/mp* \
264                *.got *dump* *.diff *.dir *.pag
265        cd ${docdir}; ${MAKE} clean
266
267distclean: clean
268        -rm -rf depend iparith.inc mpsr_Tok.inc ${DIST_NAME} ${testdir}/out stamp-h
269        -rm mod2.h Makefile TAGS* config.status config.cache config.log
270        cd ${docdir}; ${MAKE} distclean
271
272maintainer-clean: distclean
273        @echo "This command is intended for maintainers to use;"
274        @echo "Rebuilding the deleted files requires flex (version 2.3) "
275        @echo "bison and autoconf"
276        -rm configure scanner.cc grammar.h grammar.cc
277
278info dvi ps html:
279        cd ${docdir}; ${MAKE} $@
280
281check:  Singular ${testdir}/general_test.in ${testdir}/general_test.out
282        - @ SINGULARPATH=`pwd`/LIB; export SINGULARPATH; \
283        PATH=`pwd`:${PATH}; export PATH;\
284        Singular=`pwd`/Singular; export Singular;\
285        ${testdir}/comparecheck ${testdir}/general_test.in ${testdir}/general_test.out
286        @ if test "${WITH_MP}" = yes; then ${MAKE} mpcheck; fi;
287        @ if test "${WITH_FACTORY}" = yes && test "${WITH_LIBFAC}" = yes; then \
288          ${MAKE} factorycheck;\
289        fi
290        @ if test "${WITH_DBM}" = yes; then ${MAKE} dbmcheck; fi
291
292
293mpcheck: Singular ${testdir}/mpcheck ${testdir}/mpcheck.data
294        - @ SINGULARPATH=`pwd`/LIB; export SINGULARPATH; \
295        PATH=`pwd`:${PATH}; export PATH;\
296        Singular=`pwd`/Singular; export Singular;\
297        ${testdir}/mpcheck ${testdir}/mpcheck.data
298
299factorycheck: Singular ${testdir}/comparecheck ${testdir}/fac_test.in \
300                ${testdir}/fac_test.out
301        - @ SINGULARPATH=`pwd`/LIB; export SINGULARPATH; \
302        PATH=`pwd`:${PATH}; export PATH;\
303        Singular=`pwd`/Singular; export Singular;\
304        ${testdir}/comparecheck ${testdir}/fac_test.in ${testdir}/fac_test.out
305
306dbmcheck: Singular ${testdir}/comparecheck ${testdir}/dbm_test.in \
307                ${testdir}/dbm_test.out
308        - @ SINGULARPATH=`pwd`/LIB; export SINGULARPATH; \
309        PATH=`pwd`:${PATH}; export PATH;\
310        Singular=`pwd`/Singular; export Singular;\
311        ${testdir}/comparecheck ${testdir}/dbm_test.in ${testdir}/dbm_test.out
312
313
314##
315## miscellanous targets
316##
317
318dist:
319        rm -rf ${DISTNAME}.tar* ${TEMPDIR}/${DISTNAME}*
320        mkdir ${TEMPDIR}/${DISTNAME}
321        - cp -pR . ${TEMPDIR}/${DISTNAME}
322        cd ${TEMPDIR}/${DISTNAME}; ${MAKE} distclean;
323        cd ${TEMPDIR}; tar cf ${DISTNAME}.tar ${DISTNAME}
324        rm -rf ${TEMPDIR}/${DISTNAME}
325        - gzip -9 ${TEMPDIR}/${DISTNAME}.tar
326        - mv ${TEMPDIR}/${DISTNAME}.tar.gz .
327
328TAGS:
329        etags ${SOURCES} ${HEADERS}
330
331##
332## Below here is stuff for developpers
333#################################################################
334
335##
336## compiler and linker options for debug version
337##
338
339CCG             = gcc
340CXXG            = gcc
341CXXM            = gcc -MM
342CCM             = gcc -MM
343
344CFLAGSG         = -g -Wall -Wno-unused -pipe
345CXXFLAGSG       = -g -Wall -Wno-unused -pipe
346CXXTEMPLFLAGSG  = -fno-implicit-templates
347DEFSG           = @DEFS@
348
349##
350## .og files for having -O and -g object versions available at the same time
351##
352
353OBJG1=  grammar.og scanner.og matpol.og binom.og\
354     febase.og feread.og timer.og intvec.og attrib.og lists.og\
355     longrat.og longrat0.og misc.og ring.og numbers.og maps.og\
356     hilb.og comm.og kstd1.og kstd2.og kutil.og khstd.og kstdfac.og modulop.og \
357     spolys.og ideals.og subexpr.og hdegree.og hutil.og ffields.og shortfl.og \
358     longalg.og spolys0.og syz.og syz0.og syz1.og weight.og \
359     ipid.og ipshell.og iplib.og ipassign.og ipconv.og ipprint.og\
360     polys.og polys0.og polys1.og polys-impl.og extra.og\
361     mminit.og sing_dld.og sing_dbm.og silink.og \
362     sing_mp.og fglm.og fglmzero.og fglmvec.og fglmgauss.og fglmhom.og\
363     algmap.og clapconv.og  clapmem.og clapsing.og \
364     cntrlc.og  \
365     mpsr_Error.og mpsr_Put.og mpsr_PutPoly.og mpsr_GetPoly.og \
366     mpsr_Get.og mpsr_GetMisc.og \
367     ndbm.og spSpolyLoop.og
368
369OBJG2= mmalloc.og mmallocb.og mmallocs.og mmblock.og mmheap.og \
370     mmspec.og mmutil.og weight0.og
371
372OBJG=$(OBJG1) $(OBJG2) claptmpl.og
373
374##
375## Debug Targets
376##
377
378claptmpl.og: claptmpl.cc mod2.h
379        $(CXXG)  ${CXXFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
380$(OBJG1): %.og: %.cc
381        $(CXXG) ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
382
383$(OBJG2): %.og: %.c
384        $(CCG)  ${CFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
385
386Singularg: scanner.cc $(OBJG) iparith.og mpsr_Tok.og tesths.cc version.h
387        $(CXXG) ${CXXFLAGSG} ${CPPFLAGS} ${DEFSG} -o Singularg \
388        tesths.cc iparith.og mpsr_Tok.og $(OBJG) ${LDFLAGS} ${LIBS}
389
390iparith.og: iparith.inc iparith.cc
391        $(CXXG)  ${CXXFLAGSG} ${CPPFLAGS} ${DEFSG} -c iparith.cc -o iparith.og
392
393mpsr_Tok.og: iparith.inc mpsr_Tok.cc
394        $(CXXG) ${CXXFLAGSG} ${CPPFLAGS} ${DEFSG} -c mpsr_Tok.cc -o mpsr_Tok.og
395
396installg: Singularg
397        ${MKINSTALLDIRS} ${bindir}
398        ${INSTALL_PROGRAM} Singularg ${bindir} 
399
400##
401## compiler and linker options for profile version
402##
403
404CCP             = gcc
405CXXP            = gcc
406
407CFLAGSP         = -pg -O3 -pipe 
408CXXFLAGSP       = -pg -O3 -pipe
409CXXTEMPLFLAGSP  = -fno-implicit-templates
410DEFSP           = @DEFS@ -DNDEBUG -DDO_PROFILE
411LDFLAGSP        = -static @LDFLAGS@
412
413##
414## .op files for
415##
416
417OBJP1=  grammar.op scanner.op matpol.op binom.op\
418     febase.op feread.op timer.op intvec.op attrib.op lists.op\
419     longrat.op longrat0.op misc.op ring.op numbers.op maps.op\
420     hilb.op comm.op kstd1.op kstd2.op kutil.op khstd.op kstdfac.op modulop.op \
421     spolys.op ideals.op subexpr.op hdegree.op hutil.op ffields.op shortfl.op \
422     longalg.op spolys0.op syz.op syz0.op syz1.op weight.op \
423     ipid.op ipshell.op iplib.op ipassign.op ipconv.op ipprint.op\
424     polys.op polys0.op polys1.op polys-impl.op extra.op\
425     mminit.op sing_dld.op sing_dbm.op silink.op \
426     sing_mp.op fglm.op fglmzero.op fglmvec.op fglmgauss.op fglmhom.op\
427     algmap.op clapconv.op  clapmem.op clapsing.op \
428     cntrlc.op  \
429     mpsr_Error.op mpsr_Put.op mpsr_PutPoly.op mpsr_GetPoly.op \
430     mpsr_Get.op mpsr_GetMisc.op \
431     ndbm.op spSpolyLoop.op
432
433OBJP2= mmalloc.op mmallocb.op mmallocs.op mmblock.op mmheap.op \
434     mmspec.op mmutil.op weight0.op
435
436OBJP=$(OBJP1) $(OBJP2) claptmpl.op
437
438##
439## Debug Targets
440##
441
442claptmpl.op: claptmpl.cc mod2.h
443        $(CXXP)  ${CXXFLAGSP} ${CPPFLAGS} ${DEFSP} -c $< -o $@
444$(OBJP1): %.op: %.cc
445        $(CXXP) ${CXXFLAGSP} ${CXXTEMPLFLAGSP} ${CPPFLAGS} ${DEFSP} -c $< -o $@
446
447$(OBJP2): %.op: %.c
448        $(CCP)  ${CFLAGSP} ${CPPFLAGS} ${DEFSP} -c $< -o $@
449
450Singularp: scanner.cc $(OBJP) iparith.op mpsr_Tok.op tesths.cc version.h
451        $(CXXP) ${CXXFLAGSP} ${CPPFLAGS} ${DEFSP} -o Singularp \
452        tesths.cc iparith.op mpsr_Tok.op $(OBJP) ${LDFLAGSP} ${LIBS}
453
454iparith.op: iparith.inc iparith.cc
455        $(CXXP)  ${CXXFLAGSP} ${CPPFLAGS} ${DEFSP} -c iparith.cc -o iparith.op
456
457mpsr_Tok.op: iparith.inc mpsr_Tok.cc
458        $(CXXP) ${CXXFLAGSP} ${CPPFLAGS} ${DEFSP} -c mpsr_Tok.cc -o mpsr_Tok.op
459
460installp: Singularp
461        ${MKINSTALLDIRS} ${bindir}
462        ${INSTALL_PROGRAM} Singularp ${bindir} 
463
464
465##
466## dependencies
467##
468%.dd: %.cc mod2.h
469        echo $(@:.dd=.og) $(@:.dd=.op) " " \\ > $@
470        $(CXXM) -DGENTABLE ${CPPFLAGS} ${DEFSG} $< >> $@
471
472%.d: %.c mod2.h
473        echo $(@:.d=.og) $(@:.d=.op) " " \\ > $@
474        $(CCM) ${CPPFLAGS} ${DEFSG} $< >> $@
475
476depend: $(CXXSOURCES:.cc=.dd) $(CSOURCES:.c=.d) mod2.h
477        cat *.d *.dd >depend
478
479#include $(SOURCES:.cc=.dd) $(CSOURCES:.c=.d)
480#include *.d *.dd
481ifeq (depend,$(wildcard depend))
482include depend
483endif
484
485
Note: See TracBrowser for help on using the repository browser.