From c5a950e0905204f652b8a57eb1db5c3443015fc8 Mon Sep 17 00:00:00 2001 From: Giulio Benetti Date: Wed, 8 Dec 2021 03:38:49 +0100 Subject: [PATCH 1/2] Makefile: allow to override CC to cross-compile When cross-compiling we need to specify a compiler different from "gcc". So let's make possible to override CC while calling make like: ``` CC=arm-linux-gcc make ``` Signed-off-by: Giulio Benetti --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4944127..e246b91 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ # Tools -CC = gcc +CC ?= gcc # Project From 03dfc8851b55edeb400b923703b30b548cc2d70b Mon Sep 17 00:00:00 2001 From: Giulio Benetti Date: Wed, 8 Dec 2021 03:39:52 +0100 Subject: [PATCH 2/2] Makefile: allow to override PKG_CONFIG to cross-compile When cross-compiling we need to specify a pkg-config different from host pkg-config. So let's make possible to override CC while calling make like: ``` PKG_CONFIG=/path/path/pkg-config make ``` Signed-off-by: Giulio Benetti --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e246b91..d74967d 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,7 @@ # Tools CC ?= gcc +PKG_CONFIG ?= pkg-config # Project @@ -36,8 +37,8 @@ DEPS = $(SOURCES:.c=.d) # Compiler CFLAGS += -Wunused-variable -Iinclude -CFLAGS += $(shell pkg-config --cflags libdrm) -LDFLAGS = $(shell pkg-config --libs libdrm) +CFLAGS += $(shell $(PKG_CONFIG) --cflags libdrm) +LDFLAGS = $(shell $(PKG_CONFIG) --libs libdrm) # Produced files