Change makefile to support TARGET

This commit is contained in:
Thayne McCombs 2022-12-01 22:37:16 -07:00
parent 6e3eb26af3
commit 77a12204bb
1 changed files with 8 additions and 1 deletions

View File

@ -1,12 +1,19 @@
PROFILE=release
EXE=target/$(PROFILE)/fd
CARGO_CMD=cargo
prefix=/usr/local
bindir=$(prefix)/bin
datadir=$(prefix)/share
exe_name=fd
build_opts=--locked --profile $(PROFILE)
ifdef TARGET
EXE=target/$(TARGET)/$(PROFILE)/fd
build_opts+=--target $(TARGET)
endif
$(EXE): Cargo.toml src/**/*.rs
cargo build --profile $(PROFILE)
$(CARGO_CMD) build $(build_opts)
.PHONY: completions
completions: autocomplete/fd.bash autocomplete/fd.fish autocomplete/fd.ps1 autocomplete/_fd