-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (23 loc) · 715 Bytes
/
Copy pathMakefile
File metadata and controls
34 lines (23 loc) · 715 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
# Compilador e flags
CXX = g++
CXXFLAGS = -Wall -Wextra -std=c++17 -Iinclude -Ithird-party/checksum
LDFLAGS = -lcryptopp
SRC_DIR = src
BUILD_DIR = build
SRCS = $(wildcard $(SRC_DIR)/*.cpp)
PROF_SRC = third-party/checksum/ext4checksum.cc
OBJS = $(patsubst $(SRC_DIR)/%.cpp,$(BUILD_DIR)/%.o,$(SRCS))
PROF_OBJ = $(BUILD_DIR)/ext4checksum.o
TARGET = ext4shell
all: $(TARGET)
$(TARGET): $(OBJS) $(PROF_OBJ)
$(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS)
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.cpp | $(BUILD_DIR)
$(CXX) $(CXXFLAGS) -c $< -o $@
$(BUILD_DIR)/ext4checksum.o: $(PROF_SRC) | $(BUILD_DIR)
$(CXX) $(CXXFLAGS) -c $< -o $@
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
clean:
rm -rf $(BUILD_DIR) $(TARGET)
.PHONY: all clean