Makefile 847 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # ANSI C conformance
  2. CFLAGS += -ansi -pedantic-errors -Werror=pedantic -fno-asm -fno-common
  3. # Optimization
  4. CFLAGS += -O3
  5. # Additional warnings
  6. CFLAGS += -Wall -Wextra
  7. # To build shared object
  8. CFLAGS += -fPIC
  9. OBJFILES := schmidt_trigger.o ringbuf.o monotonic_queue.o
  10. OBJFILES += jump_rope_count_device.o
  11. include dylib.make
  12. all: $(DYLIB) demo/demo
  13. $(DYLIB): $(OBJFILES)
  14. cc -o $@ -shared $^
  15. schmidt_trigger.o: schmidt_trigger.c schmidt_trigger.h
  16. ringbuf.o: ringbuf.c ringbuf.h
  17. monotonic_queue.o: monotonic_queue.c monotonic_queue.h
  18. jump_rope_count_device.o: jump_rope_count_device.c \
  19. jump_rope_count_device.h monotonic_queue.h ringbuf.h schmidt_trigger.h
  20. .PHONY: clean
  21. clean:
  22. rm -v -f $(OBJFILES) $(DYLIB)
  23. make -C demo clean
  24. .PHONY: demo/demo
  25. demo/demo: $(DYLIB)
  26. make -C demo demo
  27. .PHONY: test
  28. test: demo/demo
  29. make -C data test