package/dhcp/S80dhcp-server: allow empty INTERFACES
[buildroot-gz.git] / package / mongoose / mongoose.mk
blob14f2aae152fce4a1b4f8c77a20d5d4b2507e479d
1 ################################################################################
3 # mongoose
5 ################################################################################
7 MONGOOSE_VERSION = 5.6
8 MONGOOSE_SITE = $(call github,cesanta,mongoose,$(MONGOOSE_VERSION))
9 MONGOOSE_LICENSE = GPLv2
10 MONGOOSE_LICENSE_FILES = LICENSE
11 MONGOOSE_INSTALL_STAGING = YES
13 MONGOOSE_CFLAGS = $(TARGET_CFLAGS) $(TARGET_LDFLAGS) -DMONGOOSE_NO_DL
15 ifeq ($(BR2_PACKAGE_OPENSSL),y)
16 MONGOOSE_DEPENDENCIES += openssl
17 # directly linked
18 MONGOOSE_CFLAGS += -DNS_ENABLE_SSL -lssl -lcrypto -lz
19 endif
21 define MONGOOSE_BUILD_CMDS
22 $(TARGET_CC) $(@D)/examples/web_server/web_server.c $(@D)/mongoose.c \
23 -I$(@D) -o $(@D)/examples/web_server/web_server \
24 $(MONGOOSE_CFLAGS) -pthread
25 $(TARGET_CC) -c $(@D)/mongoose.c $(MONGOOSE_CFLAGS) -o $(@D)/mongoose.o
26 $(TARGET_AR) rcs $(@D)/libmongoose.a $(@D)/mongoose.o
27 endef
29 define MONGOOSE_INSTALL_TARGET_CMDS
30 $(INSTALL) -D -m 755 $(@D)/examples/web_server/web_server \
31 $(TARGET_DIR)/usr/sbin/mongoose
32 endef
34 define MONGOOSE_INSTALL_INIT_SYSV
35 $(INSTALL) -D -m 755 package/mongoose/S85mongoose \
36 $(TARGET_DIR)/etc/init.d/S85mongoose
37 endef
39 define MONGOOSE_INSTALL_INIT_SYSTEMD
40 $(INSTALL) -D -m 644 package/mongoose/mongoose.service \
41 $(TARGET_DIR)/usr/lib/systemd/system/mongoose.service
42 mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
43 ln -sf ../../../../usr/lib/systemd/system/mongoose.service \
44 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/mongoose.service
45 endef
47 define MONGOOSE_INSTALL_STAGING_CMDS
48 $(INSTALL) -D -m 644 $(@D)/libmongoose.a \
49 $(STAGING_DIR)/usr/lib/libmongoose.a
50 $(INSTALL) -D -m 644 $(@D)/mongoose.h \
51 $(STAGING_DIR)/usr/include/mongoose.h
52 endef
54 $(eval $(generic-package))