#!/usr/bin/make -f

export PREFIX := /usr

dbgsrc_pkg_name := $(filter %-dbgsrc, $(shell awk '/^Package: /{print $2}' debian/control))
debug_prefix_map_arg := -fdebug-prefix-map=$(shell pwd)/src=$(PREFIX)/src/$(patsubst %-dbgsrc,%,$(dbgsrc_pkg_name))

export PRORAB_INSTALL_DBGSRC := true

export DEB_CFLAGS_MAINT_APPEND := $(debug_prefix_map_arg)
export DEB_CXXFLAGS_MAINT_APPEND := $(debug_prefix_map_arg)
export DEB_OBJCFLAGS_MAINT_APPEND := $(debug_prefix_map_arg)
export DEB_OBJCXXFLAGS_MAINT_APPEND := $(debug_prefix_map_arg)

%:
	dh $@
