-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
36 lines (28 loc) · 896 Bytes
/
makefile
File metadata and controls
36 lines (28 loc) · 896 Bytes
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 and flags
CXX = clang++
CXXFLAGS = -std=c++17 -O2 -g -pedantic \
-I./include -I./sciplot
# Directories
SRCDIR = src
OBJDIR = obj
BINDIR = .
# Executable name
TARGET = neural_network
# List your source files (only the .cpp filenames, no path)
SOURCES = main.cpp \
ForwardNeuralNetwork.cpp \
DataPreprocessing.cpp
# Construct the list of object files in obj/ matching each .cpp in src/
OBJECTS = $(patsubst %.cpp, $(OBJDIR)/%.o, $(SOURCES))
# Default rule: build the executable
all: $(TARGET)
# Link step: create the final binary from object files
$(TARGET): $(OBJECTS)
$(CXX) $(CXXFLAGS) -o $(BINDIR)/$(TARGET) $(OBJECTS)
# Compilation step: .cpp -> .o
# $< is the source file, $@ is the target .o file
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
# Clean up generated files
clean:
rm -f $(OBJDIR)/*.o $(BINDIR)/$(TARGET)