-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
38 lines (28 loc) · 811 Bytes
/
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
TARGET = heston-pricing
CXX = g++
CXXFLAGS = -Wall -O3 -march=native -pedantic
LINKER = g++
# linking flags here
LFLAGS = -Wall -lm -lboost_program_options -lstdc++
# change these to proper directories where each file should be
SRCDIR = src
OBJDIR = obj
BINDIR = bin
SOURCES := $(wildcard $(SRCDIR)/*.cpp)
INCLUDES := $(wildcard $(SRCDIR)/*.hpp)
OBJECTS := $(SOURCES:$(SRCDIR)/%.cpp=$(OBJDIR)/%.o)
rm = rm -f
$(BINDIR)/$(TARGET): $(OBJECTS)
@$(LINKER) $(OBJECTS) $(LFLAGS) -o $@
@echo "Linking complete"
$(OBJECTS): $(OBJDIR)/%.o : $(SRCDIR)/%.cpp
@$(CXX) $(CXXFLAGS) -c $< -o $@
@echo "Compiled "$<" successfully"
.PHONY: clean
clean:
@$(rm) $(OBJDIR)/*.o
@echo "Cleanup complete"
.PHONY: remove
remove: clean
@$(rm) $(BINDIR)/$(TARGET)
@echo "Executable removed"