From ebc57bdc3f27338363335f83a4ce6cae0fdee7a7 Mon Sep 17 00:00:00 2001 From: TMRh20 Date: Wed, 4 Mar 2015 17:44:15 -0600 Subject: [PATCH] Fix example Makefile for non-RPi - Thanks to @desertgourd for identifying issue --- examples_RPi/Makefile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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