xref: /OK3568_Linux_fs/buildroot/package/liblinear/liblinear.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1################################################################################
2#
3# liblinear
4#
5################################################################################
6
7LIBLINEAR_VERSION = 2.43
8LIBLINEAR_SITE = http://www.csie.ntu.edu.tw/~cjlin/liblinear
9LIBLINEAR_LICENSE = BSD-3-Clause
10LIBLINEAR_LICENSE_FILES = COPYRIGHT
11LIBLINEAR_INSTALL_STAGING = YES
12LIBLINEAR_CFLAGS = $(TARGET_CFLAGS)
13
14ifeq ($(BR2_SHARED_LIBS)$(BR2_SHARED_STATIC_LIBS),y)
15# $1: destination directory
16define LIBLINEAR_INSTALL_SHARED
17	$(INSTALL) -m 0644 -D $(@D)/liblinear.so.4 $(1)/usr/lib/liblinear.so.4
18	ln -sf liblinear.so.4 $(1)/usr/lib/liblinear.so
19endef
20LIBLINEAR_CFLAGS += -fPIC
21endif
22
23ifeq ($(BR2_STATIC_LIBS)$(BR2_SHARED_STATIC_LIBS),y)
24# $1: destination directory
25define LIBLINEAR_INSTALL_STATIC
26	$(INSTALL) -m 0644 -D $(@D)/liblinear.a $(1)/usr/lib/liblinear.a
27endef
28endif
29
30define LIBLINEAR_BUILD_CMDS
31	$(MAKE) $(TARGET_CONFIGURE_OPTS) CFLAGS="$(LIBLINEAR_CFLAGS)" -C $(@D) \
32		$(if $(BR2_SHARED_LIBS)$(BR2_SHARED_STATIC_LIBS),lib) \
33		$(if $(BR2_STATIC_LIBS)$(BR2_SHARED_STATIC_LIBS),static-lib)
34endef
35
36define LIBLINEAR_INSTALL_STAGING_CMDS
37	$(INSTALL) -m 0644 -D $(@D)/linear.h $(STAGING_DIR)/usr/include/linear.h
38	$(call LIBLINEAR_INSTALL_SHARED,$(STAGING_DIR))
39	$(call LIBLINEAR_INSTALL_STATIC,$(STAGING_DIR))
40endef
41
42define LIBLINEAR_INSTALL_TARGET_CMDS
43	$(call LIBLINEAR_INSTALL_SHARED,$(TARGET_DIR))
44endef
45
46$(eval $(generic-package))
47