1 | CC = g++ -Wall -m32 |
---|
2 | CFLAGS = -O3 |
---|
3 | |
---|
4 | #CFLAGS = -O3 -DNDEBUG |
---|
5 | #MFLAGS = |
---|
6 | #LINKFLAGS = --static |
---|
7 | |
---|
8 | ifeq (solaris, $(OSTYPE)) |
---|
9 | MFLAGS = -D_NEED_REDEFINE_RAND_MAX_ |
---|
10 | endif |
---|
11 | |
---|
12 | RANLIB = ranlib |
---|
13 | AR = ar |
---|
14 | |
---|
15 | .SUFFIXES: .o .cpp |
---|
16 | |
---|
17 | HEADERS = zchaff_base.h zchaff_clsgen.h zchaff_header.h zchaff_version.h zchaff_dbase.h zchaff_solver.h |
---|
18 | |
---|
19 | SOLVER_SRCS = sat_solver.cpp |
---|
20 | SOLVER_OBJS = $(SOLVER_SRCS:.cpp=.o) |
---|
21 | |
---|
22 | |
---|
23 | LIB_SRCS = zchaff_utils.cpp \ |
---|
24 | zchaff_solver.cpp\ |
---|
25 | zchaff_base.cpp \ |
---|
26 | zchaff_dbase.cpp \ |
---|
27 | zchaff_c_wrapper.cpp \ |
---|
28 | zchaff_cpp_wrapper.cpp \ |
---|
29 | |
---|
30 | LIB_OBJS = $(LIB_SRCS:.cpp=.o) |
---|
31 | |
---|
32 | |
---|
33 | zchaff: $(SOLVER_OBJS) libsat.a SAT.h |
---|
34 | $(CC) $(LINKFLAGS) $(CFLAGS) $(MFLAGS) $(SOLVER_OBJS) libsat.a -o zchaff |
---|
35 | |
---|
36 | zverify_df: zverify_df.cpp |
---|
37 | $(CC) $(LINKFLAGS) $(CFLAGS) $(MFLAGS) zverify_df.cpp -o zverify_df |
---|
38 | |
---|
39 | zminimal: zminimal.cpp libsat.a |
---|
40 | $(CC) $(LINKFLAGS) $(CFLAGS) $(MFLAGS) zminimal.cpp libsat.a -o zminimal |
---|
41 | |
---|
42 | cnf_stats: cnf_stats.cpp |
---|
43 | $(CC) $(LINKFLAGS) $(CFLAGS) $(MFLAGS) cnf_stats.cpp -o cnf_stats |
---|
44 | |
---|
45 | $(LIB_OBJS): $(HEADERS) Makefile |
---|
46 | |
---|
47 | $(SOLVER_OBJS): $(SOLVER_SRCS) SAT.h Makefile |
---|
48 | |
---|
49 | zchaff_c_wrapper.cpp: zchaff_wrapper.wrp |
---|
50 | sed 's/EXTERN/extern \"C\"/' zchaff_wrapper.wrp > zchaff_c_wrapper.cpp |
---|
51 | |
---|
52 | zchaff_cpp_wrapper.cpp: zchaff_wrapper.wrp |
---|
53 | sed 's/EXTERN//' zchaff_wrapper.wrp > zchaff_cpp_wrapper.cpp |
---|
54 | SAT_C.h: |
---|
55 | sed 's/gid = 0/gid/' SAT.h > SAT_C.h |
---|
56 | |
---|
57 | libsat.a: $(LIB_OBJS) |
---|
58 | @rm -f libsat.a |
---|
59 | $(AR) cr libsat.a $(LIB_OBJS) |
---|
60 | $(RANLIB) libsat.a |
---|
61 | |
---|
62 | .cpp.o: |
---|
63 | $(CC) $(CFLAGS) $(MFLAGS) -c $< |
---|
64 | |
---|
65 | clean: |
---|
66 | rm -f *.o libsat.a zchaff *wrapper.cpp zminimal zverify_df cnf_stats SAT_C.h |
---|
67 | |
---|
68 | all: zchaff zverify_df zminimal cnf_stats |
---|