forked from riyas-org/rf24pi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (40 loc) · 1.25 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#############################################################################
#
# Makefile for librf24 on Raspberry Pi
#
# License: GPL (General Public License)
# Author: gnulnulf <[email protected]>
# Date: 2013/02/07 (version 1.0)
#
# Description:
# ------------
# use make all and mak install to install the library
# You can change the install directory by editing the LIBDIR line
#
LIBDIR=/usr/local/lib
LIBNAME=librf24.so.1.0
# The recommended compiler flags for the Raspberry Pi
CCFLAGS=-Ofast -mfpu=vfp -mfloat-abi=hard -march=armv6zk -mtune=arm1176jzf-s
# make all
all: librf24
# Make the library
librf24: RF24.o gpio.o spi.o compatibility.o
g++ -shared -Wl,-soname,librf24.so.1 ${CCFLAGS} -o ${LIBNAME} compatibility.o gpio.o spi.o RF24.o
# Library parts
RF24.o: RF24.cpp
g++ -Wall -fPIC ${CCFLAGS} -c RF24.cpp
gpio.o: gpio.cpp
g++ -Wall -fPIC ${CCFLAGS} -c gpio.cpp
spi.o: spi.cpp
g++ -Wall -fPIC ${CCFLAGS} -c spi.cpp
compatibility.o: compatibility.c
gcc -Wall -fPIC ${CCFLAGS} -c compatibility.c
# clear build files
clean:
rm -rf *o ${LIBNAME}
# Install the library to LIBPATH
install:
cp librf24.so.1.0 ${LIBDIR}/${LIBNAME}
ln -sf ${LIBDIR}/${LIBNAME} ${LIBDIR}/librf24.so.1
ln -sf ${LIBDIR}/${LIBNAME} ${LIBDIR}/librf24.so
ldconfig