1 Star 0 Fork 0

吴泽滨/HomeKitADK

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Makefile 1.76 KB
一键复制 编辑 原始数据 按行查看 历史
# Use "make TARGET=Linux all" to build for Linux
export
STEPS := all tests apps clean check info tools docs %.debug
.PHONY: $(STEPS) %.debug shell docker lint lint-changed
CWD := $(shell pwd)
HOST := $(shell uname)
NPROC :=
ifeq ($(HOST),Darwin)
NPROC = sysctl -n hw.physicalcpu
else
NPROC = nproc
endif
TARGET ?= $(HOST)
BUILD_TYPE ?= Debug
MAKE := make -f Build/Makefile -j $(shell $(NPROC))
DOCKER_EXE := DOCKER_BUILDKIT=0 docker
DOCKER ?= 1
DOCKERFILE := Build/Docker/Dockerfile
ifeq ($(TARGET),Raspi)
DOCKERFILE := Build/Docker/Dockerfile.Raspi
endif
ENABLE_TTY =
MAKE_DOCKER = $(DOCKER_EXE) build - < $(DOCKERFILE) | tee /dev/stderr | grep "Successfully built" | cut -d ' ' -f 3
RUN = $(DOCKER_EXE) run \
-e APPS \
-e BUILD_TYPE \
-e HOST \
-e LOG_LEVEL \
-e PROTOCOLS \
-e TARGET \
-e USE_HW_AUTH \
-e USE_NFC \
--cap-add=SYS_PTRACE \
--security-opt seccomp=unconfined \
--mount type=bind,source="$(CWD)",target=/build \
--rm \
-i $(ENABLE_TTY) `$(MAKE_DOCKER)`
ifeq ($(HOST)$(TARGET),LinuxDarwin)
$(error Can't build $(TARGET) on $(HOST).)
endif
ifneq ($(TARGET),Darwin)
ifneq (,$(wildcard /.dockerenv))
# If we are already running inside docker
MAKE := $(MAKE)
else ifeq ($(DOCKER),0)
MAKE := $(MAKE)
else
# Else run make inside docker
MAKE := $(RUN) $(MAKE)
endif
endif
define make_target
$(1):
@$(2) $$@
endef
$(eval $(foreach step,$(STEPS),$(call make_target,$(step),$(MAKE) PAL=$(TARGET))))
shell: ENABLE_TTY=-t
shell:
@$(RUN) bash
docker:
@$(MAKE_DOCKER)
# Lint (and correct) all files.
lint:
@Tools/linters/lint.sh -c
# Lint (and correct) all currently-changed files (according to git).
lint-changed:
@git diff-index --name-only HEAD \
| xargs printf -- '-f\0%s\0' \
| xargs -0 -- Tools/linters/lint.sh -Q -c
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zebin-wu/HomeKitADK.git
[email protected]:zebin-wu/HomeKitADK.git
zebin-wu
HomeKitADK
HomeKitADK
master

搜索帮助