-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile.pcc
121 lines (88 loc) · 2.39 KB
/
Makefile.pcc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# vim:ft=make
CC = pcc
DEBUG = 1
PROFILE = 0
WITH_TRACES = 0
FREECELL_ONLY = 1
WITH_LIBRB = 0
ifneq ($(DEBUG),0)
CFLAGS := -Wall -g
else
CFLAGS := -Wall -O3
# CFLAGS := -Wall -Os
endif
CFLAGS += -I /usr/include/linux -I /usr/lib/gcc-lib/i586-mandriva-linux-gnu/3.3.6/include/
ifneq ($(WITH_TRACES),0)
CFLAGS += -DDEBUG
endif
ifneq ($(FREECELL_ONLY),0)
CFLAGS += -DFCS_FREECELL_ONLY=1
endif
LFLAGS := -Wall
END_LFLAGS := -lm
# Toggle for profiling information.
ifneq ($(PROFILE),0)
END_OFLAGS := -pg
END_LFLAGS := -pg -lc_p -lm_p -static-libgcc
endif
ifneq ($(WITH_LIBRB),0)
END_LFLAGS += -lredblack
endif
DFLAGS = $(CFLAGS) -DDEBUG
END_DLFLAGS = $(END_LFLAGS)
DLFLAGS = $(LFLAGS)
TARGETS = fc-solve \
freecell-solver-multi-thread-solve \
freecell-solver-range-parallel-solve
# libfreecell-solver.so.0
ifeq ($(EXIT),1)
error:
@echo "Error! WHICH_STATE_ALLOCATION must be defined to a legal value"
@echo $(LFLAGS)
else
all: $(TARGETS)
board_gen: dummy
make -C board_gen/
dummy:
#<<<OBJECTS.START
OBJECTS = \
alloc.o \
app_str.o \
caas.o \
card.o \
cl_chop.o \
cmd_line.o \
fcs_dm.o \
fcs_hash.o \
fcs_isa.o \
freecell.o \
intrface.o \
lib.o \
lookup2.o \
move.o \
pqueue.o \
preset.o \
rand.o \
scans.o \
simpsim.o \
state.o \
#>>>OBJECTS.END
# MYOBJ.o ==> .deps/MYOBJ.P
DEP_FILES = $(addprefix .deps/,$(addsuffix .pp,$(basename $(OBJECTS))))
-include $(DEP_FILES)
%.o: %.c
$(CC) -Wp,-MD,.deps/$(*F).pp -c $(CFLAGS) -o $@ $< $(END_OFLAGS)
libfcs.a: $(OBJECTS)
ar r $@ $(OBJECTS)
ranlib $@
libfreecell-solver.so.0: $(OBJECTS)
gcc -shared -o $@ $(OBJECTS) -ltcc
fc-solve: main.o libfcs.a
$(CC) $(LFLAGS) -o $@ -L. $< -lfcs $(END_LFLAGS)
freecell-solver-range-parallel-solve: test_multi_parallel.o libfcs.a
$(CC) -Wall -o $@ -L. $< -lfcs $(END_LFLAGS)
freecell-solver-multi-thread-solve: threaded_range_solver.o libfcs.a
$(CC) -Wall -o $@ -L. $< -lfcs -lpthread $(END_LFLAGS)
clean:
rm -f *.o $(TARGETS) libfcs.a libfreecell-solver.* test-lib mtest
endif