mirror of
https://github.com/vsergeev/c-periphery.git
synced 2026-09-26 15:33:45 +08:00
make: use system printf for gpio cdev support tests
some shells (e.g. dash) don't support the `-e` switch with their built-in echo for interpreting escape sequences. also, the `-e` switch is technically not POSIX compliant. so use system (e.g. coreutils, busybox) printf instead. resolves #56.
This commit is contained in:
@@ -11,8 +11,8 @@ TEST_PROGRAMS = $(basename $(wildcard tests/*.c))
|
||||
OBJECTS = $(patsubst $(SRCDIR)/%.c,$(OBJDIR)/%.o,$(SRCS))
|
||||
|
||||
NULL := $(if $(filter Windows_NT,$(OS)),NUL,/dev/null)
|
||||
GPIO_CDEV_V1_SUPPORT := $(shell ! echo -e "\x23include <linux/gpio.h>\n\x23ifndef GPIO_GET_LINEEVENT_IOCTL\n\x23error\n\x23endif" | $(CC) -E - >$(NULL) 2>&1; echo $$?)
|
||||
GPIO_CDEV_V2_SUPPORT := $(shell ! echo -e "\x23include <linux/gpio.h>\nint main(void) { GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME; return 0; }" | $(CC) -x c - >$(NULL) 2>&1; echo $$?)
|
||||
GPIO_CDEV_V1_SUPPORT := $(shell ! env printf "\x23include <linux/gpio.h>\n\x23ifndef GPIO_GET_LINEEVENT_IOCTL\n\x23error\n\x23endif" | $(CC) -E - >$(NULL) 2>&1; echo $$?)
|
||||
GPIO_CDEV_V2_SUPPORT := $(shell ! env printf "\x23include <linux/gpio.h>\nint main(void) { GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME; return 0; }" | $(CC) -x c - >$(NULL) 2>&1; echo $$?)
|
||||
GPIO_CDEV_SUPPORT = $(if $(filter 1,$(GPIO_CDEV_V2_SUPPORT)),2,$(if $(filter 1,$(GPIO_CDEV_V1_SUPPORT)),1,0))
|
||||
|
||||
COMMIT_ID := $(shell git describe --abbrev --always --tags --dirty 2>$(NULL) || echo "")
|
||||
|
||||
Reference in New Issue
Block a user