-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (27 loc) · 726 Bytes
/
Makefile
File metadata and controls
35 lines (27 loc) · 726 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
# Usage:
# make # Compile all binary
# make run # Run unix executable
# make clean # Removes binaries, objects, and target
# Compiler
CXX := g++
# Compiler flags
CXXFLAGS := -std=c++11 -Wall -Wextra -Wpedantic
# Finds source files
SOURCES := $(wildcard *.cpp)
# Performs string substitution on each source file
OBJECTS := $(patsubst %.cpp,%.o,$(SOURCES))
# Target executable
TARGET := AMH-MD5
# Build rule unix executable
$(TARGET): $(OBJECTS)
$(CXX) $(CXXFLAGS) $^ -o $(TARGET)
# Pattern rule that compiles every .cpp file into a .o file
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $<
# Convenience rule provided for quick execution
run: $(TARGET)
@./$<
.PHONY: clean
clean:
@echo "Cleaning..."
$(RM) core $(TARGET) *.o