#!/usr/bin/make -f ifeq (,$(filter terse,${DEB_BUILD_OPTIONS})) export DH_VERBOSE=1 export V=1 export VERBOSE=1 endif LC_ALL:=C export LC_ALL shellescape='$(subst ','\'',$(1))' shellexport=$(1)=$(call shellescape,${$(1)}) DEB_HOST_ARCH_OS?=$(shell dpkg-architecture -qDEB_HOST_ARCH_OS) DEB_CFLAGS_MAINT_APPEND+= -Wall -Wformat # not yet (needs to be checked upstream) DEB_CFLAGS_MAINT_APPEND+= -Wno-unused-but-set-variable DEB_CFLAGS_MAINT_APPEND+= -Wno-unused-result DEB_BUILD_MAINT_OPTIONS=hardening=+all include /usr/share/dpkg/buildflags.mk include /usr/share/dpkg/buildtools.mk DEFS+= -D'__IDSTRING(x,y)=static const char x[] __attribute__((__used__)) = y' DEFS+= -D'__RCSID(x)=__IDSTRING(rcsid,x)' DEFS+= -D'__SCCSID(x)=__IDSTRING(sccsid,x)' DEFS+= -D'__KERNEL_RCSID(x,y)=__IDSTRING(kernelrcsid_ \#\# x,y)' DEFS+= -D'__dead=__attribute__((__noreturn__))' DEFS+= -D'__packed=__attribute__((__packed__))' DEFS+= -D'_DIAGASSERT(x)=' DEFS+= -D'bswap16=__bswap_16' DEFS+= -D'bswap32=__bswap_32' DEFS+= -D'bswap64=__bswap_64' DEFS+= -DHAVE_STRUCT_STATVFS_F_IOSIZE=0 DEFS+= -DHAVE_STRUCT_STAT_ST_MTIMENSEC=0 DEFS+= -DHAVE_STRUCT_STAT_ST_FLAGS=0 DEFS+= -DHAVE_STRUCT_STAT_ST_GEN=0 DEFS+= -DS_ISTXT=S_ISVTX BMAKE_FLAGS:= BSDSRCDIR="$$_topdir/builddir" BMAKE_FLAGS+= GNUPORT=Yes # disable -Werror for package build (comment this out if developing) BMAKE_FLAGS+= NOGCCERROR=Yes %: dh $@ --builddirectory=builddir override_dh_auto_build-arch: dh_testdir -rm -rf builddir mkdir builddir cp -r src/* builddir/ ifeq (${DEB_HOST_ARCH_OS},hurd) mkdir -p builddir/usr.sbin/makefs/sys :>builddir/usr.sbin/makefs/sys/mount.h endif # bmake in Debian is pretty buggy _topdir=$$(pwd); cd builddir/usr.sbin/makefs; \ $(foreach i,CC CFLAGS LDFLAGS,$(call shellexport,$i)); \ CPPFLAGS=$(call shellescape,${CPPFLAGS} ${DEFS}); \ LDFLAGS="$$CFLAGS $$LDFLAGS"; \ export CC CFLAGS CPPFLAGS LDFLAGS; \ bmake -m /usr/share/bmake/mk-netbsd ${BMAKE_FLAGS} makefs test -x builddir/usr.sbin/makefs/makefs override_dh_auto_clean: dh_testdir -rm -rf builddir