From ad06abd3ebb3f1cd94f97e24f0a09c570d396727 Mon Sep 17 00:00:00 2001 From: Ilya Lukin <4.shket@gmail.com> Date: Mon, 14 Aug 2023 17:01:16 +0300 Subject: [PATCH] Makefile: Added the ability to cross-compile --- Makefile | 2 +- README.md | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d365952..13be958 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ REVISION = 7 LIB = libcli.so LIB_STATIC = libcli.a -CC = gcc +CC = $(CROSS_COMPILE)gcc AR = ar ARFLAGS = rcs DEBUG = -g diff --git a/README.md b/README.md index 3dde870..9c63e84 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,20 @@ To compile: ```sh $ make -$ make install ``` +To cross-compile specify a triplet in variable `CROSS_COMPILE`: + +```sh +$ CROSS_COMPILE=machine-vendor-operatingsystem- make +```` + +To install: + +```sh +$ make install +```` + Note - as of version 1.10.5 you have a compile time decision on using select() or poll() in cli_loop(). The default is to use the legacy 'select()' call. If built with 'CFLAGS=-DLIBCLI_USE_POLL make' then the poll() system call will