-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile.test
More file actions
48 lines (37 loc) · 1.1 KB
/
Copy pathMakefile.test
File metadata and controls
48 lines (37 loc) · 1.1 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
# Makefile for String Variable Test Suite
# Compiles only the necessary runtime components without SDL dependencies
CC = gcc
CFLAGS = -Wall -Wextra -g -Iinclude -Iinclude/actionmodern -Iinclude/libswf -Ilib/c-hashmap
LDFLAGS = -lm
# Source files
SOURCES = test_string_variables.c \
src/actionmodern/variables.c \
src/actionmodern/action.c \
src/utils.c \
lib/c-hashmap/map.c
# Object files
OBJECTS = $(SOURCES:.c=.o)
# Target executable
TARGET = test_string_variables
# Build rules
all: $(TARGET)
$(TARGET): $(OBJECTS)
$(CC) $(OBJECTS) $(LDFLAGS) -o $(TARGET)
@echo ""
@echo "Build successful! Run with:"
@echo " ./$(TARGET)"
@echo ""
@echo "Run with valgrind:"
@echo " valgrind --leak-check=full --show-leak-kinds=all ./$(TARGET)"
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -f $(OBJECTS) $(TARGET)
@echo "Cleaned build artifacts"
test: $(TARGET)
@echo "Running tests..."
@./$(TARGET)
valgrind: $(TARGET)
@echo "Running tests with valgrind..."
@valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes ./$(TARGET)
.PHONY: all clean test valgrind