From: Joey Parrish Date: Sun, 30 Oct 2016 17:50:49 +0000 (-0700) Subject: Add CROSS_PREFIX var to make cross-compilation easier X-Git-Tag: archive/raspbian/1.68-2+rpi1~74^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e80175dc939f3bc556c621a8519c2d7de8f0edd1;p=pigpio.git Add CROSS_PREFIX var to make cross-compilation easier --- diff --git a/Makefile b/Makefile index 0344ff8..2341cf9 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,14 @@ # -CC = gcc -AR = ar -RANLIB = ranlib -SIZE = size -SHLIB = $(CC) -shared -STRIP = strip -STRIPLIB = $(STRIP) --strip-unneeded +# Set CROSS_PREFIX to prepend to all compiler tools at once for easier +# cross-compilation. +CROSS_PREFIX = +CC = $(CROSS_PREFIX)gcc +AR = $(CROSS_PREFIX)ar +RANLIB = $(CROSS_PREFIX)ranlib +SIZE = $(CROSS_PREFIX)size +STRIP = $(CROSS_PREFIX)strip +SHLIB = $(CC) -shared +STRIPLIB = $(STRIP) --strip-unneeded CFLAGS += -O3 -Wall -pthread