1 | ################################################################# |
---|
2 | ### |
---|
3 | ### Makefile for Singular-modules |
---|
4 | ### |
---|
5 | ### |
---|
6 | ################################################################# |
---|
7 | |
---|
8 | SHELL = /bin/sh |
---|
9 | |
---|
10 | ## |
---|
11 | ## various paths |
---|
12 | ## |
---|
13 | topsrcdir = @top_srcdir@ |
---|
14 | srcdir = @srcdir@ |
---|
15 | prefix = @prefix@ |
---|
16 | exec_prefix = @exec_prefix@ |
---|
17 | libdir = @libdir@ |
---|
18 | # program executable goes here |
---|
19 | bindir = @bindir@ |
---|
20 | install_bindir = @bindir@ |
---|
21 | # Singular libs go here |
---|
22 | includedir = @includedir@ |
---|
23 | INC_SRC = ${topsrcdir}/Singular |
---|
24 | SINGUNAME = @SINGUNAME@ |
---|
25 | install_bindir = ${install_prefix}/${SINGUNAME}/MOD |
---|
26 | |
---|
27 | ## |
---|
28 | ## various programs |
---|
29 | ## |
---|
30 | CC = @CC@ |
---|
31 | CXX = @CXX@ |
---|
32 | #LEXP = @LEXP@ |
---|
33 | PERL = @PERL@ |
---|
34 | BISON = bison |
---|
35 | @SET_MAKE@ |
---|
36 | MKINSTALLDIRS = ./mkinstalldirs |
---|
37 | MODGEN = ${srcdir}/modgen/modgen |
---|
38 | |
---|
39 | ## |
---|
40 | ## compiler and linker options |
---|
41 | ## |
---|
42 | CFLAGS = @CFLAGS@ -pipe -I${srcdir} -I${INC_SRC} |
---|
43 | CXXFLAGS = @CXXFLAGS@ -pipe |
---|
44 | #CXXTEMPLFLAGS = @CXXTEMPLFLAGS@ |
---|
45 | CPPFLAGS = -I${srcdir} @CPPFLAGS@ -I${includedir} -I${INC_SRC} |
---|
46 | DEFS = @DEFS@ -DNDEBUG |
---|
47 | LDFLAGS = @LDFLAGS@ # @LD_DYNAMIC@ |
---|
48 | #STATIC_LDFLAGS = @STATIC_LDFLAGS@ |
---|
49 | #LIBS = @NEED_LIBS@ |
---|
50 | |
---|
51 | ## |
---|
52 | ## End configuration dependend stuff |
---|
53 | ################################################################# |
---|
54 | ## |
---|
55 | ## compiler and linker options |
---|
56 | ## |
---|
57 | CFLAGS += ${DEFS} |
---|
58 | |
---|
59 | #ifndef ix86-Win |
---|
60 | MOD_FILES = loctriv |
---|
61 | #MOD_DIRS = kernel |
---|
62 | MOD_DIRS = |
---|
63 | #else |
---|
64 | MOD_FILES = |
---|
65 | MOD_DIRS = |
---|
66 | #endif |
---|
67 | |
---|
68 | ## |
---|
69 | ## |
---|
70 | ## |
---|
71 | |
---|
72 | all: modgen mod_prepare modules |
---|
73 | |
---|
74 | mod_prepare: modgen/modgen |
---|
75 | for file in ${MOD_FILES}; do \ |
---|
76 | if test -d $${file}; then \ |
---|
77 | echo Directory $${file} exists! Ignoring $${file}; \ |
---|
78 | echo Use make mod_clean or remove directory by hand; \ |
---|
79 | elif test -f $${file}.mod; then \ |
---|
80 | ${MODGEN} $${file}.mod >$${file}.log ;\ |
---|
81 | fi; \ |
---|
82 | done |
---|
83 | |
---|
84 | modgen/modgen: |
---|
85 | cd modgen; ${MAKE} install |
---|
86 | |
---|
87 | modules: mod_prepare |
---|
88 | for SUBDIR in ${MOD_DIRS} ${MOD_FILES}; \ |
---|
89 | do \ |
---|
90 | if test -d $${SUBDIR}; then \ |
---|
91 | echo ${MAKE} $@ in $${SUBDIR}; \ |
---|
92 | ( cd $${SUBDIR} && ${MAKE} ;) \ |
---|
93 | fi;\ |
---|
94 | if test ! -d $${SUBDIR}; then \ |
---|
95 | echo directory $${SUBDIR} does not exist!; \ |
---|
96 | fi;\ |
---|
97 | done |
---|
98 | |
---|
99 | clean: |
---|
100 | rm -f *.o *.lo *.so* *.la *~ core |
---|
101 | ( cd modgen && ${MAKE} $@; ) |
---|
102 | for SUBDIR in ${MOD_DIRS} ${MOD_FILES}; \ |
---|
103 | do \ |
---|
104 | if test -d $${SUBDIR}; then \ |
---|
105 | echo ${MAKE} $@ in $${SUBDIR}; \ |
---|
106 | if [ -e "$${SUBDIR}/Makefile" ]; then (cd $${SUBDIR}; $(MAKE) $@) fi \ |
---|
107 | fi; \ |
---|
108 | done |
---|
109 | |
---|
110 | mod_clean: |
---|
111 | for SUBDIR in ${MOD_FILES}; \ |
---|
112 | do \ |
---|
113 | if test -d $${SUBDIR}; then \ |
---|
114 | echo removing $${SUBDIR};\ |
---|
115 | rm -rf $${SUBDIR}; \ |
---|
116 | fi; \ |
---|
117 | done |
---|
118 | |
---|
119 | for SUBDIR in ${MOD_DIRS}; \ |
---|
120 | do \ |
---|
121 | if test -d $${SUBDIR}; then \ |
---|
122 | echo ${MAKE} clean in $${SUBDIR}; \ |
---|
123 | if [ -e "$${SUBDIR}/Makefile" ]; then (cd $${SUBDIR}; $(MAKE) clean;) fi \ |
---|
124 | fi; \ |
---|
125 | done |
---|
126 | |
---|
127 | distclean: clean mod_clean |
---|
128 | ( cd modgen && ${MAKE} clean ) |
---|
129 | for SUBDIR in ${MOD_DIRS}; \ |
---|
130 | do \ |
---|
131 | echo ${MAKE} $@ in $${SUBDIR}; \ |
---|
132 | if [ -e "$${SUBDIR}/Makefile" ]; then (cd $${SUBDIR}; $(MAKE) clean;) fi \ |
---|
133 | done |
---|
134 | rm -f Makefile |
---|
135 | |
---|
136 | install bindist: all |
---|
137 | (cd modgen; ${MAKE} $@) |
---|
138 | for SUBDIR in ${MOD_DIRS} ${MOD_FILES}; \ |
---|
139 | do \ |
---|
140 | echo ${MAKE} $@ in $${SUBDIR}; \ |
---|
141 | ( cd $${SUBDIR} && ${MAKE} $@;) || true; \ |
---|
142 | done |
---|
143 | |
---|
144 | install_all: install |
---|
145 | |
---|
146 | install-bindist: all |
---|
147 | (cd modgen; ${MAKE} install_bindir=${install_bindir} $@) |
---|
148 | for SUBDIR in ${MOD_DIRS} ${MOD_FILES}; \ |
---|
149 | do \ |
---|
150 | echo ${MAKE} install_bindir=${install_bindir} $@ in $${SUBDIR}; \ |
---|
151 | ( cd $${SUBDIR} && ${MAKE} install_bindir=${install_bindir} $@;)|| true ;\ |
---|
152 | done |
---|
153 | |
---|
154 | depend: |
---|
155 | @echo "No make depend available!" |
---|