#!/usr/bin/make -f

PACKAGE = genparse

CONF_FLAGS = \
	--host=$(DEB_HOST_GNU_TYPE) \
	--build=$(DEB_BUILD_GNU_TYPE) \
	--prefix=/usr

# Changed by the build process: files deleted and autoreconf
FILE_LIST_PRESERVE = \
 config.in \
 configure \
 doc/genparse.info \
 doc/stamp-vti \
 doc/version.texi \
 examples/Cmdline.java \
 examples/CmdlineEx.java \
 examples/CmdlineInterface.java \
 examples/echo_clp.c \
 examples/echo_clp.h \
 examples/ls_clp.c \
 examples/ls_clp.h \
 examples/mv_clp.c \
 examples/mv_clp.h \
 examples/mycopy3_clp.c \
 examples/mycopy3_clp.h \
 examples/mycopy4_clp.cc \
 examples/mycopy4_clp.h \
 examples/mycopy4_clp_cb.cc \
 examples/ping_clp.c \
 examples/ping_clp.h \
 examples/rm_clp.c \
 examples/rm_clp.h \
 examples/tail_clp.c \
 examples/tail_clp.h \
 examples/uname_clp.c \
 examples/uname_clp.h \
 examples/wc_clp.c \
 examples/wc_clp.h \
 tests/ccheck/default_clp.c \
 tests/ccheck/double_clp.c \
 tests/ccheck/intmax_clp.c \
 tests/ccheck/long_clp.c \
 tests/ccheck/longmembers_clp.c \
 tests/ccheck/uintmax_clp.c \
 tests/ccheck/ulong_clp.c \
 tests/cppcheck/default_clp.cc \
 tests/cppcheck/longmembers_clp.cc \
 INSTALL \
 Makefile.in \
 aclocal.m4 \
 depcomp \
 doc/Makefile.in \
 doc/mdate-sh \
 doc/texinfo.tex \
 examples/Makefile.in \
 gnulib/Makefile.in \
 gnulib/lib/Makefile.in \
 install-sh \
 missing \
 mkinstalldirs \
 src/Makefile.in \
 tests/Makefile.in \
 tests/ccheck/Makefile.in \
 tests/cppcheck/Makefile.in \
 tests/javacheck/Makefile.in \
 tests/misc/Makefile.in \
 ylwrap

include debian/debian-save-restore.mk

override_dh_clean:
	$(file-state-save)
	dh_clean
	rm -f config.guess config.sub

override_dh_auto_configure:
	# See patch 10. We have to regenerate ./configure
	cp -vf /usr/share/misc/config.sub .
	cp -vf /usr/share/misc/config.guess .
	autoreconf -vfi
	CFLAGS="$(CFLAGS)" ./configure $(CONF_FLAGS)

binary-arch: build install
	# target: binary-arch - Build architecture-dependent files
	$(file-state-restore)
	# remove central info "dir", handled by install-info
	rm -f debian/$(PACKAGE)/usr/share/info/dir*
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installexamples
	dh_installman
	dh_installinfo
	dh_installchangelogs ChangeLog
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-arch

%:
	dh $@

.PHONY: binary binary-arch

# End of file
