board/csky: fixup gdb instructions in readme.txt
[buildroot-gz.git] / package / benejson / benejson.mk
blob680e5b5bdad7b8971c345a72e665e4b5cbee81fe
1 ################################################################################
3 # benejson
5 ################################################################################
7 BENEJSON_VERSION = 0.9.7
8 BENEJSON_SITE = $(call github,codehero,benejson,$(BENEJSON_VERSION))
9 BENEJSON_LICENSE = MIT
10 BENEJSON_LICENSE_FILES = LICENSE
11 BENEJSON_INSTALL_STAGING = YES
12 BENEJSON_DEPENDENCIES = host-scons
14 # wchar support needs to be manually disabled
15 ifeq ($(BR2_USE_WCHAR),)
16 define BENEJSON_DISABLE_WCHAR
17 $(SED) 's,^#define BNJ_WCHAR_SUPPORT,#undef BNJ_WCHAR_SUPPORT,' \
18 $(@D)/benejson/benejson.h
19 endef
20 BENEJSON_POST_PATCH_HOOKS += BENEJSON_DISABLE_WCHAR
21 endif
23 BENEJSON_SCONS_TARGETS = include
25 ifeq ($(BR2_STATIC_LIBS)$(BR2_SHARED_STATIC_LIBS),y)
26 BENEJSON_SCONS_TARGETS += lib/libbenejson.a
27 define BENEJSON_INSTALL_STATIC_LIB
28 $(INSTALL) -D -m 0644 $(@D)/lib/libbenejson.a \
29 $(1)/usr/lib/libbenejson.a
30 endef
31 endif # Static enabled
33 ifeq ($(BR2_SHARED_LIBS)$(BR2_SHARED_STATIC_LIBS),y)
34 BENEJSON_SCONS_TARGETS += lib/libbenejson.so
35 define BENEJSON_INSTALL_SHARED_LIB
36 $(INSTALL) -D -m 0644 $(@D)/lib/libbenejson.so \
37 $(1)/usr/lib/libbenejson.so
38 endef
39 endif # Shared enabled
41 define BENEJSON_BUILD_CMDS
42 (cd $(@D); \
43 $(TARGET_CONFIGURE_OPTS) CROSS=$(TARGET_CROSS) \
44 $(SCONS) $(BENEJSON_SCONS_TARGETS))
45 endef
47 define BENEJSON_INSTALL_STAGING_CMDS
48 $(INSTALL) -D -m 0644 $(@D)/include/benejson/benejson.h \
49 $(STAGING_DIR)/usr/include/benejson/benejson.h; \
50 $(INSTALL) -D -m 0644 $(@D)/include/benejson/pull.hh \
51 $(STAGING_DIR)/usr/include/benejson/pull.hh
52 $(call BENEJSON_INSTALL_STATIC_LIB,$(STAGING_DIR))
53 $(call BENEJSON_INSTALL_SHARED_LIB,$(STAGING_DIR))
54 endef
56 define BENEJSON_INSTALL_TARGET_CMDS
57 $(call BENEJSON_INSTALL_SHARED_LIB,$(TARGET_DIR))
58 endef
60 $(eval $(generic-package))