From 7769983370d3f1ae8d938f2c48a48a3f663bab18 Mon Sep 17 00:00:00 2001 From: Jean-Michel Friedt Date: Tue, 1 Mar 2022 09:05:29 +0100 Subject: [PATCH] avoid testing Raspberry model when cross-compiling --- src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index 7e35ed7..b03021b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -5,7 +5,7 @@ STD_CFLAGS = -Wall -std=gnu99 -c -g UNAME := $(shell uname -m) # Determine Raspberry Pi version (if 2 or greater) -RPI_VERSION := $(shell cat /proc/device-tree/model | grep -a -o "Raspberry\sPi\s[0-9]" | grep -o "[0-9]") +RPI_VERSION := $(shell if [ -e /proc/device-tree/model ]; then cat /proc/device-tree/model | grep -a -o "Raspberry\sPi\s[0-9]" | grep -o "[0-9]"; else echo 4; fi) # Determine the hardware platform and set proper compilation flags ifeq ($(UNAME), armv6l)