1 ###############################################################################
3 # Copyright (C) 2005 Maurizio Monge #
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. #
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. #
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 #
20 # maurizio.monge@gmail.com #
22 ###############################################################################
28 ##########################################
29 # Headers an libraries to include #
30 ##########################################
35 ##########################################
36 # Compiler Options and flags #
37 ##########################################
39 COPTIONS
=-fstrict-aliasing
-O3
-fexpensive-optimizations
-g
-fomit-frame-pointer
-Wall
-D__NO_MATH_INLINES
-ffast-math
40 #COPTIONS=-fstrict-aliasing -O2 -g -Wall -D__NO_MATH_INLINES -ffast-math
41 #COPTIONS=-fstrict-aliasing -O0 -g -Wall -DDEBUG
47 ##########################################
48 # C/C++ sources (and headers to moc) #
49 ##########################################
51 SRC_CXX
=$(wildcard *.
cpp)
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
)
68 -rm -f
*.moc
*.o
*.so
*.out
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
)
77 -cd
$(dir $@
) && make
$(notdir $@
)
83 $(CXX
) $(CXXFLAGS
) -c
-o
$@
$<
86 $(CC
) $(CFLAGS
) -c
-o
$@
$<
89 $(CXX
) -MM
$(CXXFLAGS
) $< >$@
92 $(CC
) -MM
$(CFLAGS
) $< >$@