#!/usr/bin/make -f
#
# 原来依赖 CDBS 的 autotools 类（/usr/share/cdbs/1/class/autotools.mk），
# 现在构建环境里的 cdbs 不再提供任何 1/class/*.mk，导致
#   No rule to make target '/usr/share/cdbs/1/class/autotools.mk'
# 这里改为使用 debhelper 的 dh 序列，去掉对 CDBS 的依赖。

# 上游代码不是 strict-aliasing 干净的，保持原来 CDBS 规则传给 ./configure 的编译参数。
export CFLAGS := -g -Wall -O2 -fno-strict-aliasing

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- --with-included-argv

override_dh_auto_clean:
	dh_auto_clean
	rm -f lib/stamp-h1
	rm -f lib/config.h
	rm -f config.log
	rm -rf .deps/
	rm -rf lib/.deps/
	rm -f Makefile
	rm -f config.status
	rm -f lib/*.o
	rm -f lib/*.a
	rm -f lib/Makefile