From 37406db3d3d5927545b9782978d9420b6427436a Mon Sep 17 00:00:00 2001 From: TMRh20 Date: Sun, 18 May 2014 07:01:38 -0600 Subject: [PATCH] Update makefile and examples Update makefile and examples per https://github.com/TMRh20/RF24/issues/6 --- RPi/RF24Network/Makefile | 23 ++++++++++++---------- RPi/RF24Network/README.md | 4 ++-- RPi/RF24Network/examples/helloworld_rx.cpp | 4 ++-- RPi/RF24Network/examples/helloworld_tx.cpp | 4 ++-- RPi/RF24Network/examples/rx-test.cpp | 4 ++-- RPi/readme.md | 4 ++-- 6 files changed, 23 insertions(+), 20 deletions(-) diff --git a/RPi/RF24Network/Makefile b/RPi/RF24Network/Makefile index ed01fd0b..0fefb222 100644 --- a/RPi/RF24Network/Makefile +++ b/RPi/RF24Network/Makefile @@ -1,6 +1,6 @@ ############################################################################# # -# Makefile for librf24-bcm on Raspberry Pi +# Makefile for librf24network-bcm on Raspberry Pi # # License: GPL (General Public License) # Author: Charles-Henri Hallard @@ -21,16 +21,14 @@ LIB_RFN=librf24network # shared library name LIBNAME_RFN=$(LIB_RFN).so.1.0 -LIB_RF24=librf24-bcm -# shared library name -LIBNAME_RF24=$(LIB_RF24).so.1.0 +HEADER_DIR=${PREFIX}/include/RF24Network # The recommended compiler flags for the Raspberry Pi CCFLAGS=-Ofast -mfpu=vfp -mfloat-abi=hard -march=armv6zk -mtune=arm1176jzf-s # make all # reinstall the library after each recompilation -all: librf24network install-rf24n +all: librf24network # Make the library librf24network: RF24Network.o @@ -42,11 +40,13 @@ RF24Network.o: RF24Network.cpp # clear build files clean: - rm -rf *.o ${LIB_RF24}.* ${LIB_RFN}.* + rm -rf *.o ${LIB_RFN}.* + +install: all install-libs install-headers # Install the library to LIBPATH -.PHONY: install-rf24n -install-rf24n: + +install-libs: @echo "[Install]" @if ( test ! -d $(PREFIX)/lib ) ; then mkdir -p $(PREFIX)/lib ; fi @install -m 0755 ${LIBNAME_RFN} ${LIBDIR} @@ -54,5 +54,8 @@ install-rf24n: @ln -sf ${LIBDIR}/${LIBNAME_RFN} ${LIBDIR}/${LIB_RFN}.so @ldconfig -install: install-rf24n - @echo "[Install]" +install-headers: + @echo "[Installing Headers]" + @if ( test ! -d ${HEADER_DIR} ) ; then mkdir -p ${HEADER_DIR} ; fi + @install -m 0644 *.h ${HEADER_DIR} + diff --git a/RPi/RF24Network/README.md b/RPi/RF24Network/README.md index dd561d9d..c88ac1f9 100644 --- a/RPi/RF24Network/README.md +++ b/RPi/RF24Network/README.md @@ -63,9 +63,9 @@ C. Copy the RF24Network folder to the current directory, and delete the rest D. Build the library - sudo make + sudo make install cd examples - sudo make + make sudo ./helloworld_rx OR sudo ./helloworld_tx diff --git a/RPi/RF24Network/examples/helloworld_rx.cpp b/RPi/RF24Network/examples/helloworld_rx.cpp index ce519f73..4f0228a7 100644 --- a/RPi/RF24Network/examples/helloworld_rx.cpp +++ b/RPi/RF24Network/examples/helloworld_rx.cpp @@ -13,8 +13,8 @@ #include #include -#include "../RF24/RF24.h" -#include "./RF24Network.h" +#include +#include #include #include #include diff --git a/RPi/RF24Network/examples/helloworld_tx.cpp b/RPi/RF24Network/examples/helloworld_tx.cpp index 9c0a75ed..c1c2f9df 100644 --- a/RPi/RF24Network/examples/helloworld_tx.cpp +++ b/RPi/RF24Network/examples/helloworld_tx.cpp @@ -13,8 +13,8 @@ #include #include -#include "../RF24/RF24.h" -#include "./RF24Network.h" +#include +#include #include #include #include diff --git a/RPi/RF24Network/examples/rx-test.cpp b/RPi/RF24Network/examples/rx-test.cpp index d62c3095..aca057d6 100644 --- a/RPi/RF24Network/examples/rx-test.cpp +++ b/RPi/RF24Network/examples/rx-test.cpp @@ -1,7 +1,7 @@ #include #include -#include "../RF24/RF24.h" -#include "./RF24Network.h" +#include +#include #include #include /*#include */ diff --git a/RPi/readme.md b/RPi/readme.md index dd561d9d..c88ac1f9 100644 --- a/RPi/readme.md +++ b/RPi/readme.md @@ -63,9 +63,9 @@ C. Copy the RF24Network folder to the current directory, and delete the rest D. Build the library - sudo make + sudo make install cd examples - sudo make + make sudo ./helloworld_rx OR sudo ./helloworld_tx