source: git/modules/modgen/Makefile.in @ d47e6f

spielwiese
Last change on this file since d47e6f was d47e6f, checked in by Kai Krüger <krueger@…>, 24 years ago
Added new version of Module-generator git-svn-id: file:///usr/local/Singular/svn/trunk@3904 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 2.7 KB
Line 
1#
2#
3#
4topsrcdir       = @top_srcdir@
5srcdir          = @srcdir@
6prefix          = @prefix@
7exec_prefix     = @exec_prefix@
8libdir          = @libdir@
9# program executable goes here
10bindir          = @bindir@
11# Singular libs go here
12includedir      = @includedir@
13MOD_DEST        = ./include
14INC_SRC         = $(topsrcdir)/Singular
15
16SINGUNAME       = @SINGUNAME@
17SING_UNAME      = @SING_UNAME@
18SINGULAR_VERSION = @SINGULAR_VERSION@
19S_VERSION       = $${SINGULAR_VERSION-@SINGULAR_VERSION@}
20DISTROOT_NAME   = Singular-${S_VERSION}
21BINDIST_NAME    = ${DISTROOT_NAME}-${SINGUNAME}
22SHAREDIST_NAME  = ${DISTROOT_NAME}-share
23MKINSTALLDIRS   = $(topsrcdir)/Singular/mkinstalldirs
24LN_S            = @LN_S@
25INSTALL         = $(topsrcdir)/Singular/install-sh -c
26INSTALL_PROGRAM = ${INSTALL}
27INSTALL_DATA    = ${INSTALL} -m 644
28MODGEN          = $(bindir)/modgen
29BISON           = bison
30
31CFLAGS  += -g -I../include -I../../Singular -DNDEBUG -DMODULE_GENERATOR \
32        -D${SING_UNAME}
33LIBS    += -L/usr/local/lib -lgmp
34
35OBJS    = main.o grammar.o scanner.o misc.o makefile.o utils.o \
36        creat_top.o
37
38#       iparith.o febase.o \
39#       mmalloc.o mmallocb.o mminit.o mmutil.o mmblock.o mmspec.o
40
41# subexpr.o
42
43all     = modgen
44
45.cc.o:
46        gcc -c ${CFLAGS} $<
47
48.c.o:
49        gcc -c ${CFLAGS} $<
50
51all: modgen
52
53pathnames.h:
54        echo "/*" > pathnames.h
55        echo " *" >> pathnames.h
56        echo " */" >> pathnames.h
57        echo "" >> pathnames.h
58        echo "#define TOPSRCDIR \"$(topsrcdir)\"" >> pathnames.h
59        echo "#define LIBDIR    \"$(libdir)\"" >> pathnames.h
60
61modgen: ${OBJS} modgen.h decl.inc typmap.h pathnames.h stype.h
62        gcc -o $@ ${CFLAGS} ${OBJS} ${LIBS}
63
64scanner.cc: scanner.l grammar.h modgen.h
65        flex -oscanner.cc scanner.l
66
67#       flex -Pyymod -oscanner.cc scanner.l
68
69clean:
70        rm -f a.out *~ scanner.cc *.o core modgen
71        rm -f pathnames.h
72
73install: modgen
74        ${MKINSTALLDIRS} ${bindir}
75        ${INSTALL_PROGRAM} modgen ${bindir}/modgen-${SINGULAR_VERSION}
76        rm -f ${bindir}/modgen
77        cd ${bindir}; ${LN_S} modgen-${SINGULAR_VERSION} modgen;\
78        if test ! -x ${MODGEN}; then \
79                ${LN_S} modgen-${SINGULAR_VERSION} ${MODGEN};\
80        fi
81
82
83#
84#
85#
86test:   modgen
87        rm -rf tmp
88        mkdir tmp
89        ./modgen ../kernel/kernel.mod
90
91#
92#
93#
94decl.inc: ../../Singular/grammar.h ../../Singular/tok.h
95        -echo "/* declaration for modgen.cc */" > $@
96        -grep "^#define" ../../Singular/grammar.h | awk \
97                '{print "\tcase "$$2": strcpy(name,\""$$2"\"); break;"}' >> $@
98        -echo "" >> $@
99        -echo "/* declaration from tok.h */" >> $@
100        -grep "^  [A-Z_]*," ../../Singular/tok.h | sed "s/,//g" | awk \
101                '{print "\tcase "$$1": strcpy(name,\""$$1"\"); break;"}'>>$@
102
103.y.cc:
104        @if test "x${BISON}" = x; then \
105                echo Error: no bison given, could not rebuilt grammar.cc;\
106                exit 1; \
107        fi
108        ${BISON} -d -t -o grammar.cc $<
109        mv grammar.cc.h grammar.h
110
111makefile.cc:    pathnames.h
112misc.cc:        modgen.h
113utils.cc:       modgen.h
114grammar.cc:     grammar.y
115grammar.h:      grammar.y
Note: See TracBrowser for help on using the repository browser.