BMDA: Using tabs outside of a target indent causes issues.

It is safer to only use spaces to indent make statements outside of
targets as each line that executes any shell code will fail if it is
indented with tabs.
This commit is contained in:
Piotr Esden-Tempski 2022-07-14 19:53:36 -07:00 committed by Rachel Mant
parent a3d3a2326f
commit d0c45cf095
1 changed files with 39 additions and 39 deletions

View File

@ -12,72 +12,72 @@ CFLAGS +=-I ./target
# footprint. Specifically no requirement to link against libftdi1, libusb1, or # footprint. Specifically no requirement to link against libftdi1, libusb1, or
# hidapi (hidapi-hidraw on Linux). This makes building on Windows in particular easier. # hidapi (hidapi-hidraw on Linux). This makes building on Windows in particular easier.
ifneq (, $(findstring linux, $(SYS))) ifneq (, $(findstring linux, $(SYS)))
HOSTED_BMP_ONLY ?= 0 HOSTED_BMP_ONLY ?= 0
else else
HOSTED_BMP_ONLY ?= 1 HOSTED_BMP_ONLY ?= 1
endif endif
CFLAGS += -DHOSTED_BMP_ONLY=$(HOSTED_BMP_ONLY) CFLAGS += -DHOSTED_BMP_ONLY=$(HOSTED_BMP_ONLY)
ifeq ($(ASAN), 1) ifeq ($(ASAN), 1)
CFLAGS += -fsanitize=address -Wno-format-truncation CFLAGS += -fsanitize=address -Wno-format-truncation
LDFLAGS += -fsanitize=address LDFLAGS += -fsanitize=address
endif endif
HIDAPILIB = hidapi HIDAPILIB = hidapi
ifneq (, $(findstring linux, $(SYS))) ifneq (, $(findstring linux, $(SYS)))
SRC += serial_unix.c SRC += serial_unix.c
HIDAPILIB = hidapi-hidraw HIDAPILIB = hidapi-hidraw
else ifneq (, $(findstring mingw, $(SYS))) else ifneq (, $(findstring mingw, $(SYS)))
# Build for windows versions Vista, and above, where the # Build for windows versions Vista, and above, where the
# 'SetupDiGetDevicePropertyW()' function is available # 'SetupDiGetDevicePropertyW()' function is available
CFLAGS += -D_WIN32_WINNT=0x600 CFLAGS += -D_WIN32_WINNT=0x600
SRC += serial_win.c SRC += serial_win.c
LDFLAGS += -lws2_32 LDFLAGS += -lws2_32
LDFLAGS += -lsetupapi LDFLAGS += -lsetupapi
else ifneq (, $(findstring cygwin, $(SYS))) else ifneq (, $(findstring cygwin, $(SYS)))
# Build for windows versions Vista, and above, where the # Build for windows versions Vista, and above, where the
# 'SetupDiGetDevicePropertyW()' function is available # 'SetupDiGetDevicePropertyW()' function is available
CFLAGS += -D_WIN32_WINNT=0x600 CFLAGS += -D_WIN32_WINNT=0x600
SRC += serial_win.c SRC += serial_win.c
LDFLAGS += -lws2_32 LDFLAGS += -lws2_32
LDFLAGS += -lsetupapi LDFLAGS += -lsetupapi
# https://github.com/dmlc/xgboost/issues/1945 indicates macosx as indicator # https://github.com/dmlc/xgboost/issues/1945 indicates macosx as indicator
else ifneq (filter, macosx darwin, $(SYS)) else ifneq (filter, macosx darwin, $(SYS))
SRC += serial_unix.c SRC += serial_unix.c
LDFLAGS += -framework CoreFoundation LDFLAGS += -framework CoreFoundation
CFLAGS += -I /opt/homebrew/include -I /opt/homebrew/include/libusb-1.0 CFLAGS += -I /opt/homebrew/include -I /opt/homebrew/include/libusb-1.0
endif endif
ifneq ($(HOSTED_BMP_ONLY), 1) ifneq ($(HOSTED_BMP_ONLY), 1)
$(shell pkg-config --exists libftdi1) $(shell pkg-config --exists libftdi1)
ifneq ($(.SHELLSTATUS), 0) ifneq ($(.SHELLSTATUS), 0)
$(error Please install libftdi1 dependency or set HOSTED_BMP_ONLY to 1) $(error Please install libftdi1 dependency or set HOSTED_BMP_ONLY to 1)
endif endif
LDFLAGS += -lusb-1.0 LDFLAGS += -lusb-1.0
CFLAGS += $(shell pkg-config --cflags libftdi1) CFLAGS += $(shell pkg-config --cflags libftdi1)
LDFLAGS += $(shell pkg-config --libs libftdi1) LDFLAGS += $(shell pkg-config --libs libftdi1)
CFLAGS += -Wno-missing-field-initializers CFLAGS += -Wno-missing-field-initializers
endif endif
ifneq ($(HOSTED_BMP_ONLY), 1) ifneq ($(HOSTED_BMP_ONLY), 1)
CFLAGS += -DCMSIS_DAP CFLAGS += -DCMSIS_DAP
SRC += cmsis_dap.c dap.c SRC += cmsis_dap.c dap.c
$(shell pkg-config --exists $(HIDAPILIB)) $(shell pkg-config --exists $(HIDAPILIB))
ifneq ($(.SHELLSTATUS), 0) ifneq ($(.SHELLSTATUS), 0)
$(error Please install $(HIDAPILIB) dependency or set HOSTED_BMP_ONLY to 1) $(error Please install $(HIDAPILIB) dependency or set HOSTED_BMP_ONLY to 1)
endif endif
CFLAGS += $(shell pkg-config --cflags $(HIDAPILIB)) CFLAGS += $(shell pkg-config --cflags $(HIDAPILIB))
LDFLAGS += $(shell pkg-config --libs $(HIDAPILIB)) LDFLAGS += $(shell pkg-config --libs $(HIDAPILIB))
endif endif
SRC += timing.c cli.c utils.c SRC += timing.c cli.c utils.c
SRC += bmp_remote.c remote_swdptap.c remote_jtagtap.c SRC += bmp_remote.c remote_swdptap.c remote_jtagtap.c
ifneq ($(HOSTED_BMP_ONLY), 1) ifneq ($(HOSTED_BMP_ONLY), 1)
SRC += bmp_libusb.c stlinkv2.c SRC += bmp_libusb.c stlinkv2.c
SRC += ftdi_bmp.c libftdi_swdptap.c libftdi_jtagtap.c SRC += ftdi_bmp.c libftdi_swdptap.c libftdi_jtagtap.c
SRC += jlink.c jlink_adiv5_swdp.c jlink_jtagtap.c SRC += jlink.c jlink_adiv5_swdp.c jlink_jtagtap.c
else else
SRC += bmp_serial.c SRC += bmp_serial.c
endif endif
PC_HOSTED = 1 PC_HOSTED = 1