exercism/c/hello-world/makefile

26 lines
542 B
Makefile

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_hello_world.c src/hello_world.c src/hello_world.h
@echo Compiling $@
@$(CC) $(CFLAGS) src/hello_world.c test/vendor/unity.c test/test_hello_world.c -o tests.out