1 diff --git a/Makefile b/Makefile
2 index eb06678..cde4c4e 100644
6 # -DTRACE N This enables the "trace" command so that the search tree
7 # can be dumped while running.
9 +PROFILE_USE_FLAGS=-fprofile-use -fprofile-correction -Wno-coverage-mismatch -freorder-blocks-and-partition
10 +PROFILE_GEN_FLAGS=-fprofile-generate -fprofile-correction
15 @@ -156,20 +159,22 @@ debug:
18 $(MAKE) target=LINUX \
20 - CFLAGS='-w -xP -O2 -fno-alias -prof-use -prof_dir ./profdir' \
21 - CXFLAGS='-w -xP -O2 -prof-use -prof-dir ./profdir' \
22 - LDFLAGS='$(LDFLAGS) -lpthread -lstdc++' \
23 - opt='$(opt) -DINLINE64 -DCPUS=2' \
25 + CFLAGS='$(CFLAGS) $(PROFILE_USE_FLAGS)' \
26 + CXFLAGS='$(CXXFLAGS)' \
27 + LDFLAGS='$(LDFLAGS) $(PROFILE_USE_FLAGS) -Wl,--as-needed' \
28 + LIBS='-lpthread -lstdc++' \
29 + opt='$(opt) -DINLINE64 -DCPUS=8 -DBOOKDIR="\"/usr/share/crafty\""' \
33 $(MAKE) target=LINUX \
35 - CFLAGS='-w -xP -O2 -fno-alias -prof-gen=srcpos -prof-dir ./profdir' \
36 - CXFLAGS='-w -xP -O2 -ip -prof-gen=srcpos -prof-dir ./profdir' \
37 - LDFLAGS='$(LDFLAGS) -lpthread -lstdc++ ' \
38 - opt='$(opt) -DINLINE64 -DCPUS=2' \
40 + CFLAGS='$(CFLAGS) $(PROFILE_GEN_FLAGS)' \
41 + CXFLAGS='$(CXXFLAGS)' \
42 + LDFLAGS='$(LDFLAGS) $(PROFILE_GEN_FLAGS) -Wl,--as-needed' \
43 + LIBS='-lpthread -lstdc++ -lgcov' \
44 + opt='$(opt) -DINLINE64 -DCPUS=8 -DBOOKDIR="\"..\""' \
48 @@ -218,9 +223,7 @@ solaris-gcc:
53 - @rm -rf position.bin
57 $(MAKE) linux-64-profile
58 @echo "#!/bin/csh" > runprof
59 @@ -289,7 +292,7 @@ profile:
60 @echo "quit" >>runprof
65 @echo "#!/bin/csh" > runprof
66 @echo "./crafty <<EOF" >>runprof
67 @echo "st=10" >>runprof
68 @@ -301,7 +304,7 @@ profile:
69 @echo "quit" >>runprof
77 diff --git a/option.c b/option.c
78 index 4aacdee..5ba49a2 100644
81 @@ -1093,7 +1093,7 @@ int Option(TREE * RESTRICT tree) {
82 char *readstat = (char *) -1;
85 - helpfile = fopen("crafty.hlp", "r");
86 + helpfile = fopen(BOOKDIR"/crafty.hlp", "r");
88 printf("ERROR. Unable to open \"crafty.hlp\" -- help unavailable\n");