-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (55 loc) · 2.57 KB
/
Makefile
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
#
# PROJECT: PulCHESS, a Computer Chess program
# AUTHOR: Moreno Carullo - moreno.carullo [at] pulc [dot] it
# LICENSE: GPL, see license.txt in project root
# FILE: Project Makefile
#
#*********************************************************************
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
# for more details.
#*********************************************************************
#
# Created on 20-giu-2006
# $Id$
#
CXXFLAGS= -g3 -O2 -fno-rtti -I src/ -Wall -DDEBUG #-DPULCHESS_NOTABLES
LOGICPATH=src/
TXTUIPATH=${LOGICPATH}
TESTSPATH=tests/logic/
PULCHESSLOGIC=${LOGICPATH}rook.o ${LOGICPATH}queen.o ${LOGICPATH}king.o ${LOGICPATH}pawn.o \
${LOGICPATH}bishop.o ${LOGICPATH}piece.o ${LOGICPATH}board.o ${LOGICPATH}move.o \
${LOGICPATH}cpuplayer.o ${LOGICPATH}player.o ${LOGICPATH}knight.o \
${LOGICPATH}humanplayer.o ${LOGICPATH}pulchess.o \
${LOGICPATH}hashcache.o ${LOGICPATH}book.o \
PULCHESSTXT=${TXTUIPATH}main.o ${TXTUIPATH}xboard.o
PULCHESSTEST=${TESTSPATH}board.o ${TESTSPATH}soldier.o ${TESTSPATH}king.o ${TESTSPATH}move.o \
${TESTSPATH}rook.o ${TESTSPATH}pulchess.o ${TESTSPATH}main.o ${TESTSPATH}humanplayer.o ${TESTSPATH}cpuplayer.o
all: deploy
@echo "Making pulchess..."
pulchess: ${PULCHESSTXT} ${PULCHESSLOGIC}
@mkdir -p build
@g++ ${CXXFLAGS} -o build/pulchess ${PULCHESSTXT} ${PULCHESSLOGIC}
@strip build/pulchess*
if [ -f /usr/bin/upx ]; then upx build/pulchess; fi
deploy: pulchess
run: deploy
@build/pulchess
run-debug: deploy
@gdb build/pulchess
# unit testing
test: ${PULCHESSTEST} ${PULCHESSLOGIC}
@g++ ${CXXFLAGS} -o build/autotest ${PULCHESSLOGIC} ${PULCHESSTEST}
@build/autotest
clean:
@rm -rf ${LOGICPATH}*.o ${TXTUIPATH}*.o ${TESTSPATH}*.o build/pulchess build/autotest build/data
count:
@echo "Total LOC (.cpp) : `find ./src | grep \.cpp$ | xargs cat | wc -l`"; \
echo "Total LOC (.H) : `find ./src | grep \.H$ | xargs cat | wc -l`";