emergency commit
[cl-cudd.git] / distr / dddmp / Makefile
blob3f06cc2f145c77b49d62608747872473d0b37154
1 #----------------------------------------------------------------------------#
2 # Makefile for the dddmp distribution kit #
3 # dddmp: Decision Diagram DuMP #
4 # (storage and retrieval of BDDs, ADDs and CNF formulas) #
5 # Revision: Version 2.0.2, February 01, 2004 #
6 #----------------------------------------------------------------------------#
8 # Commands Available:
9 # make
10 # it makes the library libdddmp.a
11 # make testdddmp
12 # it makes the testdddmp program, which allows to test the dddmp
13 # package
14 # make clean
15 # it cleans dddmp
16 # make distclean
17 # it cleans dddmp (as clean) with libraries and executable
18 # files
20 #----------------------------------------------------------------------------#
21 # Configuration Section #
22 # uncomment the desired options/sections #
23 #----------------------------------------------------------------------------#
25 #--------------------#
26 # Define Directories #
27 #--------------------#
29 # Cudd directory
30 WHERE = ..
31 #WHERE = ../cudd-2.4.0
33 # Include directory (Cudd include files)
34 INCLUDE = $(WHERE)/include
36 #------------------------#
37 # Define C Compiler Used #
38 #------------------------#
40 CC = gcc
41 #CC = g++
42 #CC = cc
43 #CC = icc
44 #CC = ecc
45 #CC = /usr/ucb/cc
46 #CC = c89
48 .SUFFIXES: .o .c .u
50 #---------------#
51 # Define ranlib #
52 #---------------#
54 # For machines with ranlib and you think it is needed
55 RANLIB = ranlib
56 # For machines which either do not have ranlib or can do without it
57 #RANLIB = :
59 #----------------------------------#
60 # Define Machine Independent Flags #
61 #----------------------------------#
63 # Settings for cc
64 #ICFLAGS =
65 #ICFLAGS = -g
66 #ICFLAGS = -O
67 # Settings for optimized code with gcc
68 #ICFLAGS = -g -Wall
69 #ICFLAGS = -g -O3 -Wall
70 ICFLAGS = -g -O6 -Wall
72 #--------------------------------#
73 # Define Machine Dependent Flags #
74 #--------------------------------#
76 # When no special flags are needed
77 #XCFLAGS = -DHAVE_IEEE_754 -DBSD
78 # Linux with Gcc 2.8.1 or higher on i686.
79 XCFLAGS = -mcpu=pentiumpro -malign-double -DHAVE_IEEE_754 -DBSD
80 # Gcc 3.3.2 or higher on i686.
81 #XCFLAGS = -mcpu=pentium4 -malign-double -DHAVE_IEEE_754 -DBSD
82 # For Solaris, BSD should not be replaced by UNIX100.
83 #XCFLAGS = -DHAVE_IEEE_754 -DUNIX100 -DEPD_BIG_ENDIAN
84 # New native compiler for the Alphas; 64-bit pointers.
85 #XCFLAGS = -g3 -O4 -std -DBSD -DHAVE_IEEE_754 -ieee_with_no_inexact -tune host -DSIZEOF_VOID_P=8 -DSIZEOF_LONG=8
86 # New native compiler for the Alphas; 32-bit pointers.
87 #XCFLAGS = -g3 -O4 -std -DBSD -DHAVE_IEEE_754 -ieee_with_no_inexact -tune host -xtaso -DSIZEOF_LONG=8
88 # Windows95/98/NT/XP with Cygwin tools
89 #XCFLAGS = -mcpu=pentiumpro -malign-double -DHAVE_IEEE_754 -DHAVE_GETRLIMIT=0 -DRLIMIT_DATA_DEFAULT=67108864
91 #---------------------------------------------#
92 # Define Level of Self-Checking and Verbosity #
93 #---------------------------------------------#
95 # ... for the CUDD package
96 #DDDEBUG = -DDD_DEBUG -DDD_VERBOSE -DDD_STATS -DDD_CACHE_PROFILE -DDD_UNIQUE_PROFILE -DDD_COUNT
97 DDDEBUG =
99 # ... for the MTR package
100 #MTRDEBUG = -DMTR_DEBUG
101 MTRDEBUG =
103 # ... for the DDDMP package
104 #DDDMPDEBUG = -DDDDMP_DEBUG
105 DDDMPDEBUG =
107 #-----------------------#
108 # Define Loader Options #
109 #-----------------------#
111 LDFLAGS =
112 # This may produce faster code on the DECstations.
113 #LDFLAGS = -jmpopt -Olimit 1000
114 # This may be necessary under some old versions of Linux.
115 #LDFLAGS = -static
116 # This normally makes the program faster on the DEC Alphas.
117 #LDFLAGS = -non_shared -om
118 # This is for 32-bit pointers on the DEC Alphas.
119 #LDFLAGS = -non_shared -om -taso
120 #LDFLAGS = -non_shared -taso
122 #-------------#
123 # Define PURE #
124 #-------------#
126 PURE =
127 # ... as purify to link with purify.
128 #PURE = purify
129 # ... as quantify to link with quantify.
130 #PURE = quantify
132 #------------#
133 # Define EXE #
134 #------------#
136 EXE =
137 # ... as .exe for MS-DOS and derivatives.
138 #EXE = .exe
140 #----------------------------------------------------------------------------#
141 # Files for the Package #
142 #----------------------------------------------------------------------------#
144 P = dddmp
145 PSRC = dddmpStoreBdd.c dddmpStoreAdd.c dddmpStoreCnf.c \
146 dddmpLoad.c dddmpLoadCnf.c \
147 dddmpNodeBdd.c dddmpNodeAdd.c dddmpNodeCnf.c \
148 dddmpStoreMisc.c dddmpUtil.c dddmpBinary.c dddmpConvert.c \
149 dddmpDbg.c
150 PHDR = dddmp.h dddmpInt.h $(INCLUDE)/cudd.h $(INCLUDE)/cuddInt.h
151 POBJ = $(PSRC:.c=.o)
152 PUBJ = $(PSRC:.c=.u)
153 TARGET = test$(P)$(EXE)
154 TARGETu = test$(P)-u
156 # files for the test program
157 SRC = test$(P).c
158 OBJ = $(SRC:.c=.o)
159 UBJ = $(SRC:.c=.u)
161 #----------------------------------------------------------------------------#
162 # Rules to compile and build libraries and executables #
163 #----------------------------------------------------------------------------#
165 #MFLAG =
166 MFLAG = -DMNEMOSYNE
167 MNEMLIB = ../mnemosyne/libmnem.a
169 # This is to create the lint library
170 LINTFLAGS = -u -n
171 LINTSWITCH = -o
173 LIBS = ./libdddmp.a $(WHERE)/cudd/libcudd.a $(WHERE)/mtr/libmtr.a \
174 $(WHERE)/st/libst.a $(WHERE)/util/libutil.a $(WHERE)/epd/libepd.a
176 MNEMLIB =
178 BLIBS = -kL. -kldddmp -kL$(WHERE)/cudd -klcudd -kL$(WHERE)/mtr -klmtr \
179 -kL$(WHERE)/st -klst -kL$(WHERE)/util -klutil
181 LINTLIBS = ./llib-ldddmp.ln $(WHERE)/cudd/llib-lcudd.ln \
182 $(WHERE)/mtr/llib-lmtr.ln $(WHERE)/st/llib-lst.ln \
183 $(WHERE)/util/llib-lutil.ln
185 lib$(P).a: $(POBJ)
186 ar rv $@ $?
187 $(RANLIB) $@
189 .c.o: $(PHDR)
190 $(CC) -c $< -I$(INCLUDE) $(ICFLAGS) $(XCFLAGS) $(DDDEBUG) $(MTRDEBUG) $(DDDMPDEBUG) $(LDFLAGS)
192 optimize_dec: lib$(P).b
194 lib$(P).b: $(PUBJ)
195 ar rv $@ $?
196 $(RANLIB) $@
198 .c.u: $(PHDR)
199 cc -c $< -I$(INCLUDE) $(CFLAGS)
201 # if the header files change, recompile
202 $(POBJ): $(PHDR)
203 $(PUBJ): $(PHDR)
204 $(OBJ): $(PHDR)
205 $(UBJ): $(PHDR)
207 $(TARGET): $(SRC) $(OBJ) $(PHDR) $(LIBS) $(MNEMLIB)
208 $(PURE) $(CC) $(ICFLAGS) $(XCFLAGS) $(DDDEBUG) $(MTRDEBUG) $(DDDMPDEBUG) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) $(MNEMLIB) -lm
210 # optimize (DECstations and Alphas only: uses u-code)
211 $(TARGETu): $(SRC) $(UBJ) $(PHDR) $(LIBS:.a=.b)
212 cc -O3 -Olimit 1000 $(XCFLAGS) $(LDFLAGS) -o $@ $(UBJ) $(BLIBS) -lm
214 lint: llib-l$(P).ln
216 llib-l$(P).ln: $(PSRC) $(PHDR)
217 lint $(LINTFLAGS) $(LINTSWITCH)$(P) -I$(INCLUDE) $(PSRC)
219 lintpgm: lint
220 lint $(LINTFLAGS) -I$(INCLUDE) $(SRC) $(LINTLIBS)
222 tags: $(PSRC) $(PHDR)
223 ctags $(PSRC) $(PHDR)
225 all: lib$(P).a lib$(P).b llib-l$(P).ln tags
227 programs: $(TARGET) $(TARGETu) lintpgm
229 #----------------------------------------------------------------------------#
230 # Clean the Package #
231 #----------------------------------------------------------------------------#
233 clean:
234 rm -f *.o *.u mon.out gmon.out *.pixie *.Addrs *.Counts mnem.* \
235 .pure core *.warnings
237 distclean: clean
238 rm -f $(TARGET) $(TARGETu) lib*.a lib$(P).b llib-l$(P).ln \
239 *.bak *~ tags .gdb_history *.qv *.qx