-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
41 lines (31 loc) · 976 Bytes
/
Makefile
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
ROOT_MAKEFILE_DIR := $(realpath $(dir $(realpath $(lastword $(MAKEFILE_LIST)))))
BUILD_DIR_BASE := $(ROOT_MAKEFILE_DIR)/build
LIB_BUILD_DIR := $(BUILD_DIR_BASE)
.DEFAULT_GOAL := all
cmake_config:
@if [ ! -d $(LIB_BUILD_DIR) ]; then \
echo "Generating CMake files"; \
cmake \
-B $(LIB_BUILD_DIR) \
-S $(ROOT_MAKEFILE_DIR) \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_TESTING_SYS_EX_CONF=ON \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_CTEST_ARGUMENTS="--verbose"; \
fi
all: cmake_config
@cmake --build $(LIB_BUILD_DIR)
lib: cmake_config
@cmake --build $(LIB_BUILD_DIR) --target sysexconf-lib
test: cmake_config
@cmake --build $(LIB_BUILD_DIR) --target test
format: cmake_config
@cmake --build $(LIB_BUILD_DIR) --target sysexconf-format
lint: cmake_config
@cmake --build $(LIB_BUILD_DIR) --target sysexconf-lint
clean:
@echo Cleaning up.
@rm -rf $(BUILD_DIR_BASE)
print-%:
@echo '$*=$($*)'
.PHONY: cmake_config all lib test format lint clean