-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (21 loc) · 692 Bytes
/
Copy pathMakefile
File metadata and controls
30 lines (21 loc) · 692 Bytes
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
BUILD_DIR ?= build
BUILD_TYPE ?= Release
JOBS ?= $(shell nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 1)
.PHONY: all configure build run test install clean distclean
all: build
configure:
cmake -S . -B $(BUILD_DIR) -DCMAKE_BUILD_TYPE=$(BUILD_TYPE)
build: configure
cmake --build $(BUILD_DIR) --parallel $(JOBS)
run: build
cd $(BUILD_DIR) && ./g-systemctl
test:
cmake -S . -B $(BUILD_DIR) -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DBUILD_TESTING=ON
cmake --build $(BUILD_DIR) --parallel $(JOBS)
ctest --test-dir $(BUILD_DIR) --output-on-failure
install: build
cmake --install $(BUILD_DIR)
clean:
cmake --build $(BUILD_DIR) --target clean
distclean:
rm -rf $(BUILD_DIR)