source: git/Singular/Makefile.in @ dc32d42

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