Extend exported interface to what we need in common use cases
[cl-cudd.git] / distr / Makefile
blobd931d8cae81a05b051e4bd88b2ae6c6d639132be
1 # $Id$
3 # Makefile for the CUDD distribution kit
4 #---------------------------------------------------------------------------
6 # Beginning of the configuration section. These symbol definitions can
7 # be overridden from the command line.
9 # C++ compiler
10 CPP = g++
11 #CPP = icpc
12 #CPP = ecpc
13 #CPP = CC
14 #CPP = /usr/local/opt/SUNWspro/bin/CC
15 #CPP = cxx
17 # Specific options for compilation of C++ files.
18 CPPFLAGS =
19 # Stricter standard conformance for g++.
20 #CPPFLAGS = -std=c++98
21 # For Sun CC version 5, this invokes compatibility mode.
22 #CPPFLAGS = -compat
23 # On some versions of UP-UX, it is necessary to pass the option +a1
24 # to CC for the C++ test program to compile successfully.
25 #CPPFLAGS = +a1
27 # C compiler used for all targets except optimize_dec, which always uses cc.
28 #CC = cc
29 #CC = /usr/local/opt/SUNWspro/bin/cc
30 CC = gcc
31 #CC = icc
32 #CC = ecc
33 #CC = /usr/ucb/cc
34 #CC = c89
35 #CC = $(CPP)
37 # On some machines ranlib is either non-existent or redundant.
38 # Use the following definition if your machine has ranlib and you think
39 # it is needed.
40 RANLIB = ranlib
41 # Use the following definition if your machine either does not have
42 # ranlib (e.g., SUN running solaris) or can do without it (e.g., DEC Alpha).
43 #RANLIB = :
45 # Use ICFLAGS to specify machine-independent compilation flags.
46 # These three are typical settings for cc.
47 #ICFLAGS = -g
48 #ICFLAGS = -O
49 #ICFLAGS =
50 # These four are typical settings for optimized code with gcc. The
51 # last two also work with icc/ecc.
52 #ICFLAGS = -g -O6 -Wall
53 ICFLAGS = -g -O6
54 #ICFLAGS = -g -O3 -Wall
55 #ICFLAGS = -g -O3
57 # Use XCFLAGS to specify machine-dependent compilation flags.
58 # For some platforms no special flags are needed.
59 #XCFLAGS = -DHAVE_IEEE_754 -DBSD
61 #==========================
62 # Linux
64 # Gcc 3.2.2 or higher on i686.
65 XCFLAGS = -mtune=pentium4 -malign-double -DHAVE_IEEE_754 -DBSD
66 # Gcc 2.8.1 on i686.
67 #XCFLAGS = -mcpu=pentiumpro -malign-double -DHAVE_IEEE_754 -DBSD
68 # Gcc 4.2.4 or higher on x86_64 (64-bit compilation)
69 #XCFLAGS = -mtune=native -DHAVE_IEEE_754 -DBSD -DSIZEOF_VOID_P=8 -DSIZEOF_LONG=8
70 # Gcc 4.2.4 or higher on x86_64 (32-bit compilation)
71 #XCFLAGS = -m32 -mtune=native -malign-double -DHAVE_IEEE_754 -DBSD
72 # Icc on i686 (older versions may not support -xHost).
73 #XCFLAGS = -ansi -xHost -align -ip -DHAVE_IEEE_754 -DBSD
74 # Icc on x86_64 (64-bit compilation).
75 #XCFLAGS = -ansi -xHost -align -ip -DHAVE_IEEE_754 -DBSD -DSIZEOF_VOID_P=8 -DSIZEOF_LONG=8
76 # Gcc on ia64.
77 #XCFLAGS = -DHAVE_IEEE_754 -DBSD -DSIZEOF_VOID_P=8 -DSIZEOF_LONG=8
78 # Icc/ecc on ia64.
79 #XCFLAGS = -ansi -DBSD -DHAVE_IEEE_754 -DSIZEOF_VOID_P=8 -DSIZEOF_LONG=8
81 #==========================
82 # Solaris
84 # For Solaris, BSD should not be replaced by UNIX100.
85 #XCFLAGS = -DHAVE_IEEE_754 -DUNIX100 -DEPD_BIG_ENDIAN
86 # Gcc 2.8.1 or higher on Ultrasparc.
87 #XCFLAGS = -mcpu=ultrasparc -DHAVE_IEEE_754 -DUNIX100 -DEPD_BIG_ENDIAN
88 # For Solaris 2.5 and higher, optimized code with /usr/bin/cc or CC.
89 #XCFLAGS = -DHAVE_IEEE_754 -DUNIX100 -xO5 -native -dalign -DEPD_BIG_ENDIAN
90 # On IA platforms, -dalign is not supported and causes warnings.
91 #XCFLAGS = -DHAVE_IEEE_754 -DUNIX100 -xO5 -native
92 # Recent Sun compilers won't let you use -native on old Ultras.
93 #XCFLAGS = -DHAVE_IEEE_754 -DUNIX100 -xO5 -dalign -xlibmil -DEPD_BIG_ENDIAN
94 # For Solaris 2.4, optimized code with /usr/bin/cc.
95 #XCFLAGS = -DHAVE_IEEE_754 -DUNIX100 -xO4 -dalign -DEPD_BIG_ENDIAN
96 # For Solaris 2.5 and higher, optimized code with /usr/ucb/cc.
97 #XCFLAGS = -DHAVE_IEEE_754 -DBSD -xO5 -native -dalign -DEPD_BIG_ENDIAN
98 #XCFLAGS = -DHAVE_IEEE_754 -DBSD -xO5 -dalign -xlibmil -DEPD_BIG_ENDIAN
99 # For Solaris 2.4, optimized code with /usr/ucb/cc.
100 #XCFLAGS = -DHAVE_IEEE_754 -DBSD -xO4 -dalign -DEPD_BIG_ENDIAN
102 #==========================
103 # DEC Alphas running Digital Unix
105 # For DEC Alphas either -ieee_with_inexact or -ieee_with_no_inexact is
106 # needed. If you use only BDDs, -ieee_with_no_inexact is enough.
107 # In the following, we consider three different compilers:
108 # - the old native compiler (the one of MIPS ancestry that produces u-code);
109 # - the new native compiler;
110 # - gcc
111 # On the Alphas, gcc (as of release 2.7.2) does not support 32-bit pointers
112 # and IEEE 754 floating point arithmetic. Therefore, for this architecture
113 # only, the native compilers provide a substatial advantage.
114 # With the native compilers, specify -xtaso for 32-bit pointers.
115 # Do not use -xtaso_short because explicit reference to stdout and stderr
116 # does not work with this option. (Among other things.)
117 # Notice that -taso must be included in LDFLAGS for -xtaso to work.
118 # Given the number of possible choices, only some typical configurations
119 # are proposed here.
121 # Old native compiler for the Alphas; 64-bit pointers.
122 #XCFLAGS = -DBSD -DHAVE_IEEE_754 -ieee_with_no_inexact -tune host -DSIZEOF_VOID_P=8 -DSIZEOF_LONG=8
123 # Old native compiler for the Alphas; 32-bit pointers.
124 #XCFLAGS = -DBSD -DHAVE_IEEE_754 -ieee_with_no_inexact -tune host -xtaso -DSIZEOF_LONG=8
125 # New native compiler for the Alphas; 64-bit pointers.
126 #XCFLAGS = -g3 -O4 -std -DBSD -DHAVE_IEEE_754 -ieee_with_no_inexact -tune host -DSIZEOF_VOID_P=8 -DSIZEOF_LONG=8
127 # New native compiler for the Alphas; 32-bit pointers.
128 #XCFLAGS = -g3 -O4 -std -DBSD -DHAVE_IEEE_754 -ieee_with_no_inexact -tune host -xtaso -DSIZEOF_LONG=8
129 # gcc for the Alphas: compile without HAVE_IEEE_754.
130 #XCFLAGS = -DBSD -DSIZEOF_VOID_P=8 -DSIZEOF_LONG=8
132 #==========================
134 # IBM RS6000
136 # For the IBM RS6000 -qstrict is necessary when specifying -O3 with cc.
137 #XCFLAGS = -DBSD -DHAVE_IEEE_754 -DEPD_BIG_ENDIAN -O3 -qstrict
139 #==========================
141 # HP-UX
143 # I haven't figured out how to enable IEEE 754 on the HPs I've tried...
144 # For HP-UX using gcc.
145 #XCFLAGS = -DUNIX100 -DEPD_BIG_ENDIAN
146 # For HP-UX using c89.
147 #XCFLAGS = +O3 -DUNIX100 -DEPD_BIG_ENDIAN
149 #==========================
151 # Windows 95/98/NT/XP/Vista with Cygwin tools
153 # The value of RLIMIT_DATA_DEFAULT should reflect the amount of
154 # available memory (expressed in bytes).
155 # Recent versions of cygwin have getrlimit, but the datasize limit
156 # cannot be set.
157 #XCFLAGS = -mtune=pentium4 -malign-double -DHAVE_IEEE_754 -DHAVE_GETRLIMIT=0 -DRLIMIT_DATA_DEFAULT=268435456
160 # Define the level of self-checking and verbosity of the CUDD package.
161 #DDDEBUG = -DDD_DEBUG -DDD_VERBOSE -DDD_STATS -DDD_CACHE_PROFILE -DDD_UNIQUE_PROFILE -DDD_COUNT
162 DDDEBUG =
164 # Define the level of self-checking and verbosity of the MTR package.
165 #MTRDEBUG = -DMTR_DEBUG
166 MTRDEBUG =
168 # Loader options.
169 LDFLAGS =
170 # This may produce faster code on the DECstations.
171 #LDFLAGS = -jmpopt -Olimit 1000
172 # This may be necessary under some old versions of Linux.
173 #LDFLAGS = -static
174 # This normally makes the program faster on the DEC Alphas.
175 #LDFLAGS = -non_shared -om
176 # This is for 32-bit pointers on the DEC Alphas.
177 #LDFLAGS = -non_shared -om -taso
178 #LDFLAGS = -non_shared -taso
180 # Define PURE as purify to link with purify.
181 # Define PURE as quantify to link with quantify.
182 # Remember to compile with -g if you want line-by-line info with quantify.
183 PURE =
184 #PURE = purify
185 #PURE = quantify
187 # Define EXE as .exe for MS-DOS and derivatives. Not required by recent
188 # versions of cygwin.
189 EXE =
190 #EXE = .exe
192 # End of the configuration section.
193 #---------------------------------------------------------------------------
195 MFLAG = -DMNEMOSYNE
196 MNEMLIB = ../mnemosyne/libmnem.a
198 DDWDIR = .
199 IDIR = $(DDWDIR)/include
200 INCLUDE = -I$(IDIR)
202 BDIRS = cudd dddmp mtr st util epd
203 DIRS = $(BDIRS) nanotrav
205 #------------------------------------------------------------------------
207 .PHONY : build
208 .PHONY : nanotrav
209 .PHONY : check_leaks
210 .PHONY : optimize_dec
211 .PHONY : testcudd
212 .PHONY : libobj
213 .PHONY : testobj
214 .PHONY : testdddmp
215 .PHONY : testmtr
216 .PHONY : lint
217 .PHONY : all
218 .PHONY : clean
219 .PHONY : distclean
222 build:
223 sh ./setup.sh
224 @for dir in $(DIRS); do \
225 (cd $$dir; \
226 echo Making $$dir ...; \
227 make CC=$(CC) RANLIB=$(RANLIB) MFLAG= MNEMLIB= ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" PURE="$(PURE)" EXE="$(EXE)" )\
228 done
230 nanotrav: build
232 check_leaks:
233 sh ./setup.sh
234 @for dir in mnemosyne $(DIRS); do \
235 (cd $$dir; \
236 echo Making $$dir ...; \
237 make CC=$(CC) RANLIB=$(RANLIB) MFLAG=$(MFLAG) MNEMLIB=$(MNEMLIB) ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" EXE="$(EXE)" )\
238 done
240 optimize_dec:
241 sh ./setup.sh
242 @for dir in $(DIRS); do \
243 (cd $$dir; \
244 echo Making $$dir ...; \
245 make CC=$(CC) RANLIB=$(RANLIB) XCFLAGS="$(XCFLAGS)" LDFLAGS="$(LDFLAGS)" optimize_dec )\
246 done
248 lint:
249 sh ./setup.sh
250 @for dir in $(DIRS) obj; do \
251 (cd $$dir; \
252 echo Making lint in $$dir ...; \
253 make CC=$(CC) lint )\
254 done
256 tags:
257 sh ./setup.sh
258 @for dir in $(DIRS) obj; do \
259 (cd $$dir; \
260 echo Making tags in $$dir ...; \
261 make CC=$(CC) tags )\
262 done
264 all:
265 sh ./setup.sh
266 @for dir in $(DIRS); do \
267 (cd $$dir; \
268 echo Making all in $$dir ...; \
269 make CC=$(CC) RANLIB=$(RANLIB) MFLAG= MNEMLIB= ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" PURE="$(PURE)" EXE="$(EXE)" all )\
270 done
272 testcudd:
273 sh ./setup.sh
274 @for dir in util st mtr epd; do \
275 (cd $$dir; \
276 echo Making $$dir ...; \
277 make CC=$(CC) RANLIB=$(RANLIB) MFLAG= MNEMLIB= ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" PURE="$(PURE)" EXE="$(EXE)" )\
278 done
279 @(cd cudd; \
280 echo Making testcudd ...; \
281 make CC=$(CC) RANLIB=$(RANLIB) MFLAG= MNEMLIB= ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" PURE="$(PURE)" EXE="$(EXE)" testcudd$(EXE) )
283 objlib:
284 sh ./setup.sh
285 @for dir in $(BDIRS); do \
286 (cd $$dir; \
287 echo Making $$dir ...; \
288 make CC=$(CC) RANLIB=$(RANLIB) MFLAG= MNEMLIB= ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" PURE="$(PURE)" EXE="$(EXE)" )\
289 done
290 @(cd obj; \
291 echo Making obj ...; \
292 make CPP=$(CPP) CPPFLAGS=$(CPPFLAGS) RANLIB=$(RANLIB) MFLAG= MNEMLIB= ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" PURE="$(PURE)" EXE="$(EXE)" )
294 testobj: objlib
295 @(cd obj; \
296 echo Making testobj ...; \
297 make CPP=$(CPP) CPPFLAGS=$(CPPFLAGS) RANLIB=$(RANLIB) MFLAG= MNEMLIB= ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" PURE="$(PURE)" EXE="$(EXE)" testobj$(EXE) )
299 testdddmp: build
300 @(cd dddmp; \
301 echo Making testdddmp ...; \
302 make CC=$(CC) RANLIB=$(RANLIB) MFLAG= MNEMLIB= ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" PURE="$(PURE)" EXE="$(EXE)" testdddmp$(EXE) )
304 testmtr: build
305 @(cd mtr; \
306 echo Making testmtr ...; \
307 make CC=$(CC) RANLIB=$(RANLIB) MFLAG= MNEMLIB= ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" PURE="$(PURE)" EXE="$(EXE)" testmtr$(EXE) )
309 clean:
310 @for dir in mnemosyne $(DIRS) obj; do \
311 (cd $$dir; \
312 echo Cleaning $$dir ...; \
313 make -s clean ) \
314 done
316 distclean:
317 @for dir in mnemosyne $(DIRS) obj; do \
318 (cd $$dir; \
319 echo Cleaning $$dir ...; \
320 make -s EXE="$(EXE)" distclean ) \
321 done
322 sh ./shutdown.sh