[修改] 增加Linux编译环境,暂存。23.06.01

This commit is contained in:
2023-05-31 16:10:01 +00:00
parent 28316be1ad
commit 26dd495427
4 changed files with 97 additions and 5 deletions

40
Makefile Normal file
View File

@ -0,0 +1,40 @@
#==============================================================================#
# Path information
#==============================================================================#
LOCAL_DIR := $(strip $(shell pwd))
SDK_TOP := $(LOCAL_DIR)
CMAKE_DIR := $(LOCAL_DIR)/.cmake
OUTPUT_DIR ?= $(LOCAL_DIR)/output
INSTALL_DIR ?= $(LOCAL_DIR)/__install
#==============================================================================#
# Functions
#==============================================================================#
#==============================================================================#
# Variables
#==============================================================================#
MULTI_CORES ?= $(shell grep -c ^processor /proc/cpuinfo)
BUILD_ALL :=
CLEAN_ALL :=
#==============================================================================#
# Compile configure
#==============================================================================#
#==============================================================================#
# Target
#==============================================================================#
.PHONY: all $(BUILD_ALL) $(CLEAN_ALL)
all: check_env $(BUILD_ALL)
$(MAKE) -C $(CMAKE_DIR) -j$(MULTI_CORES)
check_env:
if [ ! -e $(CMAKE_DIR) ]; then \
mkdir -p $(CMAKE_DIR); \
cmake -G "Unix Makefiles" \
-DCMAKE_TOOLCHAIN_FILE:PATH=$(SDK_TOP)/scripts/cmake/toolchain.cmake \
-S $(LOCAL_DIR) -B $(CMAKE_DIR); \
fi;