Ein Roboter mit bürstenlosem Antrieb, differenzial und NRF24L01 Funk. Großflächig gebaut um ein großes Solarpanel aufzunehmen. https://gitlab.informatik.hs-fulda.de/fdai5253/roboter
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

126 lines
3.9 KiB

  1. #############################################################################
  2. #
  3. # Makefile for librf24
  4. #
  5. # License: GPL (General Public License)
  6. # Author: Charles-Henri Hallard
  7. # Date: 2013/03/13
  8. #
  9. # Description:
  10. # ------------
  11. # use make all and make install to install the library
  12. #
  13. CONFIG_FILE=Makefile.inc
  14. REMOTE_ERROR="[ERROR] Remote machine not configured. Run configure with respective arguments."
  15. include $(CONFIG_FILE)
  16. # Objects to compile
  17. OBJECTS=RF24.o
  18. ifeq ($(DRIVER), MRAA)
  19. OBJECTS+=spi.o gpio.o compatibility.o
  20. else ifeq ($(DRIVER), RPi)
  21. OBJECTS+=spi.o bcm2835.o interrupt.o
  22. else ifeq ($(DRIVER), SPIDEV)
  23. OBJECTS+=spi.o gpio.o compatibility.o interrupt.o
  24. else ifeq ($(DRIVER), wiringPi)
  25. OBJECTS+=spi.o
  26. endif
  27. # make all
  28. # reinstall the library after each recompilation
  29. all: $(LIBNAME)
  30. # Make the library
  31. $(LIBNAME): $(OBJECTS)
  32. @echo "[Linking]"
  33. $(CC) $(SHARED_LINKER_FLAGS) $(CFLAGS) -o $(LIBNAME) $^ $(SHARED_LINKER_LIBS)
  34. # Library parts
  35. RF24.o: RF24.cpp
  36. $(CXX) -fPIC $(CFLAGS) -c $^
  37. bcm2835.o: $(DRIVER_DIR)/bcm2835.c
  38. $(CC) -fPIC $(CFLAGS) -c $^
  39. spi.o: $(DRIVER_DIR)/spi.cpp
  40. $(CXX) -fPIC $(CFLAGS) -c $^
  41. compatibility.o: $(DRIVER_DIR)/compatibility.c
  42. $(CC) -fPIC $(CFLAGS) -c $(DRIVER_DIR)/compatibility.c
  43. gpio.o: $(DRIVER_DIR)/gpio.cpp
  44. $(CXX) -fPIC $(CFLAGS) -c $(DRIVER_DIR)/gpio.cpp
  45. interrupt.o: $(DRIVER_DIR)/interrupt.c
  46. $(CXX) -fPIC $(CFLAGS) -c $(DRIVER_DIR)/interrupt.c
  47. # clear configuration files
  48. cleanconfig:
  49. @echo "[Cleaning configuration]"
  50. rm -rf $(CONFIG_FILE) utility/includes.h
  51. # clear build files
  52. clean:
  53. @echo "[Cleaning]"
  54. rm -rf *.o $(LIBNAME)
  55. $(CONFIG_FILE):
  56. @echo "[Running configure]"
  57. @./configure --no-clean
  58. install: all install-libs install-headers
  59. upload: all upload-libs upload-headers
  60. # Install the library to LIBPATH
  61. install-libs:
  62. @echo "[Installing Libs to $(LIB_DIR)]"
  63. @if ( test ! -d $(LIB_DIR) ); then mkdir -p $(LIB_DIR); fi
  64. @install -m 0755 $(LIBNAME) $(LIB_DIR)
  65. @orig=$(LIBNAME) && \
  66. for sl in $(LIBSYMLINKS); do \
  67. ln -sf $(LIB_DIR)/$${orig} $(LIB_DIR)/$${sl}; \
  68. orig=$${sl}; \
  69. done && \
  70. if [ "$(LIBDEPRECATE)" ]; then ln -sf $(LIB_DIR)/$${orig} $(LIB_DIR)/$(LIBDEPRECATE); fi
  71. ifneq ($(LDCONFIG),)
  72. @$(LDCONFIG)
  73. endif
  74. upload-libs:
  75. @echo "[Uploading Libs to $(REMOTE):$(REMOTE_LIB_DIR)]"
  76. ifeq ($(REMOTE),)
  77. @echo "$(REMOTE_ERROR)"
  78. @exit 1
  79. endif
  80. @ssh -q -t -p $(REMOTE_PORT) $(REMOTE) "mkdir -p $(REMOTE_LIB_DIR)"
  81. @scp -q -P $(REMOTE_PORT) $(LIBNAME) $(REMOTE):/tmp
  82. @ssh -q -t -p $(REMOTE_PORT) $(REMOTE) "sudo install -m 0755 /tmp/$(LIBNAME) $(REMOTE_LIB_DIR) &&" \
  83. " orig=$(LIBNAME) && for sl in $(LIBSYMLINKS); do sudo ln -sf $(REMOTE_LIB_DIR)/\$${orig} $(REMOTE_LIB_DIR)/\$${sl}; orig=\$${sl}; done &&" \
  84. " if [ "$(LIBDEPRECATE)" ]; then sudo ln -sf $(REMOTE_LIB_DIR)/\$${orig} $(REMOTE_LIB_DIR)/$(LIBDEPRECATE); fi &&" \
  85. " rm /tmp/$(LIBNAME)"
  86. ifneq ($(REMOTE_LDCONFIG),)
  87. @ssh -q -t -p $(REMOTE_PORT) $(REMOTE) "sudo $(REMOTE_LDCONFIG)"
  88. endif
  89. install-headers:
  90. @echo "[Installing Headers to $(HEADER_DIR)]"
  91. @mkdir -p $(HEADER_DIR)/$(DRIVER_DIR)
  92. @install -m 0644 *.h $(HEADER_DIR)
  93. @install -m 0644 $(DRIVER_DIR)/*.h $(HEADER_DIR)/$(DRIVER_DIR)
  94. @install -m 0644 $(ARCH_DIR)/*.h $(HEADER_DIR)/$(ARCH_DIR)
  95. upload-headers:
  96. @echo "[Uploading Headers to $(REMOTE):$(REMOTE_HEADER_DIR)]"
  97. ifeq ($(REMOTE),)
  98. @echo "$(REMOTE_ERROR)"
  99. @exit 1
  100. endif
  101. @ssh -q -t -p $(REMOTE_PORT) $(REMOTE) "sudo mkdir -p $(REMOTE_HEADER_DIR)/$(DRIVER_DIR)"
  102. @ssh -q -t -p $(REMOTE_PORT) $(REMOTE) "mkdir -p /tmp/RF24 && rm -rf /tmp/RF24/*"
  103. @rsync -a --include="*.h" --include="*/" --exclude="*" -e "ssh -p $(REMOTE_PORT)" . $(REMOTE):/tmp/RF24
  104. @ssh -q -t -p $(REMOTE_PORT) $(REMOTE) "sudo install -m 0644 /tmp/RF24/*.h $(REMOTE_HEADER_DIR)"
  105. @ssh -q -t -p $(REMOTE_PORT) $(REMOTE) "sudo install -m 0644 /tmp/RF24/$(DRIVER_DIR)/*.h $(REMOTE_HEADER_DIR)/$(DRIVER_DIR)"
  106. @ssh -q -t -p $(REMOTE_PORT) $(REMOTE) "sudo install -m 0644 /tmp/RF24/$(ARCH_DIR)/*.h $(REMOTE_HEADER_DIR)/$(ARCH_DIR)"
  107. @ssh -q -t -p $(REMOTE_PORT) $(REMOTE) "rm -rf /tmp/RF24"