build: which -> command -v

This commit is contained in:
mintsuki 2021-06-30 18:22:50 +02:00
parent 52cfc27d3e
commit 7d44e79abc
4 changed files with 11 additions and 11 deletions

View File

@ -9,10 +9,10 @@ TOOLCHAIN = x86_64-elf
TOOLCHAIN_CC = $(TOOLCHAIN)-gcc TOOLCHAIN_CC = $(TOOLCHAIN)-gcc
TOOLCHAIN_AR = $(TOOLCHAIN)-ar TOOLCHAIN_AR = $(TOOLCHAIN)-ar
ifeq ($(shell export "PATH=$(PATH)"; which $(TOOLCHAIN_CC)), ) ifeq ($(shell export "PATH=$(PATH)"; command -v $(TOOLCHAIN_CC) ; ), )
TOOLCHAIN_CC := gcc TOOLCHAIN_CC := gcc
endif endif
ifeq ($(shell export "PATH=$(PATH)"; which $(TOOLCHAIN_AR)), ) ifeq ($(shell export "PATH=$(PATH)"; command -v $(TOOLCHAIN_AR) ; ), )
TOOLCHAIN_AR := ar TOOLCHAIN_AR := ar
endif endif

View File

@ -79,7 +79,7 @@ make toolchain
### Building Limine ### Building Limine
In order to build Limine, the following packages have to be installed: `bash`, `make`, In order to build Limine, the following packages have to be installed: `bash`, `make`,
`git`, `which`, `nasm`, `mtools` (optional, necessary to build `limine-eltorito-efi.bin`). `git`, `nasm`, `mtools` (optional, necessary to build `limine-eltorito-efi.bin`).
Furthermore, either the toolchain must have been built in the previous paragraph, Furthermore, either the toolchain must have been built in the previous paragraph,
or `gcc` or `llvm/clang` must also be installed. or `gcc` or `llvm/clang` must also be installed.
`GNU binutils` is necessary in order to build the UEFI port of Limine. A full `GNU binutils` is necessary in order to build the UEFI port of Limine. A full

View File

@ -10,13 +10,13 @@ TOOLCHAIN_CC = $(TOOLCHAIN)-gcc
TOOLCHAIN_LD = $(TOOLCHAIN)-ld TOOLCHAIN_LD = $(TOOLCHAIN)-ld
TOOLCHAIN_OBJCOPY = $(TOOLCHAIN)-objcopy TOOLCHAIN_OBJCOPY = $(TOOLCHAIN)-objcopy
ifeq ($(shell which $(TOOLCHAIN_CC)), ) ifeq ($(shell command -v $(TOOLCHAIN_CC) ; ), )
TOOLCHAIN_CC := gcc TOOLCHAIN_CC := gcc
endif endif
ifeq ($(shell which $(TOOLCHAIN_LD)), ) ifeq ($(shell command -v $(TOOLCHAIN_LD) ; ), )
TOOLCHAIN_LD := ld TOOLCHAIN_LD := ld
endif endif
ifeq ($(shell which $(TOOLCHAIN_OBJCOPY)), ) ifeq ($(shell command -v $(TOOLCHAIN_OBJCOPY) ; ), )
TOOLCHAIN_OBJCOPY := objcopy TOOLCHAIN_OBJCOPY := objcopy
endif endif

View File

@ -21,19 +21,19 @@ TOOLCHAIN_OBJCOPY = $(TOOLCHAIN)-objcopy
TOOLCHAIN_OBJDUMP = $(TOOLCHAIN)-objdump TOOLCHAIN_OBJDUMP = $(TOOLCHAIN)-objdump
TOOLCHAIN_READELF = $(TOOLCHAIN)-readelf TOOLCHAIN_READELF = $(TOOLCHAIN)-readelf
ifeq ($(shell which $(TOOLCHAIN_CC)), ) ifeq ($(shell command -v $(TOOLCHAIN_CC) ; ), )
TOOLCHAIN_CC := gcc TOOLCHAIN_CC := gcc
endif endif
ifeq ($(shell which $(TOOLCHAIN_LD)), ) ifeq ($(shell command -v $(TOOLCHAIN_LD) ; ), )
TOOLCHAIN_LD := ld TOOLCHAIN_LD := ld
endif endif
ifeq ($(shell which $(TOOLCHAIN_OBJCOPY)), ) ifeq ($(shell command -v $(TOOLCHAIN_OBJCOPY) ; ), )
TOOLCHAIN_OBJCOPY := objcopy TOOLCHAIN_OBJCOPY := objcopy
endif endif
ifeq ($(shell which $(TOOLCHAIN_OBJDUMP)), ) ifeq ($(shell command -v $(TOOLCHAIN_OBJDUMP) ; ), )
TOOLCHAIN_OBJDUMP := objdump TOOLCHAIN_OBJDUMP := objdump
endif endif
ifeq ($(shell which $(TOOLCHAIN_READELF)), ) ifeq ($(shell command -v $(TOOLCHAIN_READELF) ; ), )
TOOLCHAIN_READELF := readelf TOOLCHAIN_READELF := readelf
endif endif