加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Makefile 1.64 KB
一键复制 编辑 原始数据 按行查看 历史
海卫哥 提交于 2023-07-25 00:13 . tidy: 添加文件头
#
# .============.
# // M A K E / \
# // C++ DEV / \
# // E A S Y / \/ \
# ++ ----------. \/\ .
# \\ \ \ /\ /
# \\ \ \ /
# \\ \ \ /
# -============'
#
# Copyright (c) 2018 Hevake and contributors, all rights reserved.
#
# This file is part of cpp-tbox (https://github.com/cpp-main/cpp-tbox)
# Use of this source code is governed by MIT license that can be found
# in the LICENSE file in the root of the source tree. All contributing
# project authors may be found in the CONTRIBUTORS.md file in the root
# of the source tree.
#
include build_env.mk
include version.mk
.PHONY: all 3rd-party modules examples test clean distclean print
CCFLAGS := -Wall
RELEASE ?= 0
ENABLE_ASAN ?= 0
ENABLE_GPROF ?= 0
CCFLAGS += \
-DTBOX_VERSION_MAJOR=$(TBOX_VERSION_MAJOR) \
-DTBOX_VERSION_MINOR=$(TBOX_VERSION_MINOR) \
-DTBOX_VERSION_REVISION=$(TBOX_VERSION_REVISION)
ifeq ($(RELEASE), 1)
CCFLAGS += -O2 -Os
else
CCFLAGS += -DDEBUG=1 -O0 -ggdb
ifeq ($(ENABLE_ASAN), 1)
CCFLAGS += -fsanitize=address -fno-omit-frame-pointer
LDFLAGS += -fsanitize=address -static-libasan
endif
ifeq ($(ENABLE_GPROF), 1)
CCFLAGS += -pg
LDFLAGS += -pg
endif
endif
CXXFLAGS := $(CCFLAGS) $(CXXFLAGS)
CFLAGS := $(CCFLAGS) $(CFLAGS)
APPS_DIR := $(PWD)
export CC CXX CFLAGS CXXFLAGS LDFLAGS APPS_DIR
export MODULES THIRDPARTY
include config.mk
all: 3rd-party modules test examples
print:
@echo "CXXFLAGS = $(CXXFLAGS)"
@echo "LDFLAGS = $(LDFLAGS)"
modules 3rd-party:
$(MAKE) -C $@
test: modules
$(MAKE) -C modules test
examples: modules
$(MAKE) -C $@
clean:
-rm -rf $(BUILD_DIR)
distclean: clean
-rm -rf $(STAGING_DIR) $(INSTALL_DIR)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化