document GREP_CMD
This commit is contained in:
parent
264f8f604a
commit
185a1e9e35
3 changed files with 23 additions and 7 deletions
12
Common.mk
12
Common.mk
|
@ -8,8 +8,8 @@ dir_if_exists = $(if $(wildcard $(1)$(2)),$(1))
|
|||
# result = $(call READ_BOARD_TXT, 'boardname', 'parameter')
|
||||
PARSE_BOARD = $(shell if [ -f $(BOARDS_TXT) ]; \
|
||||
then \
|
||||
$(GREP) -Ev '^\#' $(BOARDS_TXT) | \
|
||||
$(GREP) -E "^[ \t]*$(1).$(2)=" | \
|
||||
$(GREP_CMD) -Ev '^\#' $(BOARDS_TXT) | \
|
||||
$(GREP_CMD) -E "^[ \t]*$(1).$(2)=" | \
|
||||
cut -d = -f 2- | \
|
||||
cut -d : -f 2; \
|
||||
fi)
|
||||
|
@ -48,20 +48,20 @@ $(call arduino_output,$(call ardmk_include) Configuration:)
|
|||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
CURRENT_OS = WINDOWS
|
||||
GREP := grep
|
||||
GREP_CMD := grep
|
||||
else
|
||||
UNAME_S := $(shell uname -s)
|
||||
ifeq ($(UNAME_S),Linux)
|
||||
CURRENT_OS = LINUX
|
||||
GREP := grep
|
||||
GREP_CMD := grep
|
||||
endif
|
||||
ifeq ($(UNAME_S),Darwin)
|
||||
CURRENT_OS = MAC
|
||||
ifeq (, $(shell which ggrep))
|
||||
echo $(info Using macOS BSD grep, please install GNU grep to avoid warnings)
|
||||
GREP := grep
|
||||
GREP_CMD := grep
|
||||
else
|
||||
GREP := ggrep
|
||||
GREP_CMD := ggrep
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
|
2
Sam.mk
2
Sam.mk
|
@ -414,7 +414,7 @@ CFLAGS_STD += -std=gnu11
|
|||
CPPFLAGS += -DMD -D$(USB_TYPE) '-DUSB_PRODUCT=$(USB_PRODUCT)' '-DUSB_MANUFACTURER=$(USB_MANUFACTURER)'
|
||||
|
||||
# Get extra define flags from boards.txt
|
||||
EXFLAGS := $(shell echo $(call PARSE_BOARD,$(BOARD_TAG),build.extra_flags) | $(GREP) -oE '(-D)\w+')
|
||||
EXFLAGS := $(shell echo $(call PARSE_BOARD,$(BOARD_TAG),build.extra_flags) | $(GREP_CMD) -oE '(-D)\w+')
|
||||
|
||||
# Strip only defines from extra flags as boards file appends user {build.usb}
|
||||
CPPFLAGS += $(EXFLAGS)
|
||||
|
|
|
@ -150,6 +150,22 @@ PYTHON_CMD = /usr/bin/python3
|
|||
|
||||
----
|
||||
|
||||
### GREP_CMD
|
||||
|
||||
**Description:**
|
||||
|
||||
Path to GNU grep binary. Only added for macOS, which has BSD grep by default but results in some parsing warnings. macOS users should install GNU grep using Homebrew.
|
||||
|
||||
**Example:**
|
||||
|
||||
```Makefile
|
||||
GREP_CMD = /bin/grep
|
||||
```
|
||||
|
||||
**Requirement:** *Optional*
|
||||
|
||||
----
|
||||
|
||||
## Arduino IDE variables
|
||||
|
||||
### ARDUINO_DIR
|
||||
|
|
Loading…
Reference in a new issue