-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
69 lines (54 loc) · 1.91 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
67
68
69
CXX = g++
GCC = gcc
#CXX = clang++
EXE = quicknii
IMGUI_DIR = ./include/imgui
IMPLOT_DIR = ./include/implot
NIFTI_DIR = ./include/nifti_clib
BUILD_DIR = ./build
$(shell mkdir -p $(BUILD_DIR))
SRC_DIR=./src
SOURCES = $(SRC_DIR)/main.cpp
SOURCES += $(SRC_DIR)/slider.cpp
SOURCES += $(SRC_DIR)/nifti_util.cpp
SOURCES += $(SRC_DIR)/gui.cpp
SOURCES += $(SRC_DIR)/vmr_io.c
SOURCES += $(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_draw.cpp $(IMGUI_DIR)/imgui_tables.cpp $(IMGUI_DIR)/imgui_widgets.cpp
SOURCES += $(IMGUI_DIR)/backends/imgui_impl_glfw.cpp $(IMGUI_DIR)/backends/imgui_impl_opengl3.cpp
SOURCES += $(IMPLOT_DIR)/implot.cpp $(IMPLOT_DIR)/implot_items.cpp
OBJS = $(addprefix $(BUILD_DIR)/, $(notdir $(addsuffix .o, $(basename $(SOURCES)))))
GCCFLAGS = -I./include
CXXFLAGS = -std=c++11 -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends -I$(IMPLOT_DIR) -I$(NIFTI_DIR) -I./include
CXXFLAGS += -g -Wall -Wformat
LIBS =
LIBS += -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo
LIBS += -L/usr/local/lib -L/opt/homebrew/lib -L./lib/nifti_clib -lniftiio -lznz -lz
#LIBS += -lglfw3
LIBS += -lglfw
LIBS += -lglew
CXXFLAGS += -I/usr/local/include -I/opt/local/include -I/opt/homebrew/include -O3
CFLAGS = $(CXXFLAGS)
##---------------------------------------------------------------------
## BUILD RULES
##---------------------------------------------------------------------
$(BUILD_DIR)/%.o:$(SRC_DIR)/%.c
$(GCC) $(GCCFLAGS) -c -o $@ $<
$(BUILD_DIR)/%.o:$(SRC_DIR)/%.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $<
$(BUILD_DIR)/%.o:$(IMPLOT_DIR)/%.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $<
$(BUILD_DIR)/%.o:$(IMGUI_DIR)/%.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $<
$(BUILD_DIR)/%.o:$(IMGUI_DIR)/backends/%.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $<
all: $(EXE)
@echo Build complete
$(EXE): $(OBJS)
$(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS)
clean:
rm -f $(EXE)
rm -rf $(BUILD_DIR)
install:
sudo cp $(EXE) /usr/local/bin
uninstall:
sudo rm -f /usr/local/bin/$(EXE)