-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
39 lines (31 loc) · 1 KB
/
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
39
############################################
# Makefile for the project "MacroDebugger" #
# #
# - - - - Created by Michele Dusi - - - - #
############################################
# Executable name file
OUTPUT = debugger_test
# Directories
SRCDIR = ./src
BINDIR = ./bin
INCDIR = ./include
OBJDIR = ./obj
# Compilation parameters
CC = g++
CFLAGS=-I$(INCDIR) -g -std=c++2a
# Names list for the compilation files
SOURCES := $(shell find $(SRCDIR) -name '*.cpp') # Sources ".cpp"
HEADERS := $(shell find $(INCDIR) -name '*.hpp') # Headers ".hpp"
OBJECTS := $(patsubst $(SRCDIR)/%.cpp, $(OBJDIR)/%.o, $(SOURCES)) # Objects ".o"
# Compiling of sources into obj files
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp $(HEADERS)
$(CC) $(CFLAGS) -c -o $@ $<
# Compiling and linking of the final executale file
$(BINDIR)/$(OUTPUT): $(OBJECTS)
$(CC) $(CFLAGS) -o $@ $^
# Cleaning of the compilation auxiliary files + of the executable
# Usage: "make clean"
.PHONY: clean
clean:
rm -f $(OBJDIR)/*.o
rm -f $(BINDIR)/*