-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathMakefile
66 lines (47 loc) · 1.27 KB
/
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
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
default_target: all
.PHONY: default_target
# The CMake executable.
# CMAKE_COMMAND = "C:\Program Files\CMake\bin\cmake.exe"
CMAKE_COMMAND = cmake
TARGET = hazel
SOURCE_DIR = .
BUILD_DIR = build
GENERATOR = "MinGW Makefiles"
# Command-line flag to silence nested $(MAKE).
$(VERBOSE)MAKESILENT = -s
#Suppress display of executed commands.
$(VERBOSE).SILENT:
# PROCESS:
## 1. CMake Exec (generate the build files)
## 2. Run CMake Makefile
## 3. Run CXX compiled executable
all:
cmake -s $(SOURCE_DIR) -B $(BUILD_DIR) -G $(GENERATOR)
cd $(BUILD_DIR) && $(MAKE) && \
echo --------------------------------------------
echo --------------------------------------------
cd $(BUILD_DIR) && $(TARGET)
.PHONY: all
# Generate the CMake MinGW Makefiles
exec:
cmake -s $(SOURCE_DIR) -B $(BUILD_DIR) -G $(GENERATOR)
.PHONY: exec
make:
cd $(BUILD_DIR) && $(MAKE)
.PHONY: make
run:
cd $(BUILD_DIR) && $(TARGET)
.PHONY: run
clean:
@rmdir /Q /s $(BUILD_DIR) && mkdir $(BUILD_DIR)
.PHONY: clean
# ------------Minor Testing only -----------
COMPILER = g++
CPPSOURCE = test.cpp
# compiler flags:
# -g - adds debugging information to the executable file
# -Wall - used to turn on most compiler warnings
CFLAGS = -g -Wall
test:
g++ $(CFLAGS) $(CPPSOURCE) -o test && test
.PHONY: test