-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (25 loc) · 685 Bytes
/
Makefile
File metadata and controls
34 lines (25 loc) · 685 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
CXX = g++
CXXFLAGS = -std=c++17 -O2 -I include
LDFLAGS = -lws2_32 -lz
SRC_DIR = src
INC_DIR = include
OBJ_DIR = .obj
# Find all cpp files in src directory
SRCS = $(wildcard $(SRC_DIR)/*.cpp)
# Generate object file names
OBJS = $(patsubst $(SRC_DIR)/%.cpp, $(OBJ_DIR)/%.o, $(SRCS))
TARGET = crypt-vault.exe
.PHONY: all clean
all: $(TARGET)
$(TARGET): $(OBJS)
$(CXX) $(OBJS) -o $@ $(LDFLAGS)
# Rule to compile cpp to obj
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp | $(OBJ_DIR)
$(CXX) $(CXXFLAGS) -c $< -o $@
# Create obj directory
$(OBJ_DIR):
mkdir -p $(OBJ_DIR)
clean:
-rm -rf $(OBJ_DIR)
-rm -f $(TARGET)
-rm -f make_output.txt gcc_v.txt check.txt find_paths.ps1 get_gcc_paths.ps1