-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (38 loc) · 953 Bytes
/
Copy pathMakefile
File metadata and controls
49 lines (38 loc) · 953 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# ========================
# Makefile for WMBus Decrypt Project (with OpenSSL)
# ========================
# Compiler
CXX := g++
# Compiler flags
CXXFLAGS := -std=c++17 -Wall -Wextra -O0 -Iinclude -g3
# Linker flags (OpenSSL)
LDFLAGS := -lssl -lcrypto
# Source files
SRC := src/main.cpp src/WMBusDecrypt.cpp
# Object files
OBJ := $(SRC:.cpp=.o)
# Output executable
TARGET := wmbus_decrypt
# ========================
# Default target
# ========================
all: $(TARGET)
# ========================
# Link object files to create executable
# ========================
$(TARGET): $(OBJ)
$(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS)
# ========================
# Compile .cpp to .o
# ========================
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
# ========================
# Clean build artifacts
# ========================
clean:
rm -f $(OBJ) $(TARGET)
# ========================
# Phony targets
# ========================
.PHONY: all clean