@@ -1,26 +1,32 @@
|
|
1 |
-
APPNAME
|
|
|
2 |
|
3 |
CC=cc
|
4 |
-
CFLAGS=-g -std=
|
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)
|
1 |
+
APPNAME=$(shell basename $(shell pwd))
|
2 |
+
APPARGS=3 2 0 100 0 750
|
3 |
|
4 |
CC=cc
|
5 |
+
CFLAGS=-g -std=gnu11 -Wall -Wextra
|
6 |
LIBS=-pthread
|
7 |
|
8 |
+
|
9 |
$(APPNAME): $(APPNAME).c
|
10 |
$(CC) $(CFLAGS) $(APPNAME).c -o $(APPNAME) $(LIBS)
|
11 |
|
12 |
all: $(APPNAME) lint memcheck helgrind
|
13 |
|
14 |
.PHONY: lint
|
15 |
lint:
|
16 |
cpplint --filter=-readability/casting $(APPNAME).c
|
17 |
|
18 |
.PHONY: memcheck
|
19 |
memcheck:
|
20 |
+
valgrind --tool=memcheck ./$(APPNAME) $(APPARGS)
|
21 |
|
22 |
.PHONY: helgrind
|
23 |
helgrind:
|
24 |
+
valgrind --quiet --tool=helgrind ./$(APPNAME) $(APPARGS)
|
25 |
+
|
26 |
+
.PHONY: gitignore
|
27 |
+
gitignore:
|
28 |
+
echo $(APPNAME) > .gitignore
|
29 |
|
30 |
.PHONY: clean
|
31 |
clean:
|
32 |
rm -f $(APPNAME)
|