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