Files
fsnap/Makefile
Fabio Scotto di Santolo e5f5d559bc Add CRC-32 fingerprinting of symlink targets
Hash the followed target content with CRC-32 (hash.c/hash.h) and emit a FINGERPRINT field for non-directory records in create.c. Schema: TYPE|MODE|UID|GID|MTIME|SIZE|FINGERPRINT|TARGET per SPEC §17/§18.
2026-08-23 17:47:09 +02:00

45 lines
694 B
Makefile

CC := cc
CPPFLAGS := -Iinclude -MMD -MP
CFLAGS := -std=c11 -Wall -Wextra -Wpedantic -Wconversion
LDFLAGS :=
LDLIBS :=
BUILD_DIR := build
TARGET := $(BUILD_DIR)/fsnap
SOURCES := \
src/main.c \
src/utility.c \
src/types.c \
src/hash.c \
src/walk.c \
src/scan.c \
src/create.c \
src/list.c
OBJECTS := $(SOURCES:%.c=$(BUILD_DIR)/%.o)
DEPENDENCIES := $(OBJECTS:.o=.d)
.PHONY: all clean run
all: $(TARGET)
$(TARGET): $(OBJECTS) | $(BUILD_DIR)
$(CC) $(LDFLAGS) $(OBJECTS) $(LDLIBS) -o $@
$(BUILD_DIR)/%.o: %.c
@mkdir -p $(dir $@)
$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
$(BUILD_DIR):
mkdir -p $@
run: $(TARGET)
./$(TARGET)
clean:
rm -rf $(BUILD_DIR)
-include $(DEPENDENCIES)