#!/usr/bin/make -f
# -*- makefile -*-
#export DH_VERBOSE=1

VIBED_FLAGS := --prefix=/usr \
		--buildtype=plain

export DFLAGS=-O2 -g -release -wi

# Define install target dir
INSTALLDIR = $(CURDIR)/debian/tmp

%:
	dh $@ --parallel

override_dh_auto_configure:
	mkdir build
	(cd build && meson $(VIBED_FLAGS) ..)

override_dh_auto_build:
	ldc2 --version
	ninja -Cbuild -v

override_dh_auto_install:
	DESTDIR=$(INSTALLDIR) ninja -Cbuild -v install

override_dh_auto_test:
	#ninja -Cbuild -v test # FIXME: Doesn't show any log on failure at time due to Meson bugs.

override_dh_install:
	dh_install --list-missing

override_dh_clean:
	rm -rf build/
	dh_clean
