APPNAME=$(shell basename $(shell pwd))
APPARGS=5 2 3 0 100 0 750
CC=cc
CFLAGS=-g -std=gnu11 -Wall -Wextra
LIBS=-pthread
$(APPNAME): $(APPNAME).c
$(CC) $(CFLAGS) $(APPNAME).c -o $(APPNAME) $(LIBS)
all: $(APPNAME) lint memcheck helgrind
.PHONY: lint
lint:
cpplint --filter=-readability/casting $(APPNAME).c
.PHONY: memcheck
memcheck:
valgrind --tool=memcheck ./$(APPNAME) $(APPARGS)
.PHONY: helgrind
helgrind:
valgrind --quiet --tool=helgrind ./$(APPNAME) $(APPARGS)
.PHONY: gitignore
gitignore:
echo $(APPNAME) > .gitignore
.PHONY: clean
clean:
rm -f $(APPNAME)