1 Star 0 Fork 69

zhangzikang/nestos-installer

forked from openEuler/nestos-installer 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Makefile 2.57 KB
一键复制 编辑 原始数据 按行查看 历史
duyiwei 提交于 2022-11-14 19:43 . upgrade to version 0.16.0
RELEASE ?= 0
RDCORE ?= 1
ifeq ($(RELEASE),1)
PROFILE ?= release
CARGO_ARGS = --release
STRIP_RDCORE ?= 0
else
PROFILE ?= debug
CARGO_ARGS = --features docgen
# In debug mode (most often used by devs/CI), we default to stripping
# `rdcore` because it's otherwise huge and in kola's default 1G VMs can
# cause ENOSPC. In release mode (most often used by Koji/Brew), we don't do
# this because the debuginfo gets split out anyway. In either profile,
# we allow overriding the default.
STRIP_RDCORE ?= 1
endif
ifeq ($(RDCORE),1)
CARGO_ARGS := $(CARGO_ARGS) --features rdcore
endif
.PHONY: all
all:
cargo build ${CARGO_ARGS}
ifneq ($(RDCORE),1)
rm -f target/$(PROFILE)/rdcore
endif
.PHONY: docs
docs: all data/example-config.yaml
PROFILE=$(PROFILE) docs/_cmd.sh
PROFILE=$(PROFILE) docs/_config-file.sh
target/${PROFILE}/nestos-installer pack man -C man
data/example-config.yaml: target/$(PROFILE)/nestos-installer Makefile
echo -e "# Sample installer config file\n# Automatically generated; do not edit\n" > $@
$< pack example-config >> $@
.PHONY: clean
clean:
cargo clean
.PHONY: install
install: install-bin install-data install-man install-scripts install-systemd install-dracut
.PHONY: install-bin
install-bin:
install -D -t ${DESTDIR}/usr/bin target/${PROFILE}/nestos-installer
.PHONY: install-data
install-data:
install -D -m 644 -t ${DESTDIR}/usr/share/nestos-installer data/example-config.yaml
.PHONY: install-man
install-man:
install -d ${DESTDIR}/usr/share/man/man8
$(foreach src,$(wildcard man/*.8),gzip -9c $(src) > ${DESTDIR}/usr/share/man/man8/$(notdir $(src)).gz && ) :
.PHONY: install-scripts
install-scripts:
install -D -t $(DESTDIR)/usr/libexec scripts/nestos-installer-disable-device-auto-activation scripts/nestos-installer-service
.PHONY: install-systemd
install-systemd:
install -D -m 644 -t $(DESTDIR)/usr/lib/systemd/system systemd/*.{service,target}
install -D -t $(DESTDIR)/usr/lib/systemd/system-generators systemd/nestos-installer-generator
.PHONY: install-dracut
install-dracut:
if test -f target/${PROFILE}/rdcore; then \
for x in dracut/*; do \
bn=$$(basename $$x); \
install -D -t $(DESTDIR)/usr/lib/dracut/modules.d/$${bn} $$x/*; \
done; \
if [ $(STRIP_RDCORE) -eq 1 ]; then \
cp target/${PROFILE}/rdcore target/${PROFILE}/rdcore.stripped; \
strip -g target/${PROFILE}/rdcore.stripped; \
install -D target/${PROFILE}/rdcore.stripped ${DESTDIR}/usr/lib/dracut/modules.d/50rdcore/rdcore; \
rm target/${PROFILE}/rdcore.stripped; \
else \
install -D -t ${DESTDIR}/usr/lib/dracut/modules.d/50rdcore target/${PROFILE}/rdcore; \
fi; \
fi
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangzikang1992/nestos-installer.git
git@gitee.com:zhangzikang1992/nestos-installer.git
zhangzikang1992
nestos-installer
nestos-installer
master

搜索帮助