Skip to content

Commit

Permalink
Add riscv64 build target (junegunn#2626)
Browse files Browse the repository at this point in the history
Build successfully on Arch Linux RISC-V.
  • Loading branch information
Xeonacid committed Oct 10, 2021
1 parent 2736a2f commit 5fc78e4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ BINARYARM6 := fzf-$(GOOS)_arm6
BINARYARM7 := fzf-$(GOOS)_arm7
BINARYARM8 := fzf-$(GOOS)_arm8
BINARYPPC64LE := fzf-$(GOOS)_ppc64le
BINARYRISCV64 := fzf-$(GOOS)_riscv64

# https://en.wikipedia.org/wiki/Uname
UNAME_M := $(shell uname -m)
Expand All @@ -59,6 +60,8 @@ else ifeq ($(UNAME_M),aarch64)
BINARY := $(BINARYARM8)
else ifeq ($(UNAME_M),ppc64le)
BINARY := $(BINARYPPC64LE)
else ifeq ($(UNAME_M),riscv64)
BINARY := $(BINARYRISCV64)
else
$(error Build on $(UNAME_M) is not supported, yet.)
endif
Expand Down Expand Up @@ -141,6 +144,9 @@ target/$(BINARYARM8): $(SOURCES)
target/$(BINARYPPC64LE): $(SOURCES)
GOARCH=ppc64le $(GO) build $(BUILD_FLAGS) -o $@

target/$(BINARYRISCV64): $(SOURCES)
GOARCH=riscv64 $(GO) build $(BUILD_FLAGS) -o $@

bin/fzf: target/$(BINARY) | bin
cp -f target/$(BINARY) bin/fzf

Expand Down

0 comments on commit 5fc78e4

Please sign in to comment.