-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (30 loc) · 725 Bytes
/
Makefile
File metadata and controls
39 lines (30 loc) · 725 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
37
38
39
# https://stackoverflow.com/a/25966957
BIN := bin
SRC := src
OBJ := objects
# These will be populated as we include the modules
apps :=
sources :=
objects :=
deps :=
include $(SRC)/solutions/module.mk
include $(SRC)/cpp/tests/module.mk
-include $(deps)
CXX := g++
CPPFLAGS := -I./src/cpp -I./src/cpp/thirdparty/eigen -MMD -MP
CXXFLAGS := -std=c++20 -O3 -march=native -pipe -Wall -Wextra -pedantic-errors
LDFLAGS :=
LDLIBS :=
# Link apps
$(BIN)/%: $(OBJ)/%.o
@mkdir -p $(@D)
$(CXX) $(LDFLAGS) $^ $(LDLIBS) -o $@
# Compile objects
$(OBJ)/%.o: $(SRC)/%.cpp
@mkdir -p $(@D)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
.PHONY: all
all: $(apps) $(objects)
.PHONY: clean
clean:
$(RM) -r $(BIN)/* $(OBJ)/*