-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (25 loc) · 693 Bytes
/
Makefile
File metadata and controls
34 lines (25 loc) · 693 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
34
CC = gcc
CFLAGS = -Wall -Wextra -O2 -g
TARGET = test_toonc
LIBS = -lm
all: $(TARGET) libtoonc.a
# Target for the main test executable
$(TARGET): test_toonc.c toonc.c
$(CC) $(CFLAGS) -o $(TARGET) test_toonc.c toonc.c $(LIBS)
# Target for the static library
libtoonc.a: toonc.o
ar rcs libtoonc.a toonc.o
toonc.o: toonc.c toonc.h
$(CC) $(CFLAGS) -c toonc.c -o toonc.o
# Run the main test program
run: $(TARGET)
./$(TARGET)
# Run the examples
run-examples: libtoonc.a
$(MAKE) -C examples run
valgrind: $(TARGET)
valgrind --leak-check=full --show-leak-kinds=all ./$(TARGET)
clean:
rm -f $(TARGET) *.o libtoonc.a
$(MAKE) -C examples clean
.PHONY: all run run-examples valgrind clean