blob: fd0a5e2213397e79e137ed5bc5ba4f862651c43b [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001#
2# Copyright (C) 2012 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9include $(INCLUDE_DIR)/kernel.mk
10
11PKG_NAME:=libhttpclient
12PKG_VERSION:=1.0
13PKG_RELEASE:=1
14
15PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
16PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
17SVC_SOURCE_DIR:=$(MRVLDIR)/services/libhttpclient
18PKG_SOURCE_DIR:=$(SVC_SOURCE_DIR) $(STAGING_DIR)/usr/lib
19PKG_BUILD_PARALLEL:=0
20
21include $(INCLUDE_DIR)/package.mk
22
23define Package/libhttpclient
24 CATEGORY:=service
25 TITLE:=libhttpclient service
26 DEPENDS:= +libpthread +libubox +libubus +ril +liblog +libmbedtls
27 DEFAULT:=y
28endef
29
30define Package/libhttpclient/description
31 libhttpclient service applictions and utilities
32endef
33
34TARGET_CFLAGS += -ffunction-sections -fdata-sections
35TARGET_LDFLAGS += -Wl,--gc-sections
36
37ifeq "$(CONFIG_TARGET_mmp_asr1803_FALCON403)" "y"
38TARGET_CFLAGS += -DNO_LOGCAT_SUPPORT
39endif
40ifeq "$(CONFIG_TARGET_mmp_asr1903_LAPW503)" "y"
41TARGET_CFLAGS += -DNO_LOGCAT_SUPPORT
42endif
43
44define Build/Compile
45 $(MAKE) $(PKG_JOBS) -C $(SVC_SOURCE_DIR) \
46 SUBTARGET="$(SUBTARGET)" \
47 CROSS_COMPILE="$(TARGET_CROSS)" \
48 EXTRA_CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include -I$(TOOLCHAIN_DIR)/include" \
49 LD_FLAGS="$(TARGET_LDFLAGS) -L$(TOOLCHAIN_DIR)/lib/"\
50 INSTALL_DIR="$(PKG_INSTALL_DIR)" \
51 OBJ_DIR="$(PKG_BUILD_DIR)/obj" \
52 compile
53endef
54
55define Build/Clean
56@if [ -d $(PKG_BUILD_DIR) ]; then \
57 $(MAKE) $(PKG_JOBS) -C $(SVC_SOURCE_DIR) \
58 CROSS_COMPILE="$(TARGET_CROSS)" \
59 EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
60 LD_FLAGS="$(TARGET_LDFLAGS)" \
61 INSTALL_DIR="$(PKG_INSTALL_DIR)" \
62 OBJ_DIR="$(PKG_BUILD_DIR)/obj" \
63 clean; \
64fi
65endef
66
67define Build/InstallDev
68 $(INSTALL_DIR) $(1)/usr/lib
69 $(INSTALL_DIR) $(1)/usr/include/libhttpclient/
70 $(CP) -rf $(PKG_INSTALL_DIR)/lib/libhttpclient.so $(1)/usr/lib/
71 $(CP) -rf $(SVC_SOURCE_DIR)/libhttpclient/inc/*.h $(1)/usr/include/libhttpclient/
72endef
73
74define Package/libhttpclient/install
75 $(INSTALL_DIR) $(1)/lib
76 $(CP) -rf $(PKG_INSTALL_DIR)/* $(1)/
77endef
78
79$(eval $(call BuildPackage,libhttpclient))