Add c/word-count

This commit is contained in:
dwrz
2019-03-17 03:13:13 +00:00
parent cd8e5aaea6
commit 6f0dc97c53
8 changed files with 3039 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
CFLAGS = -std=c99
CFLAGS += -g
CFLAGS += -Wall
CFLAGS += -Wextra
CFLAGS += -pedantic
CFLAGS += -Werror
VFLAGS = --quiet
VFLAGS += --tool=memcheck
VFLAGS += --leak-check=full
VFLAGS += --error-exitcode=1
test: tests.out
@./tests.out
memcheck: tests.out
@valgrind $(VFLAGS) ./tests.out
@echo "Memory check passed"
clean:
rm -rf *.o *.out *.out.dSYM
tests.out: test/test_word_count.c src/word_count.c src/word_count.h
@echo Compiling $@
@$(CC) $(CFLAGS) src/word_count.c test/vendor/unity.c test/test_word_count.c -o tests.out