-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (37 loc) · 1.04 KB
/
Copy pathMakefile
File metadata and controls
49 lines (37 loc) · 1.04 KB
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 – HAX Multi-threaded File Compression
# Build: make
# Run: make run
# Clean: make clean
CC = gcc
TARGET = hax
# Source files
SRCS = src/rle.c \
src/compress.c \
src/decompress.c \
src/gui.c
OBJS = $(SRCS:.c=.o)
# Flags
CFLAGS = -Wall -Wextra -O2 -Iinclude
LDFLAGS = -lraylib -lGL -lm -lpthread -ldl -lrt -lX11
.PHONY: all clean run test
all: $(TARGET)
$(TARGET): $(OBJS)
$(CC) $(OBJS) -o $@ $(LDFLAGS)
@echo "Build successful: ./$(TARGET)"
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
run: $(TARGET)
./$(TARGET)
# Quick CLI smoke-test (no GUI required)
test: $(TARGET)
@echo "=== Creating 1MB test file ==="
dd if=/dev/urandom of=/tmp/test_input.bin bs=1M count=1 2>/dev/null
@echo "=== Compressing ==="
./hax_cli /tmp/test_input.bin /tmp/test_output.hax
@echo "=== Decompressing ==="
./hax_cli -d /tmp/test_output.hax /tmp/test_restored.bin
@echo "=== Verifying integrity ==="
md5sum /tmp/test_input.bin /tmp/test_restored.bin
clean:
rm -f $(OBJS) $(TARGET) hax_cli
@echo "Cleaned."