Commit 1c78dd00 authored by TMRh20's avatar TMRh20

Merge pull request #179 from yozik04/master

RPI2 autodetection
parents bf06db96 b417d58c
...@@ -27,6 +27,11 @@ HEADER_DIR=${PREFIX}/include/RF24 ...@@ -27,6 +27,11 @@ HEADER_DIR=${PREFIX}/include/RF24
# The base location of support files for different devices # The base location of support files for different devices
ARCH_DIR=utility ARCH_DIR=utility
ARCH=armv6zk
ifeq "$(shell uname -m)" "armv7l"
ARCH=armv7-a
endif
# The default objects to compile # The default objects to compile
OBJECTS=RF24.o spi.o OBJECTS=RF24.o spi.o
...@@ -57,7 +62,7 @@ OBJECTS+=bcm2835.o ...@@ -57,7 +62,7 @@ OBJECTS+=bcm2835.o
OBJECTS+=interrupt.o OBJECTS+=interrupt.o
SHARED_LINKER_FLAGS+=-pthread SHARED_LINKER_FLAGS+=-pthread
# The recommended compiler flags for the Raspberry Pi # The recommended compiler flags for the Raspberry Pi
CCFLAGS=-Ofast -mfpu=vfp -mfloat-abi=hard -march=armv6zk -mtune=arm1176jzf-s CCFLAGS=-Ofast -mfpu=vfp -mfloat-abi=hard -march=$(ARCH) -mtune=arm1176jzf-s
else else
DRIVER_DIR=$(ARCH_DIR)/BBB DRIVER_DIR=$(ARCH_DIR)/BBB
......
...@@ -16,9 +16,14 @@ prefix := /usr/local ...@@ -16,9 +16,14 @@ prefix := /usr/local
# Detect the Raspberry Pi by the existence of the bcm_host.h file # Detect the Raspberry Pi by the existence of the bcm_host.h file
BCMLOC=/opt/vc/include/bcm_host.h BCMLOC=/opt/vc/include/bcm_host.h
ARCH=armv6zk
ifeq "$(shell uname -m)" "armv7l"
ARCH=armv7-a
endif
ifneq ("$(wildcard $(BCMLOC))","") ifneq ("$(wildcard $(BCMLOC))","")
# The recommended compiler flags for the Raspberry Pi # The recommended compiler flags for the Raspberry Pi
CCFLAGS=-Ofast -mfpu=vfp -mfloat-abi=hard -march=armv6zk -mtune=arm1176jzf-s CCFLAGS=-Ofast -mfpu=vfp -mfloat-abi=hard -march=$(ARCH) -mtune=arm1176jzf-s
endif endif
# define all programs # define all programs
......
...@@ -13,8 +13,13 @@ ...@@ -13,8 +13,13 @@
# #
prefix := /usr/local prefix := /usr/local
ARCH=armv6zk
ifeq "$(shell uname -m)" "armv7l"
ARCH=armv7-a
endif
# The recommended compiler flags for the Raspberry Pi # The recommended compiler flags for the Raspberry Pi
CCFLAGS=-Ofast -mfpu=vfp -mfloat-abi=hard -march=armv6zk -mtune=arm1176jzf-s CCFLAGS=-Ofast -mfpu=vfp -mfloat-abi=hard -march=$(ARCH) -mtune=arm1176jzf-s
#CCFLAGS= #CCFLAGS=
# define all programs # define all programs
......
...@@ -13,12 +13,17 @@ ...@@ -13,12 +13,17 @@
# #
prefix := /usr/local prefix := /usr/local
ARCH=armv6zk
ifeq "$(shell uname -m)" "armv7l"
ARCH=armv7-a
endif
# Detect the Raspberry Pi by the existence of the bcm_host.h file # Detect the Raspberry Pi by the existence of the bcm_host.h file
BCMLOC=/opt/vc/include/bcm_host.h BCMLOC=/opt/vc/include/bcm_host.h
ifneq ("$(wildcard $(BCMLOC))","") ifneq ("$(wildcard $(BCMLOC))","")
# The recommended compiler flags for the Raspberry Pi # The recommended compiler flags for the Raspberry Pi
CCFLAGS=-Ofast -mfpu=vfp -mfloat-abi=hard -march=armv6zk -mtune=arm1176jzf-s CCFLAGS=-Ofast -mfpu=vfp -mfloat-abi=hard -march=$(ARCH) -mtune=arm1176jzf-s
endif endif
# define all programs # define all programs
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment