-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
44 lines (32 loc) · 729 Bytes
/
makefile
File metadata and controls
44 lines (32 loc) · 729 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
40
41
42
43
44
SOURCEDIR = src
OBJDIR = obj
# List of sources
SOURCES := $(wildcard $(SOURCEDIR)/*.cpp)
# List of objects
OBJECTS := $(SOURCES:$(SOURCEDIR)/%.cpp=$(OBJDIR)/%.o)
# List of dependencies
DEPS := $(OBJECTS:.o=.d)
# Compiler
CC = g++
# Compiler flags
CFLAGS = -std=c++17 -Wall -O2 -g
# Linker flags
LDFLAGS =
# Output
EXE = footprintAnalysis.linux
# Default rule
$(EXE): $(OBJECTS)
$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@
# Compile rule
$(OBJDIR)/%.o: $(SOURCEDIR)/%.cpp
@mkdir -p $(@D)
$(CC) $(CFLAGS) -c $< -o $@
# Rule for generating dependencies
$(OBJDIR)%.d: $(SRCDIR)%.cpp
@$(CC) $(CFLAGS)
# Clean rule
clean:
rm -f $(EXE) $(OBJECTS) $(DEPS)
# Automatic dependency graph generation
CFLAGS += -MMD
-include $(DEPS)