xref: /OK3568_Linux_fs/buildroot/package/libclc/libclc.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1################################################################################
2#
3# libclc
4#
5################################################################################
6
7# Use the latest commit from release_90 branch.
8LIBCLC_VERSION = d1cbc92e2ceee59963f5c3a576382e5bba31f060
9LIBCLC_SITE = https://github.com/llvm-mirror/libclc
10LIBCLC_SITE_METHOD = git
11LIBCLC_LICENSE = Apache-2.0 with exceptions or MIT
12LIBCLC_LICENSE_FILES = LICENSE.TXT
13
14LIBCLC_DEPENDENCIES = host-clang host-llvm
15LIBCLC_INSTALL_STAGING = YES
16
17# C++ compiler is used to build a small tool (prepare-builtins) for the host.
18# It must be built with the C++ compiler from the host.
19#
20# The headers are installed in /usr/share and not /usr/include,
21# because they are needed at runtime on the target to build the OpenCL
22# kernels.
23LIBCLC_CONF_OPTS = \
24	--with-llvm-config=$(HOST_DIR)/usr/bin/llvm-config \
25	--prefix=/usr \
26	--includedir=/usr/share \
27	--pkgconfigdir=/usr/lib/pkgconfig \
28	--with-cxx-compiler=$(HOSTCXX_NOCCACHE)
29
30define LIBCLC_CONFIGURE_CMDS
31	(cd $(@D); $(TARGET_CONFIGURE_OPTS) ./configure.py $(LIBCLC_CONF_OPTS))
32endef
33
34define LIBCLC_BUILD_CMDS
35	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
36endef
37
38define LIBCLC_INSTALL_TARGET_CMDS
39	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install
40endef
41
42define LIBCLC_INSTALL_STAGING_CMDS
43	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) install
44endef
45
46$(eval $(generic-package))
47