#!/usr/bin/make -f


include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk

DEB_DH_INSTALL_SOURCEDIR=debian/tmp
#DEB_DH_STRIP_ARGS=--dbg-package=libjinglebase0

# Use soft-float and thumb mode if it enabled.
ifneq (,$(findstring thumb,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -mthumb
	CXXFLAGS += -mthumb
endif

# Use parallelized building if possible
ifneq (,$(findstring parallel,$(DEB_BUILD_OPTIONS)))
	PARALLEL_JOBS := $(shell echo $(DEB_BUILD_OPTIONS) | \
		sed -e 's/.*parallel=\([0-9]\+\).*/\1/')
	ifeq ($(DEB_BUILD_OPTIONS),$(PARALLEL_JOBS))
		PARALLEL_JOBS := $(shell if [ -f /proc/cpuinfo ]; \
			then echo `cat /proc/cpuinfo | grep 'processor' | wc -l`; \
			else echo 1; fi)
	endif
	NJOBS := -j$(PARALLEL_JOBS)
endif
DEB_MAKE_ENVVARS := MAKEFLAGS=$(NJOBS)

makebuilddir/libjinglebase0::
	autoreconf -v --install
	automake --add-missing

binary-post-install/libjinglep2p0::
	dh_strip -plibjinglep2p0 --dbg-package=libjinglep2p0
	
binary-post-install/libjinglebase0::
	dh_strip -plibjinglebase0 --dbg-package=libjinglebase0
	
