1 ################################################################################
5 ################################################################################
7 SWUPDATE_VERSION
= 2017.01
8 SWUPDATE_SITE
= $(call github
,sbabic
,swupdate
,$(SWUPDATE_VERSION
))
9 SWUPDATE_LICENSE
= GPLv2
+, MIT
, Public Domain
10 SWUPDATE_LICENSE_FILES
= COPYING
12 # swupdate bundles its own version of mongoose (version 3.8)
14 ifeq ($(BR2_PACKAGE_JSON_C
),y
)
15 SWUPDATE_DEPENDENCIES
+= json-c
16 SWUPDATE_MAKE_ENV
+= HAVE_JSON_C
=y
18 SWUPDATE_MAKE_ENV
+= HAVE_JSON_C
=n
21 ifeq ($(BR2_PACKAGE_LIBARCHIVE
),y
)
22 SWUPDATE_DEPENDENCIES
+= libarchive
23 SWUPDATE_MAKE_ENV
+= HAVE_LIBARCHIVE
=y
25 SWUPDATE_MAKE_ENV
+= HAVE_LIBARCHIVE
=n
28 ifeq ($(BR2_PACKAGE_LIBCONFIG
),y
)
29 SWUPDATE_DEPENDENCIES
+= libconfig
30 SWUPDATE_MAKE_ENV
+= HAVE_LIBCONFIG
=y
32 SWUPDATE_MAKE_ENV
+= HAVE_LIBCONFIG
=n
35 ifeq ($(BR2_PACKAGE_LIBCURL
),y
)
36 SWUPDATE_DEPENDENCIES
+= libcurl
37 SWUPDATE_MAKE_ENV
+= HAVE_LIBCURL
=y
39 SWUPDATE_MAKE_ENV
+= HAVE_LIBCURL
=n
42 ifeq ($(BR2_PACKAGE_HAS_LUAINTERPRETER
),y
)
43 SWUPDATE_DEPENDENCIES
+= luainterpreter host-pkgconf
44 SWUPDATE_MAKE_ENV
+= HAVE_LUA
=y
46 SWUPDATE_MAKE_ENV
+= HAVE_LUA
=n
49 ifeq ($(BR2_PACKAGE_MTD
),y
)
50 SWUPDATE_DEPENDENCIES
+= mtd
51 SWUPDATE_MAKE_ENV
+= HAVE_LIBMTD
=y
52 SWUPDATE_MAKE_ENV
+= HAVE_LIBUBI
=y
54 SWUPDATE_MAKE_ENV
+= HAVE_LIBMTD
=n
55 SWUPDATE_MAKE_ENV
+= HAVE_LIBUBI
=n
58 ifeq ($(BR2_PACKAGE_OPENSSL
),y
)
59 SWUPDATE_DEPENDENCIES
+= openssl
60 SWUPDATE_MAKE_ENV
+= HAVE_LIBSSL
=y
61 SWUPDATE_MAKE_ENV
+= HAVE_LIBCRYPTO
=y
63 SWUPDATE_MAKE_ENV
+= HAVE_LIBSSL
=n
64 SWUPDATE_MAKE_ENV
+= HAVE_LIBCRYPTO
=n
67 ifeq ($(BR2_PACKAGE_UBOOT_TOOLS
),y
)
68 SWUPDATE_DEPENDENCIES
+= uboot-tools
69 SWUPDATE_MAKE_ENV
+= HAVE_LIBUBOOTENV
=y
71 SWUPDATE_MAKE_ENV
+= HAVE_LIBUBOOTENV
=n
74 ifeq ($(BR2_PACKAGE_ZLIB
),y
)
75 SWUPDATE_DEPENDENCIES
+= zlib
76 SWUPDATE_MAKE_ENV
+= HAVE_ZLIB
=y
78 SWUPDATE_MAKE_ENV
+= HAVE_ZLIB
=n
81 SWUPDATE_BUILD_CONFIG
= $(@D
)/.config
83 SWUPDATE_KCONFIG_FILE
= $(call qstrip
,$(BR2_PACKAGE_SWUPDATE_CONFIG
))
84 SWUPDATE_KCONFIG_EDITORS
= menuconfig xconfig gconfig nconfig
86 ifeq ($(BR2_STATIC_LIBS
),y
)
87 define SWUPDATE_PREFER_STATIC
88 $(call KCONFIG_ENABLE_OPT
,CONFIG_STATIC
,$(SWUPDATE_BUILD_CONFIG
))
92 define SWUPDATE_SET_BUILD_OPTIONS
93 $(call KCONFIG_SET_OPT
,CONFIG_CROSS_COMPILE
,"$(TARGET_CROSS)", \
94 $(SWUPDATE_BUILD_CONFIG
))
95 $(call KCONFIG_SET_OPT
,CONFIG_SYSROOT
,"$(STAGING_DIR)", \
96 $(SWUPDATE_BUILD_CONFIG
))
97 $(call KCONFIG_SET_OPT
,CONFIG_EXTRA_CFLAGS
,"$(TARGET_CFLAGS)", \
98 $(SWUPDATE_BUILD_CONFIG
))
99 $(call KCONFIG_SET_OPT
,CONFIG_EXTRA_LDFLAGS
,"$(TARGET_LDFLAGS)", \
100 $(SWUPDATE_BUILD_CONFIG
))
103 define SWUPDATE_KCONFIG_FIXUP_CMDS
104 $(SWUPDATE_PREFER_STATIC
)
105 $(SWUPDATE_SET_BUILD_OPTIONS
)
108 define SWUPDATE_BUILD_CMDS
109 $(TARGET_MAKE_ENV
) $(SWUPDATE_MAKE_ENV
) $(MAKE
) -C
$(@D
)
112 define SWUPDATE_INSTALL_TARGET_CMDS
113 $(INSTALL
) -D
-m
0755 $(@D
)/swupdate
$(TARGET_DIR
)/usr
/bin
/swupdate
114 $(if
$(BR2_PACKAGE_SWUPDATE_INSTALL_WEBSITE
), \
115 mkdir
-p
$(TARGET_DIR
)/var
/www
/swupdate
; \
116 cp
-dpf
$(@D
)/www
/* $(TARGET_DIR
)/var
/www
/swupdate
)
119 # Checks to give errors that the user can understand
120 # Must be before we call to kconfig-package
121 ifeq ($(BR2_PACKAGE_SWUPDATE
)$(BR_BUILDING
),yy
)
122 ifeq ($(call qstrip
,$(BR2_PACKAGE_SWUPDATE_CONFIG
)),)
123 $(error No Swupdate configuration file specified
, check your BR2_PACKAGE_SWUPDATE_CONFIG setting
)
127 $(eval
$(kconfig-package
))