Skip to content

Commit

Permalink
Update makefile and examples
Browse files Browse the repository at this point in the history
Update makefile and examples per nRF24/RF24#6
  • Loading branch information
TMRh20 committed May 18, 2014
1 parent fab8a65 commit 37406db
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 20 deletions.
23 changes: 13 additions & 10 deletions RPi/RF24Network/Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -42,17 +40,22 @@ 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}
@ln -sf ${LIBDIR}/${LIBNAME_RFN} ${LIBDIR}/${LIB_RFN}.so.1
@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}

4 changes: 2 additions & 2 deletions RPi/RF24Network/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
4 changes: 2 additions & 2 deletions RPi/RF24Network/examples/helloworld_rx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

#include <cstdlib>
#include <iostream>
#include "../RF24/RF24.h"
#include "./RF24Network.h"
#include <RF24/RF24.h>
#include <RF24Network/RF24Network.h>
#include <ctime>
#include <stdio.h>
#include <time.h>
Expand Down
4 changes: 2 additions & 2 deletions RPi/RF24Network/examples/helloworld_tx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

#include <cstdlib>
#include <iostream>
#include "../RF24/RF24.h"
#include "./RF24Network.h"
#include <RF24/RF24.h>
#include <RF24Network/RF24Network.h>
#include <ctime>
#include <stdio.h>
#include <time.h>
Expand Down
4 changes: 2 additions & 2 deletions RPi/RF24Network/examples/rx-test.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <cstdlib>
#include <iostream>
#include "../RF24/RF24.h"
#include "./RF24Network.h"
#include <RF24/RF24.h>
#include <RF24Network/RF24Network.h>
#include <ctime>
#include <stdio.h>
/*#include <rrd.h>*/
Expand Down
4 changes: 2 additions & 2 deletions RPi/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 37406db

Please sign in to comment.