xref: /OK3568_Linux_fs/buildroot/package/open-plc-utils/open-plc-utils.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1################################################################################
2#
3# open-plc-utils
4#
5################################################################################
6
7OPEN_PLC_UTILS_VERSION = 32408520fcebe785983a68e39ec83830a3005779
8OPEN_PLC_UTILS_SITE = $(call github,qca,open-plc-utils,$(OPEN_PLC_UTILS_VERSION))
9OPEN_PLC_UTILS_LICENSE = BSD-3-Clause
10OPEN_PLC_UTILS_LICENSE_FILES = LICENSE
11
12# We unfortunately can't use TARGET_CONFIGURE_OPTS, as it would
13# override the package CFLAGS, LDFLAGS and CXXFLAGS definitions.
14#
15# Yes, we're passing __UCLIBC__ in EXTRA_CFLAGS, as it fixes a build
16# issue for non-uClibc toolchains. It is the very crappy solution
17# suggested at https://github.com/qca/open-plc-utils/issues/36.
18OPEN_PLC_UTILS_MAKE_OPTS = \
19	EXTRA_CFLAGS="$(TARGET_CFLAGS) -D__UCLIBC__" \
20	EXTRA_CXXFLAGS="$(TARGET_CXXFLAGS)" \
21	EXTRA_LDFLAGS="$(TARGET_LDFLAGS)"
22
23define OPEN_PLC_UTILS_BUILD_CMDS
24	$(TARGET_MAKE_ENV) $(MAKE) CROSS=$(TARGET_CROSS) \
25		$(OPEN_PLC_UTILS_MAKE_OPTS) -C $(@D)
26endef
27
28define OPEN_PLC_UTILS_INSTALL_TARGET_CMDS
29	$(TARGET_MAKE_ENV) $(MAKE) ROOTFS=$(TARGET_DIR) \
30		BIN="$(TARGET_DIR)/usr/bin" -C $(@D) install
31endef
32
33$(eval $(generic-package))
34