Makefile: adapt for libftdi vs libftdi1 differences

Use the cflags and libs from pkg-config. This allows us to adapt to the
distro differences. Also, make sure to autodetect if the distro provides
libftdi or libftdi1, preferring the latter one.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
This commit is contained in:
Dmitry Baryshkov
2023-09-21 15:03:40 +03:00
parent ace20c95f5
commit 2bbe855662

View File

@@ -26,7 +26,10 @@ else
$(info No compiler flags for: $(CC))
endif
LDFLAGS := -ludev -lyaml -lftdi -lusb
LIBFTDI := $(shell pkg-config --exists libftdi1 && echo libftdi1 || echo libftdi)
CPPFLAGS := $(shell pkg-config --cflags yaml-0.1 $(LIBFTDI) libudev)
LDFLAGS := $(shell pkg-config --libs yaml-0.1 $(LIBFTDI) libudev)
CLIENT_SRCS := cdba.c circ_buf.c
CLIENT_OBJS := $(CLIENT_SRCS:.c=.o)