-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
67 lines (54 loc) · 1.98 KB
/
Copy pathMakefile
File metadata and controls
67 lines (54 loc) · 1.98 KB
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
62
63
64
65
66
67
#=============================================================================
#============================= Variable Section ==============================
#=============================================================================
# Show Compile Log
VERBOSE := OFF
# CMAKE_EXPORT_COMPILE_COMMANDS
EXPORT_COMPILE_COMMANDS := ON
# Select Build Type( Debug | Release )
BUILD_TYPE := Debug
# Generator( "Unix Makefiles" | ... )
GENERATOR := "Unix Makefiles"
# Top CMakeLists.txt Path
HOME_DIR := .
# CMake Build System Path
BUILD_DIR := build
# Target
target := all
#=============================================================================
#========================== Custom Target Section ============================
#=============================================================================
#=============================================================================
# Config & Build
all: config
cmake --build $(BUILD_DIR) --target $(target)
.PHONY : all
#=============================================================================
# Generate CMake Build System
config:
cmake -B$(BUILD_DIR) -H$(HOME_DIR) -G $(GENERATOR) \
-DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DCMAKE_VERBOSE_MAKEFILE=$(VERBOSE) \
-DCMAKE_EXPORT_COMPILE_COMMANDS=$(EXPORT_COMPILE_COMMANDS)
.PHONY : config
#=============================================================================
# Help
help: config
cmake --build $(BUILD_DIR) --target help
@echo [ Usage ]
@echo "make target=[Target Name]"
.PHONY : clean
#=============================================================================
# Remove CMake Build System
remove:
cmake -E remove_directory $(BUILD_DIR)
.PHONY : remove
#=============================================================================
# Clean & Build
rebuild:
cmake --build $(BUILD_DIR) --clean-first --target $(TARGET)
.PHONY : rebuild
#=============================================================================
# Clean All
clean:
cmake --build $(BUILD_DIR) --target clean
.PHONY : clean