-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (22 loc) · 794 Bytes
/
Makefile
File metadata and controls
33 lines (22 loc) · 794 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
CXX := g++
CXXFLAGS := -std=c++17 -Wall -g \
-I/root/Documents/pcapplusplus-25.05-ubuntu-22.04-gcc-11.4.0-x86_64/include \
-I./include
LDFLAGS := -L/root/Documents/pcapplusplus-25.05-ubuntu-22.04-gcc-11.4.0-x86_64/lib \
-lPacket++ -lPcap++ -lCommon++ -lpcap -lpthread -lfftw3
SRC_DIRS := src src/utils src/parsers
BUILD_DIR := build
# main program source files
MAIN_SRCS := main.cpp $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.cpp))
MAIN_OBJS := $(patsubst %.cpp,$(BUILD_DIR)/%.o,$(MAIN_SRCS))
TARGET := pcap_parser
all: $(TARGET)
$(TARGET): $(MAIN_OBJS)
@echo "Linking $@ ..."
$(CXX) -o $@ $^ $(LDFLAGS)
$(BUILD_DIR)/%.o: %.cpp
@mkdir -p $(dir $@)
$(CXX) $(CXXFLAGS) -c $< -o $@
clean:
rm -rf $(BUILD_DIR) $(TARGET)
.PHONY: all clean