Skip to content

Commit d25f2e7

Browse files
committed
makefile:add CROSS_COMPILE flags
Signed-off-by: ningmingxiao <[email protected]>
1 parent 65b2f2e commit d25f2e7

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,9 +547,9 @@ ifeq ($(GOOS),darwin)
547547
to_uname_m = $(foreach arch,$(1),$(shell echo $(arch) | sed 's/amd64/x86_64/'))
548548
else ifeq ($(GOOS),linux)
549549
# CC is required for cross-compiling on Linux.
550-
CC = $(call to_uname_m,$(GOARCH))-linux-gnu-gcc
551-
ifneq ($(NOCORSS),)
552-
CC = gcc
550+
CC = gcc
551+
ifneq ($(CROSS_COMPILE),)
552+
CC = $(call to_uname_m,$(GOARCH))-linux-gnu-gcc
553553
endif
554554
else ifeq ($(GOOS),windows)
555555
# artifact in zip format also provided for Windows.

website/content/en/docs/installation/source.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ cd lima
2222
make
2323
sudo make install
2424
```
25+
Build other platform:
26+
``` bash
27+
make CROSS_COMPILE=1
28+
sudo make install
29+
```
2530

2631
> **Note:** `sudo make install` is required unless you have write permissions for `/usr/local`. Otherwise, installation may fail.
2732

0 commit comments

Comments
 (0)