-
Notifications
You must be signed in to change notification settings - Fork 0
/
top.mk
61 lines (47 loc) · 1.71 KB
/
top.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
BUILD_SYSTEM_DIR ?= .
BUILD_DIR ?= build
CONFIG_DIR := $(BUILD_SYSTEM_DIR)/config
BUILD_TARGET_DIR := $(BUILD_DIR)/targets
BUILD_TEST_DIR := $(BUILD_DIR)/tests
BUILD_INTERMEDIATES_DIR := $(BUILD_DIR)/intermediates
BUILD_GENERATED_SRC_DIR := $(BUILD_DIR)/gensrcs
BUILD_LIBS_DIR := $(BUILD_DIR)/lib
BUILD_LINKER_SCRIPT_DIR := $(BUILD_DIR)/linker_script
BUILD_COMP_DB_FILE := compile_commands.json
BUILD_BINARY := $(BUILD_SYSTEM_DIR)/build_binary.mk
BUILD_SHARED_LIB := $(BUILD_SYSTEM_DIR)/build_shared_lib.mk
BUILD_STATIC_LIB := $(BUILD_SYSTEM_DIR)/build_static_lib.mk
BUILD_HOST_TEST := $(BUILD_SYSTEM_DIR)/build_host_test.mk
CLEAR_VARS := $(BUILD_SYSTEM_DIR)/clear_vars.mk
GREEN_BOLD_COLOR := \e[32;1m
RESET_COLOR := \e[39;0m
include $(BUILD_SYSTEM_DIR)/definitions.mk
SILENT ?= @
MKDIR := $(SILENT)mkdir -p
ECHO := $(SILENT)echo
RM := $(SILENT)rm
CP := $(SILENT)cp
MERGE_COMPDB := $(SILENT)$(BUILD_SYSTEM_DIR)/merge_compdb.py
GEN_COMPDB := $(SILENT)$(BUILD_SYSTEM_DIR)/gen_compdb.py
ALL_DB_FILES :=
#default rule, don't move
all: all_targets
.PHONY: all
# Builds all targets
all_targets:
.PHONY: all_targets
# Runs all tests
run_tests:
.PHONY: run_tests
tests:
.PHONY: tests
compdb: $(BUILD_COMP_DB_FILE)
.PHONY: compdb
# Merge partial compilation database files
$(BUILD_COMP_DB_FILE):
$(call print-build-header, COMP_DB,)
$(MERGE_COMPDB) --output $@ --files $^
clean:
$(ECHO) "Removing build directory"
$(RM) -rf $(BUILD_DIR)
include $(BUILD_SYSTEM_DIR)/gtest/build.mk