Removed killer, just use history. small cleanup.
[rattatechess.git] / Makefile
blob8d7610ffbbab8b5d0a7139493ae5cfb60b1adbd0
1 ###############################################################################
2 # #
3 # Copyright (C) 2005 Maurizio Monge #
4 # #
5 # This library is free software; you can redistribute it and/or #
6 # modify it under the terms of the GNU Library General Public #
7 # License as published by the Free Software Foundation; either #
8 # version 2 of the License, or (at your option) any later version. #
9 # #
10 # This library is distributed in the hope that it will be useful, #
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU #
13 # Library General Public License for more details. #
14 # #
15 # You should have received a copy of the GNU Library General Public #
16 # License along with this library; if not, write to the Free #
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
18 # #
19 # Maurizio Monge #
20 # maurizio.monge@gmail.com #
21 # #
22 ###############################################################################
24 CC=gcc
25 CXX=g++
28 ##########################################
29 # Headers an libraries to include #
30 ##########################################
31 INC=
32 LIB=
35 ##########################################
36 # Compiler Options and flags #
37 ##########################################
38 #-mregparm=3
39 COPTIONS=-fno-strict-aliasing -O3 -fexpensive-optimizations -g -fomit-frame-pointer -Wall -D__NO_MATH_INLINES -ffast-math
40 #COPTIONS=-fno-strict-aliasing -O2 -g -Wall -D__NO_MATH_INLINES -ffast-math
41 #COPTIONS=-fno-strict-aliasing -O0 -g3 -Wall -DDEBUG
42 FLAGS=-D_GNU_SOURCE
43 EXTRA=-Wall
44 #EXTRA=-pg
47 ##########################################
48 # C/C++ sources (and headers to moc) #
49 ##########################################
50 SRC_C=
51 SRC_CXX=$(wildcard *.cpp)
52 MOC_HEADERS=
53 TARGET=rattatechess
56 CFLAGS=-std=c99 $(COPTIONS) $(FLAGS) $(INC) $(EXTRA)
57 CXXFLAGS=$(COPTIONS) $(FLAGS) $(INC) $(EXTRA)
58 LDFLAGS=$(LIB) $(EXTRA)
59 OBJ=$(SRC_C:%.c=%.o) $(SRC_CXX:%.cpp=%.o)
60 DEPS=$(SRC_C:%.c=.%.dep) $(SRC_CXX:%.cpp=.%.dep)
61 MOCS=$(MOC_HEADERS:%.h=%.moc)
64 all: $(TARGET)
67 clean:
68 -rm -f *.moc *.o *.so *.out
70 distclean:
71 -rm -f *.moc *.o *.so *.out .*.dep *~ *.s *.i *.ii $(TARGET) log.* game.* *.lrn *.bin
73 $(TARGET): $(MOCS) $(OBJ)
74 $(CXX) -o $@ $(OBJ) $(SUBTARGETS) $(LDFLAGS)
76 $(SUBTARGETS):
77 -cd $(dir $@) && make $(notdir $@)
79 %.moc: %.h
80 moc -o $@ $<
82 %.o: %.cpp
83 $(CXX) $(CXXFLAGS) -c -o $@ $<
85 %.o: %.c
86 $(CC) $(CFLAGS) -c -o $@ $<
88 .%.dep: %.cpp
89 $(CXX) -MM $(CXXFLAGS) $< >$@
91 .%.dep: %.c
92 $(CC) -MM $(CFLAGS) $< >$@
94 -include $(DEPS)