2008-06-19 18:39:23 +02:00
|
|
|
CXXFLAGS = -Wall
|
2008-01-30 12:38:09 +01:00
|
|
|
|
|
|
|
ifeq ($(shell uname -o), Cygwin)
|
|
|
|
# Detection of uninitialized variables is buggy in Cygwin and generates spurious warnings
|
2008-06-19 18:39:23 +02:00
|
|
|
CXXFLAGS += -Wno-uninitialized
|
|
|
|
CXXFLAGS += -mno-cygwin
|
2008-01-30 12:38:09 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CROSS_WIN32), yes)
|
2008-06-19 18:39:23 +02:00
|
|
|
CXX = i586-mingw32msvc-g++
|
2008-02-07 22:20:49 +01:00
|
|
|
AR = i586-mingw32msvc-ar
|
2008-01-30 12:38:09 +01:00
|
|
|
# Detection of uninitialized variables is buggy in MinGW and generates spurious warnings
|
2008-06-19 18:39:23 +02:00
|
|
|
CXXFLAGS += -Wno-uninitialized
|
2008-01-30 12:38:09 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(DEBUG),yes)
|
2008-06-19 18:39:23 +02:00
|
|
|
CXXFLAGS += -ggdb
|
2008-01-30 12:38:09 +01:00
|
|
|
else
|
2008-06-19 18:39:23 +02:00
|
|
|
CXXFLAGS += -O3
|
2008-01-30 12:38:09 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(VALGRIND), yes)
|
2008-06-19 18:39:23 +02:00
|
|
|
CXXFLAGS = -Wall -O -g -fno-inline
|
2008-01-30 12:38:09 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
# General rule for compilation
|
|
|
|
%.o : %.cc
|
2008-06-19 18:39:23 +02:00
|
|
|
$(CXX) $(CXXFLAGS) -MD -I include -c $<
|
2008-01-30 12:38:09 +01:00
|
|
|
@cp $*.d $*.P; \
|
|
|
|
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
|
|
|
|
-e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
|
|
|
|
rm -f $*.d
|
|
|
|
|
|
|
|
# Local variables:
|
|
|
|
# mode: makefile
|
|
|
|
# End:
|