@@ -1,22 +1,26 @@
|
|
1 |
-
APPNAME=
|
|
|
|
|
|
|
|
|
2 |
|
3 |
$(APPNAME): $(APPNAME).c
|
4 |
-
|
5 |
|
6 |
all: $(APPNAME) lint memcheck helgrind
|
7 |
|
8 |
.PHONY: lint
|
9 |
lint:
|
10 |
cpplint --filter=-readability/casting $(APPNAME).c
|
11 |
|
12 |
.PHONY: memcheck
|
13 |
memcheck:
|
14 |
valgrind --tool=memcheck ./$(APPNAME)
|
15 |
|
16 |
.PHONY: helgrind
|
17 |
helgrind:
|
18 |
valgrind --quiet --tool=helgrind ./$(APPNAME)
|
19 |
|
20 |
.PHONY: clean
|
21 |
clean:
|
22 |
rm -f $(APPNAME)
|
1 |
+
APPNAME=hello_ordered_semaphores
|
2 |
+
|
3 |
+
CC=cc
|
4 |
+
CFLAGS=-g -std=c11 -Wall -Wextra
|
5 |
+
LIBS=-pthread
|
6 |
|
7 |
$(APPNAME): $(APPNAME).c
|
8 |
+
$(CC) $(CFLAGS) $(APPNAME).c -o $(APPNAME) $(LIBS)
|
9 |
|
10 |
all: $(APPNAME) lint memcheck helgrind
|
11 |
|
12 |
.PHONY: lint
|
13 |
lint:
|
14 |
cpplint --filter=-readability/casting $(APPNAME).c
|
15 |
|
16 |
.PHONY: memcheck
|
17 |
memcheck:
|
18 |
valgrind --tool=memcheck ./$(APPNAME)
|
19 |
|
20 |
.PHONY: helgrind
|
21 |
helgrind:
|
22 |
valgrind --quiet --tool=helgrind ./$(APPNAME)
|
23 |
|
24 |
.PHONY: clean
|
25 |
clean:
|
26 |
rm -f $(APPNAME)
|