-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (25 loc) · 691 Bytes
/
Makefile
File metadata and controls
35 lines (25 loc) · 691 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
35
# Compiler and flags
CC := gcc
CFLAGS := -O2 -Wall -Wextra -std=c11
LDFLAGS := -lm
# Targets
TEST_TARGET := tests.out
TEST_SRC := tests.c
# Benchmarks
BENCHMARKS_TARGET := benchmarks.out
BENCHMARKS_SRC := benchmarks.c
# Default target
all: $(TEST_TARGET) $(BENCHMARKS_TARGET)
$(TEST_TARGET): $(TEST_SRC) microBLAS.h
$(CC) $(CFLAGS) -o $(TEST_TARGET) $(TEST_SRC) $(LDFLAGS)
# Run tests
run: $(TEST_TARGET)
./$(TEST_TARGET)
$(BENCHMARKS_TARGET): $(BENCHMARKS_SRC) microBLAS.h
$(CC) $(CFLAGS) -o $(BENCHMARKS_TARGET) $(BENCHMARKS_SRC) $(LDFLAGS)
benchmarks: $(BENCHMARKS_TARGET)
./$(BENCHMARKS_TARGET)
# Clean build files
clean:
rm -f $(TARGET)
.PHONY: all run clean