1 Star 0 Fork 56

taocccong/ability_idl_tool

forked from millerluo/ability_idl_tool 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
MakefileLinux 3.44 KB
一键复制 编辑 原始数据 按行查看 历史
# Copyright (c) 2023-2024 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
BOUNDS_CHECK_DIR := $(abspath ../../../third_party/bounds_checking_function)
INCLUDES = -I$(PWD) -I$(BOUNDS_CHECK_DIR)/include
CODEGEN_SOURCE_DIR := $(PWD)/codegen
CODEGEN_SOURCE := $(wildcard $(CODEGEN_SOURCE_DIR)/*.cpp)
CODEGEN_OBJ_DIR := $(BUILD_DIR)/codegen
CODEGEN_OBJS := $(addprefix $(CODEGEN_OBJ_DIR)/, $(patsubst %.cpp, %.o, $(notdir $(CODEGEN_SOURCE))))
METADATA_SOURCE_DIR := $(PWD)/metadata
METADATA_SOURCE := $(wildcard $(METADATA_SOURCE_DIR)/*.cpp)
METADATA_OBJ_DIR := $(BUILD_DIR)/metadata
METADATA_OBJS := $(addprefix $(METADATA_OBJ_DIR)/, $(patsubst %.cpp, %.o, $(notdir $(METADATA_SOURCE))))
PARSER_SOURCE_DIR := $(PWD)/parser
PARSER_SOURCE := $(wildcard $(PARSER_SOURCE_DIR)/*.cpp)
PARSER_OBJS_DIR := $(BUILD_DIR)/parser
PARSER_OBJS := $(addprefix $(PARSER_OBJS_DIR)/, $(patsubst %.cpp, %.o, $(notdir $(PARSER_SOURCE))))
AST_SOURCE_DIR := $(PWD)/ast
AST_SOURCE := $(wildcard $(AST_SOURCE_DIR)/*.cpp)
AST_OBJS_DIR := $(BUILD_DIR)/ast
AST_OBJS := $(addprefix $(AST_OBJS_DIR)/, $(patsubst %.cpp, %.o, $(notdir $(AST_SOURCE))))
UTIL_SOURCE_DIR := $(PWD)/util
UTIL_SOURCE := $(wildcard $(UTIL_SOURCE_DIR)/*.cpp)
UTIL_OBJS_DIR := $(BUILD_DIR)/util
UTIL_OBJS := $(addprefix $(UTIL_OBJS_DIR)/, $(patsubst %.cpp, %.o, $(notdir $(UTIL_SOURCE))))
BOUNDS_CHECK_SOURCE_DIR := $(abspath ../../../third_party/bounds_checking_function/src)
BOUNDS_CHECK_SOURCE := $(wildcard $(BOUNDS_CHECK_SOURCE_DIR)/*.c)
BOUNDS_CHECK_OBJS_DIR := $(BUILD_DIR)/bounds_checking_function
BOUNDS_CHECK_OBJS := $(addprefix $(BOUNDS_CHECK_OBJS_DIR)/, $(patsubst %.c, %.o, $(notdir $(BOUNDS_CHECK_SOURCE))))
MAIN_SOURCE := $(wildcard *.cpp)
MAIN_OBJS := $(addprefix $(BUILD_DIR)/, $(patsubst %.cpp, %.o, $(MAIN_SOURCE)))
all:$(TARGET)
$(TARGET) : $(BOUNDS_CHECK_OBJS) $(UTIL_OBJS) $(HASH_OBJS) $(AST_OBJS) $(PARSER_OBJS) $(CODEGEN_OBJS) $(METADATA_OBJS) $(MAIN_OBJS)
$(Q) $(CXX) $(CXXFLAGS) $(INCLUDES) $^ -o $@
$(Q) echo $(TARGET):build successful.
$(BUILD_DIR)/%.o : %.cpp
$(Q) mkdir -p $(BUILD_DIR)
$(Q) $(CXX) $(CXXFLAGS) $(INCLUDES) -c $^ -o $@
$(CODEGEN_OBJ_DIR)/%.o : $(CODEGEN_SOURCE_DIR)/%.cpp
$(Q) mkdir -p $(CODEGEN_OBJ_DIR)
$(Q) $(CXX) $(CXXFLAGS) $(INCLUDES) -c $^ -o $@
$(METADATA_OBJ_DIR)/%.o : $(METADATA_SOURCE_DIR)/%.cpp
$(Q) mkdir -p $(METADATA_OBJ_DIR)
$(Q) $(CXX) $(CXXFLAGS) $(INCLUDES) -c $^ -o $@
$(PARSER_OBJS_DIR)/%.o : $(PARSER_SOURCE_DIR)/%.cpp
$(Q) mkdir -p $(PARSER_OBJS_DIR)
$(Q) $(CXX) $(CXXFLAGS) $(INCLUDES) -c $^ -o $@
$(AST_OBJS_DIR)/%.o : $(AST_SOURCE_DIR)/%.cpp
$(Q) mkdir -p $(AST_OBJS_DIR)
$(Q) $(CXX) $(CXXFLAGS) $(INCLUDES) -c $^ -o $@
$(UTIL_OBJS_DIR)/%.o : $(UTIL_SOURCE_DIR)/%.cpp
$(Q) mkdir -p $(UTIL_OBJS_DIR)
$(Q) $(CXX) $(CXXFLAGS) $(INCLUDES) -c $^ -o $@
$(BOUNDS_CHECK_OBJS_DIR)/%.o : $(BOUNDS_CHECK_SOURCE_DIR)/%.c
$(Q) mkdir -p $(BOUNDS_CHECK_OBJS_DIR)
$(Q) $(CXX) $(CXXFLAGS) $(INCLUDES) -c $^ -o $@
clean:
$(Q) rm -rf $(TARGET) $(BUILD_DIR)
.PHONY:all clean
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/taocccong/ability_idl_tool.git
git@gitee.com:taocccong/ability_idl_tool.git
taocccong
ability_idl_tool
ability_idl_tool
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385