-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·50 lines (39 loc) · 1.34 KB
/
Copy pathMakefile
File metadata and controls
executable file
·50 lines (39 loc) · 1.34 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
CXX := -c++ -std=c++17
# CXXFLAGS := -pedantic-errors -Wall -Wextra -Werror -Wno-unused-parameter -Wno-unused-function -Wconversion -Wno-sign-conversion -Wdouble-promotion
CXXFLAGS := -pedantic-errors -Wall -Wextra -Wno-unused-parameter -Wno-unused-function -Wconversion -Wno-sign-conversion -Wdouble-promotion
LDFLAGS := -L"./externals/lib" -lRNifti -lboost_timer
BUILD := ./build
BIN := ./bin
OBJ_DIR := $(BUILD)/objects
TARGET := main
INCLUDE := -I. -I"./externals/include/" -I"/usr/local/include/eigen3/"
SRC := \
$(wildcard ./src/*.cpp) \
OBJECTS := $(SRC:%.cpp=$(OBJ_DIR)/%.o)
DEPENDENCIES \
:= $(OBJECTS:.o=.d)
all: build $(BIN)/$(TARGET)
$(OBJ_DIR)/%.o: %.cpp
@mkdir -p $(@D)
$(CXX) $(CXXFLAGS) $(INCLUDE) -c $< -MMD -o $@
$(BIN)/$(TARGET): $(OBJECTS)
@mkdir -p $(@D)
$(CXX) $(CXXFLAGS) -o $(BIN)/$(TARGET) $^ $(LDFLAGS)
-include $(DEPENDENCIES)
.PHONY: all build clean debug release info
build:
@mkdir -p $(BIN)
@mkdir -p $(OBJ_DIR)
debug: CXXFLAGS += -DDEBUG -g3
debug: all
release: CXXFLAGS += -O3
release: all
clean:
-@rm -rvf $(BUILD)
-@rm -rvf $(BIN)
info:
@echo "[*] Application dir: ${BIN} "
@echo "[*] Object dir: ${OBJ_DIR} "
@echo "[*] Sources: ${SRC} "
@echo "[*] Objects: ${OBJECTS} "
@echo "[*] Dependencies: ${DEPENDENCIES}"