# -*- Makefile -*-

ifdef DEBUG
DEBUG_FLAGS		= -g -rdynamic -D $(PROJECT_IDENTIFIER)_DEBUG
OPTIMIZE_FLAGS		=

ifdef DEBUG_PARANOIA
DEBUG_FLAGS		+= -D $(PROJECT_IDENTIFIER)_DEBUG_PARANOIA
endif				# DEBUG_PARANOIA

else				# DEBUG

OPTIMIZE_FLAGS		= $(CXXFLAGS_OPTIMIZE)

# DEBUG_FLAGS		= -pg
endif				# DEBUG

INCLUDE_FLAGS		= -I . -I $(VAR_PATH) -I $(PROJECT_ROOT)/source/skk -I $(PROJECT_ROOT)/source/skk/architecture -I $(PROJECT_ROOT)/source/skk/architecture/$(ARCHITECTURE_LOWER_CASE)
LIBRARY_FLAGS		= -L/usr/lib

CPPFLAGS		= $(DEBUG_FLAGS) $(CXXFLAGS_ARCHITECTURE) $(CXXFLAGS_BYTE_ORDER) $(CXXFLAGS_CONFIG) $(INCLUDE_FLAGS) $(CXXFLAGS_DEFINE) -D $(PROJECT_IDENTIFIER)_VERSION=\"$(PROJECT_VERSION)\"

CXXFLAGS		= $(DEBUG_FLAGS) $(CXXFLAGS_ARCHITECTURE) $(CXXFLAGS_BYTE_ORDER) $(CXXFLAGS_CONFIG) $(INCLUDE_FLAGS) $(OPTIMIZE_FLAGS) $(CXXFLAGS_WARNING) -fno-exceptions -fno-rtti -fmessage-length=0 -pipe -fPIC -D $(PROJECT_IDENTIFIER)_VERSION=\"$(PROJECT_VERSION)\"

LDFLAGS			= $(DEBUG_FLAGS) $(LDFLAGS_ARCHITECTURE) $(OPTIMIZE_FLAGS) -pipe $(LIBRARY_FLAGS) -fPIC

CXX			= $(CCACHE) $(COMPILER)
LD			= $(COMPILER)
CPP			= $(CXX)
LD			= $(CXX)
STRIP			= strip
