Makefile 989 B

12345678910111213141516171819202122232425262728293031
  1. # Copyright © 2014 Kosma Moczek <kosma@cloudyourcar.com>
  2. # This program is free software. It comes without any warranty, to the extent
  3. # permitted by applicable law. You can redistribute it and/or modify it under
  4. # the terms of the Do What The Fuck You Want To Public License, Version 2, as
  5. # published by Sam Hocevar. See the COPYING file for more details.
  6. CFLAGS = -g -Wall -Wextra -Werror -std=c99
  7. CFLAGS += -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_DARWIN_C_SOURCE
  8. CFLAGS += $(shell pkg-config --cflags check)
  9. LDLIBS += $(shell pkg-config --libs check)
  10. all: scan-build test example
  11. @echo "+++ All good."""
  12. test: tests
  13. @echo "+++ Running Check test suite..."
  14. ./tests
  15. scan-build: clean
  16. @echo "+++ Running Clang Static Analyzer..."
  17. scan-build --status-bugs --keep-going $(MAKE) tests
  18. clean:
  19. $(RM) tests example *.o
  20. tests: tests.o minmea.o
  21. example: example.o minmea.o
  22. tests.o: tests.c minmea.h
  23. minmea.o: minmea.c minmea.h
  24. .PHONY: all test scan-build clean