# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2002,2003 Colin Walters <walters@debian.org>
# Description: Sets core language variables, such as CFLAGS and CXXFLAGS
#
# 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, 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 for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

#PATH_RULES#

ifndef _cdbs_class_langcore
_cdbs_class_langcore = 1

# FIXME: Restructure to allow early override
CFLAGS += -g -Wall
CXXFLAGS += -g -Wall
ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
	DEB_OPT_FLAG ?= -O0
else
	DEB_OPT_FLAG ?= -O2
endif
CFLAGS += $(DEB_OPT_FLAG)
CXXFLAGS += $(DEB_OPT_FLAG)

ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
	DEB_PARALLEL_JOBS ?= $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif

endif
