mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-12-08 00:00:12 +03:00
59 lines
1.3 KiB
Makefile
Executable File
59 lines
1.3 KiB
Makefile
Executable File
#!/usr/bin/make -f
|
|
|
|
include /usr/share/dpkg/architecture.mk
|
|
include /usr/share/rustc/architecture.mk
|
|
|
|
export DH_VERBOSE=1
|
|
|
|
export DEB_HOST_RUST_TYPE DEB_HOST_GNU_TYPE
|
|
|
|
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
|
|
export CARGO=/usr/share/cargo/bin/cargo
|
|
export CARGO_HOME=$(CURDIR)/debian/cargo_home
|
|
export DEB_CARGO_CRATE=bcachefs-tools_$(DEB_VERSION_UPSTREAM)
|
|
|
|
NUMJOBS = 1
|
|
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
|
|
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
|
|
MAKEFLAGS += -j$(NUMJOBS)
|
|
endif
|
|
|
|
PREFIX := /usr
|
|
ROOT_SBINDIR := /usr/sbin
|
|
|
|
export PREFIX ROOT_SBINDIR
|
|
|
|
DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
|
|
|
|
ifeq ($(DEB_BUILD_ARCH),amd64)
|
|
DEB_BUILD_MAINT_OPTIONS += optimize=-lto
|
|
endif
|
|
|
|
export CARGO_ARGS = "--frozen"
|
|
|
|
%:
|
|
dh $@ --parallel --with dkms
|
|
|
|
override_dh_clean:
|
|
# HACK: breaks cargo checksumming by deleting some vendored files.
|
|
|
|
cargo_config:
|
|
rm -rf .cargo
|
|
mkdir -p .cargo
|
|
cp debian/cargo.config .cargo/config.toml
|
|
|
|
override_dh_auto_build:
|
|
$(MAKE) -f debian/rules cargo_config
|
|
dh_auto_build
|
|
|
|
override_dh_auto_clean:
|
|
$(MAKE) -f debian/rules cargo_config
|
|
dh_auto_clean
|
|
rm -rf .cargo
|
|
|
|
override_dh_usrlocal:
|
|
# FIXME: fails with
|
|
# dh_usrlocal: error: debian/bcachefs-tools/usr/local/libexec/bcachefsck_all is not a directory
|
|
|
|
override_dh_auto_test:
|