ProxMon/Makefile
2025-01-13 22:27:17 -05:00

36 lines
663 B
Makefile

CC = gcc
OUT_DIR = ./build
TARGET = ./bin/proxmon
SRC_DIRS = ./src
# Collect all C source files in the current directory
SRCS := $(shell find $(SRC_DIRS) -name '*.c')
# Generate object files in the build directory
OBJS := $(patsubst $(SRC_DIRS)/%.c, $(OUT_DIR)/%.o, $(SRCS))
INC_DIRS := $(shell find $(SRC_DIRS) -type d) $(INC_DIRS)
INC_FLAGS := $(addprefix -I,$(INC_DIRS))
CCFLAGS := $(INC_FLAGS)
./bin:
@mkdir -p ./bin
$(OUT_DIR):
@mkdir -p $@
$(OUT_DIR)/%.o: $(SRC_DIRS)/%.c | $(OUT_DIR)
$(CC) $(CCFLAGS) -c $< -o $@
$(TARGET): $(OBJS) | ./bin
$(CC) $(CCFLAGS) $(OBJS) -o $@
.PHONY: all clean
all: $(TARGET)
clean:
@rm -rf bin/ $(OUT_DIR)