mirror of
https://gitee.com/bianbu-linux/opensbi
synced 2025-04-23 14:27:08 -04:00
37 lines
892 B
Makefile
Executable file
37 lines
892 B
Makefile
Executable file
#!/usr/bin/make -f
|
|
# Always set CROSS_COMPILE, which also works for native builds.
|
|
export CROSS_COMPILE=riscv64-unknown-linux-gnu-
|
|
export ARCH=riscv
|
|
|
|
# Enable verbose build by default, disable when terse is specified.
|
|
ifeq (,$(filter terse,$(DEB_BUILD_OPTIONS)))
|
|
VERBOSE=1
|
|
else
|
|
VERBOSE=0
|
|
endif
|
|
|
|
# 检查是否在 Git 仓库中,并获取 commit ID
|
|
GIT_INSIDE := $(shell git rev-parse --is-inside-work-tree 2>/dev/null)
|
|
ifeq ($(GIT_INSIDE),true)
|
|
COMMIT_ID := $(shell git rev-parse --short HEAD)
|
|
endif
|
|
|
|
%:
|
|
dh $@
|
|
|
|
override_dh_auto_configure:
|
|
sed -i "s/XBS-Commit-Id:.*/XBS-Commit-Id: $(COMMIT_ID)/" debian/control
|
|
dh_auto_configure
|
|
|
|
override_dh_auto_build:
|
|
make \
|
|
V=$(VERBOSE) \
|
|
PLATFORM_DEFCONFIG=k1_defconfig \
|
|
PLATFORM=generic ; \
|
|
|
|
override_dh_installdocs:
|
|
dh_installdocs --exclude=doxygen.cfg
|
|
|
|
override_dh_install:
|
|
chmod -x build/platform/generic/firmware/fw_*.bin
|
|
dh_install
|