forked from SeaWireNetworks/openwrt-Toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
77 lines (61 loc) · 1.84 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#
# Copyright (C) 2015-2017 wongsyrone
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=Toolkit
PKG_VERSION:=0.4.0.2
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/muink/Toolkit.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=631954eac283e38822c47e3122e9e2a3ac5984c6
#PKG_MIRROR_HASH:=
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
CMAKE_INSTALL:=1
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=LICENSE
PKG_USE_MIPS16:=0
PKG_BUILD_PARALLEL:=1
PKG_MAINTAINER:=Chengr28 <chengr28@twitter>
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
TARGET_CFLAGS += $(FPIC)
CMAKE_OPTIONS += \
-DPLATFORM_OPENWRT=ON
# Note: GCC 4.6 and 4.8 dont have complete C++11 support
# Please use GCC 4.9 or higher to compile
define Package/Toolkit
SECTION:=net
CATEGORY:=Network
TITLE:=A useful and powerful toolkit (DNSPing+FileHash)
URL:=https://github.com/chengr28/Toolkit
DEPENDS:=+libstdcpp \
@GCC_VERSION_4_6:BROKEN @GCC_VERSION_4_8:BROKEN
endef
define Package/Toolkit/config
if PACKAGE_Toolkit
config PACKAGE_Toolkit_advancedoptions
bool "Use advanced compile options, see Makefile for details."
default n
endif
endef
define Package/Toolkit/description
A network util can ping with DNS request.
endef
# Some advanced compile flags for expert
ifneq ($(CONFIG_PACKAGE_Toolkit_advancedoptions),)
# Try to reduce binary size
TARGET_CFLAGS += -ffunction-sections -fdata-sections
TARGET_LDFLAGS += -Wl,--gc-sections
# Use Link time optimization
TARGET_CFLAGS += -flto
TARGET_LDFLAGS += -Wl,-flto
endif
define Package/Toolkit/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{DNSPing,FileHash} $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,Toolkit))