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
|
From: Oliver Korff <ok@xynyx.de>
Description: This patch adds a linux-generic target to be used in other architectures.
The linux target was patched to include the -DINLINE32 switch
Some variables used in the binary were preset, for detailes see line 17ff
Disabled profiling -pg switch for the linux target
--- a/Makefile
+++ b/Makefile
@@ -38,6 +38,38 @@
# -DTRACE N This enables the "trace" command so that the search tree
# can be dumped while running.
+#Edited for Debian GNU/Linux
+DESTDIR =
+BIN = $(DESTDIR)/usr/games
+BOOKS = $(DESTDIR)/var/lib/crafty
+DOC = $(DESTDIR)/usr/share/doc
+ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
+ CFLAGS += -g
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+ INSTALL += -s
+endif
+
+# Next option allows to build the package with debugging information.
+# DEB_BUILD_OPTIONS=debug # This allows the generation of a build tree with
+# debugging information.
+
+#Edited for Debian GNU/Linux
+DESTDIR =
+BIN = $(DESTDIR)/usr/games
+BOOKS = $(DESTDIR)/var/lib/crafty
+DOC = $(DESTDIR)/usr/share/doc
+ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
+ CFLAGS += -g
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+ INSTALL += -s
+endif
+
+# Next option allows to build the package with debugging information.
+# DEB_BUILD_OPTIONS=debug # This allows the generation of a build tree with
+# debugging information.
+
default:
$(MAKE) linux-64
help:
@@ -129,13 +161,21 @@
linux:
$(MAKE) target=LINUX \
CC=gcc CXX=g++ \
- CFLAGS='-pg -Wwrite-strings -Wcast-qual -Wshadow \
- -Wconversion -W -Wall -ansi -pedantic -pipe' \
+ CFLAGS='-pg -Wwrite-strings -Wcast-qual -Wshadow -Wconversion -W -Wall -pedantic -pipe' \
CXFLAGS='' \
- LDFLAGS='$(LDFLAGS) -pg -lstdc++ -lpthread' \
- opt='$(opt) -DTRACE -DINLINE64 -DCPUS=2' \
+ LDFLAGS='$(LDFLAGS) -lstdc++ -lpthread' \
+ opt='$(opt) -DTRACE -DINLINE32 -DCPUS=2' \
crafty-make
+linux-generic:
+ $(MAKE) target=LINUX \
+ CC=gcc CXX=g++ \
+ CFLAGS='$(CFLAGS) -Wall -pipe -O3 -fno-gcse' \
+ CXFLAGS='$(CFLAGS)' \
+ LDFLAGS='$(LDFLAGS) -lpthread -lstdc++' \
+ opt='$(opt) -DCPUS=2' \
+ crafty-make
+
linux-profile:
$(MAKE) target=LINUX \
CC=gcc CXX=g++ \
@@ -335,7 +375,7 @@
crafty.o: *.c *.h
crafty: $(objects) egtb.o
- $(CC) $(LDFLAGS) -o crafty $(objects) egtb.o -lm $(LIBS)
+ $(CC) -o crafty $(objects) $(LDFLAGS) egtb.o -lm $(LIBS)
egtb.o: egtb.cpp
$(CXX) -c $(CXFLAGS) $(opts) egtb.cpp
|