File: rules

package info (click to toggle)
makefs 20190105-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 1,680 kB
  • sloc: ansic: 29,881; makefile: 130
file content (72 lines) | stat: -rwxr-xr-x 2,077 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/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