-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (25 loc) · 737 Bytes
/
Makefile
File metadata and controls
34 lines (25 loc) · 737 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 := -g -Wall -Wextra -std=gnu99
.PHONY: all run
all: test_s.out test_ms.out test_ns.out test_mis.out
run: test_s.out test_ms.out test_ns.out test_mis.out
@echo "## Seconds test"
./test_s.out
@echo "## Milli-seconds test"
./test_ms.out
@echo "## Micro-seconds test"
./test_mis.out
@echo "## Nano-seconds test"
./test_ns.out
test_s.out: test.c timer.o
$(CC) $(CFLAGS) $^ -o $@ -DUNITS="s"
test_ms.out: test.c timer.o
$(CC) $(CFLAGS) $^ -o $@ -DUNITS="ms"
test_ns.out: test.c timer.o
$(CC) $(CFLAGS) $^ -o $@ -DUNITS="us"
test_mis.out: test.c timer.o
$(CC) $(CFLAGS) $^ -o $@ -DUNITS="ns"
timer.o: timer.c timer.h
$(CC) $(CFLAGS) -c $<
clean:
$(RM) *.o test_s.out test_ms.out test_ns.out test_mis.out