Makefile 862 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. CPPFLAGS := -I.. -Ifake -DF_CPU=8000000UL \
  2. -DTESTSUITE=1 -D_DEFAULT_SOURCE -DCONF_DEBUG=0
  3. CXXFLAGS := -std=c++17 -fconcepts -g -O2 -Wall -Wextra -Wno-unused-parameter -Wswitch-enum \
  4. -Wsuggest-attribute=noreturn -Wundef -Wpointer-arith \
  5. -Wcast-qual -Wlogical-op -Wshadow -Wconversion \
  6. -Wno-shift-negative-value
  7. CFLAGS :=
  8. LDFLAGS :=
  9. TESTS := test_common \
  10. test_fixpt \
  11. test_pid \
  12. test_scale \
  13. test_timer
  14. TEST_BINS := $(foreach t,$(TESTS),$(t).run)
  15. %.o: %.c test.h
  16. $(CXX) -o $@ -c $(CPPFLAGS) $(CXXFLAGS) $<
  17. test_%.run: test_%.o fake/fake.o
  18. $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $(LDFLAGS) $^
  19. all: $(TEST_BINS)
  20. ./test_common.run
  21. ./test_timer.run
  22. ./test_fixpt.run
  23. ./test_pid.run
  24. ./test_scale.run
  25. @echo
  26. @echo "All test succeeded"
  27. clean:
  28. rm -f *.o
  29. rm -f fake/*.o
  30. rm -f $(TEST_BINS)
  31. .PHONY: all clean