#!/usr/bin/make -f

PACKAGE = $(shell dh_listpackages)
TMP     = $(CURDIR)/debian/$(PACKAGE)
ARCHLIB := $(shell perl -MConfig -e 'print $$Config{vendorarch}')
LLVMLIB := $(shell llvm-config --libdir)
LLVMINC := $(shell llvm-config --includedir)

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- LIBS="-L$(LLVMLIB) -lclang" INC="-I$(LLVMINC)"

override_dh_auto_build:
	dh_auto_build
	chrpath -d $(CURDIR)/blib/arch/auto/Clang/Clang.so

override_dh_auto_install:
	dh_auto_install
	$(RM) -v $(TMP)/usr/share/man/man3/README.3pm \
		$(TMP)$(ARCHLIB)/README.pod
