36 Star 169 Fork 71

WeBank/FATE

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Makefile 1.95 KB
一键复制 编辑 原始数据 按行查看 历史
weiwee 提交于 2023-12-28 11:28 . chore: fix makefile
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
mkfile_dir := $(dir $(mkfile_path))
.DEFAULT_GOAL:=help
##@ Dev
.PHONY: install-rust
install-rust_paillier: ## Install rust_paillier.
@echo "install fate_utils"
@cd ${mkfile_dir} && \
. venv/bin/activate.sh && \
maturin develop --release -m rust/fate_utils/Cargo.toml --target-dir build
##@ Build
.PHONY: build-rust
build-rust: ## Build fate_utils.
@echo "build fate_utils"
@cd ${mkfile_dir} && \
. ${mkfile_dir}venv/bin/activate && \
maturin build --release -m rust/fate_utils/crates/fate_utils/Cargo.toml --out dist --target-dir build
.PHONY: build-fate
build-fate: ## Build fate
@echo "build fate"
@cd ${mkfile_dir}/python && \
python3 setup.py sdist --formats=gztar -d ../dist
.PHONY: build ## Build all
build: build-rust_paillier build-fate
@echo "build all"
##@ Generate
.PHONY: gen-osx-proto
gen-osx-proto: ## Generate osx protobuf.
@cd ${mkfile_dir} && \
python3 -m grpc_tools.protoc --proto_path=proto/ \
--python_out=python/fate/arch/federation/backends/osx/ \
--grpc_python_out=python/fate/arch/federation/backends/osx/ \
proto/osx/osx.proto
.PHONY: gen-task-jsonschema
gen-task-jsonschema: ## Generate task jsonschema.
@cd ${mkfile_dir}/python && \
mkdir -p ${mkfile_dir}/schemas && \
python3 -c "from fate.components.core.spec.task import TaskConfigSpec; print(TaskConfigSpec.schema_json(indent=2))" >> \
${mkfile_dir}/schemas/task.schema.json
##@ Clean
.PHONY: clean
clean: ## Clean unused files.
@cd ${mkfile_dir} && \
rm -rf dist/ build/ rust/tensor/rust_paillier/target && \
find python -name '*.pyc' -exec rm -f {} \; && \
find python -name '__pycache__' -exec rm -rf {} \+ && \
find python -name '*.egg-info' -exec rm -rf {} \+
.PHONY: help
help:
@awk 'BEGIN {FS = ":.*##"; printf "Usage: make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-25s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/WeBank/FATE.git
[email protected]:WeBank/FATE.git
WeBank
FATE
FATE
master

搜索帮助