Makefile 796 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. # ANSI C conformance
  2. CFLAGS += -ansi -pedantic-errors -Werror=pedantic -fno-asm -fno-common
  3. # Optimization
  4. CFLAGS += -O3 -fipa-pta
  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. all: libjump.so demo/demo
  12. libjump.so: $(OBJFILES)
  13. cc -o $@ -shared $^
  14. schmidt_trigger.o: schmidt_trigger.c schmidt_trigger.h
  15. ringbuf.o: ringbuf.c ringbuf.h
  16. monotonic_queue.o: monotonic_queue.c monotonic_queue.h
  17. jump_rope_count_device.o: jump_rope_count_device.c \
  18. jump_rope_count_device.h monotonic_queue.h ringbuf.h schmidt_trigger.h
  19. .PHONY: clean
  20. clean:
  21. rm -v -f $(OBJFILES) libjump.so
  22. make -C demo clean
  23. .PHONY: demo/demo
  24. demo/demo: libjump.so
  25. make -C demo demo