-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
64 lines (47 loc) · 1.08 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
EXE = analyticsTools
DEBUG = yes
CXX = g++
# dir
SRC_DIR = src
INC_DIR = inc
OBJ_DIR = obj
# sources
PROJ_SRC_LIST = main.cpp \
plot.cpp \
leastSquares.cpp \
signal.cpp \
interpolation.cpp \
method.cpp
# objects
PROJ_OBJ_LIST = $(PROJ_SRC_LIST:.cpp=.o)
#paths
PROJ_SRC = $(addprefix $(SRC_DIR)/, $(PROJ_SRC_LIST))
PROJ_OBJ = $(addprefix $(OBJ_DIR)/, $(PROJ_OBJ_LIST))
ifeq ($(DEBUG),yes)
CXXFLAGS += -std=c++11 -Wall -Wextra #-ansi -pedantic -g -Weffc++
else
CXXFLAGS += -std=c++11 -w -Wall -Werror -s -O2
endif
#libs
IFLAGS = -I./inc/
LFLAGS = -L./lib/
LDLIBS =
all : $(EXE)
#Creating .exe with .o
$(EXE) : $(PROJ_OBJ)
@$(CXX) $^ -o $@ $(LFLAGS) $(LDLIBS)
@echo "Compiling "$(EXE)
# Creating .o with .cpp and libs
$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp
@$(shell mkdir obj)
@$(CXX) $(CXXFLAGS) $(IFLAGS) -c -o $@ $<
@echo "Compiling" $<
clean :
@echo "Cleaning Object"
@$(shell rmdir /S /Q obj)
fclean : clean
@echo "Removing Binary"
@$(shell rm $(EXE))
re : fclean all
.PHONY : all, clean, fclean, re
.SILENT :