forked from gabrieleballetti/string-art
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
46 lines (36 loc) · 1.07 KB
/
makefile
File metadata and controls
46 lines (36 loc) · 1.07 KB
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
45
46
TARGET = string-art
CXX = g++
CXXFLAGS = -std=c++17 \
-Werror -Wpointer-arith -Wcast-qual \
-Wno-missing-braces -Wempty-body -Wno-error=uninitialized \
-Wno-error=deprecated-declarations \
-Wno-error=unused-result \
-Wno-error=format-security \
-Wno-error=format \
-pedantic-errors -pedantic \
-O2 #-ggdb3
LD = g++ -o
LDFLAGS = -Wall -pedantic
SRCDIR = src
OBJDIR = obj
BINDIR = bin
SOURCES := $(wildcard $(SRCDIR)/*.cpp)
INCLUDES := $(wildcard $(SRCDIR)/*.h)
OBJECTS := $(SOURCES:$(SRCDIR)/%.cpp=$(OBJDIR)/%.o)
DEPENDS := $(SOURCES:$(SRCDIR)/%.cpp=$(OBJDIR)/%.d)
RM = rm -f
$(BINDIR)/$(TARGET): $(OBJECTS)
@$(LD) $@ $(LDFLAGS) $(OBJECTS)
@echo "Linking complete!"
-include $(DEPENDS)
$(OBJECTS): $(OBJDIR)/%.o : $(SRCDIR)/%.cpp
@$(CXX) $(CXXFLAGS) -MMD -MP -c $< -o $@
@echo "Compiled "$<" successfully!"
.PHONY: clean
clean:
@$(RM) $(OBJECTS)
@echo "Cleanup complete!"
.PHONY: remove
remove: clean
@$(RM) $(BINDIR)/$(TARGET)
@echo "Executable removed!"