forked from robjohnnoble/demon_model
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (27 loc) · 847 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
# Compiler settings for debugging
CXX = g++
CXXFLAGS = -Wall -g -O0 -std=c++11 -I include/methdemon -I /opt/homebrew/Cellar/boost/1.84.0/include/
LDFLAGS =
# Directories
SRCDIR = src
INCDIR = include/methdemon
BINDIR = bin
LOGDIR = logs
# Find all source files in the source directory
SOURCES = $(wildcard $(SRCDIR)/*.cpp)
# Replace .cpp from SOURCES with .o to get object files
OBJECTS = $(SOURCES:$(SRCDIR)/%.cpp=$(BINDIR)/%.o)
# Name of the executable
EXECUTABLE = $(BINDIR)/methdemon
# Makefile targets
all: $(LOGDIR) $(BINDIR) $(EXECUTABLE)
$(LOGDIR):
mkdir -p $(LOGDIR)
$(BINDIR):
mkdir -p $(BINDIR)
$(EXECUTABLE): $(OBJECTS)
$(CXX) $(LDFLAGS) -o $@ $^ 2>&1 | tee -a $(LOGDIR)/linking.log
$(BINDIR)/%.o: $(SRCDIR)/%.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@ 2>&1 | tee -a $(LOGDIR)/$(notdir $<).log
clean:
rm -rf $(BINDIR) $(LOGDIR)