-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (24 loc) · 792 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
########################################
#
# CMake wrapper commands for common uses
#
########################################
PROJECT_NAME:=learn-cmake
PROJECT_DIR:=$(shell cd -P -- '$(shell dirname -- "$0")' && pwd -P)
.PHONY: config build test help clean realclean eclipse-setup
config:
cd $(PROJECT_DIR) && cmake -S . -B ./build
build:
cd $(PROJECT_DIR) && cmake --build ./build
test:
cd $(PROJECT_DIR)/build/test && ctest --output-on-failure
help:
cd $(PROJECT_DIR) && cmake --build ./build --target help
clean:
cd $(PROJECT_DIR) && cmake --build ./build --target clean
realclean:
cd $(PROJECT_DIR) && rm -rf ./build
eclipse-setup:
cd $(PROJECT_DIR) && mkdir -p eclipse/$(PROJECT_NAME)
cd eclipse/$(PROJECT_NAME) && \
cmake "../../" -G"Eclipse CDT4 - Unix Makefiles"