diff --git a/examples_RPi/Makefile b/examples_RPi/Makefile index af3fd6bc..e4f61852 100644 --- a/examples_RPi/Makefile +++ b/examples_RPi/Makefile @@ -13,9 +13,18 @@ # prefix := /usr/local +# Detect the Raspberry Pi from cpuinfo +#Count the matches for BCM2708 or BCM2709 in cpuinfo +RPI=$(shell cat /proc/cpuinfo | grep Hardware | grep -c BCM2708) +ifneq "${RPI}" "1" +RPI=$(shell cat /proc/cpuinfo | grep Hardware | grep -c BCM2709) +endif + +ifeq "$(RPI)" "1" # The recommended compiler flags for the Raspberry Pi -CCFLAGS=-Ofast -mfpu=vfp -mfloat-abi=hard -march=armv6zk -mtune=arm1176jzf-s -#CCFLAGS= +CCFLAGS=-Ofast -mfpu=vfp -mfloat-abi=hard -march=armv6zk -mtune=arm1176jzf-s -std=c++0x +endif + # define all programs PROGRAMS = rx-test helloworld_rx helloworld_tx