uboot-sunxi: update ATF dependencies for 3 boards
[openwrt/openwrt.git] / package / network / config / swconfig / Makefile
1 #
2 # Copyright (C) 2008-2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=swconfig
11 PKG_RELEASE:=12
12
13 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
14 PKG_LICENSE:=GPL-2.0
15
16 include $(INCLUDE_DIR)/package.mk
17 include $(INCLUDE_DIR)/kernel.mk
18
19 define Package/swconfig
20 SECTION:=base
21 CATEGORY:=Base system
22 DEPENDS:=+libuci +libnl-tiny
23 TITLE:=Switch configuration utility
24 endef
25
26 TARGET_CFLAGS += -flto
27 TARGET_LDFLAGS += -flto=jobserver
28
29 TARGET_CPPFLAGS := \
30 -D_GNU_SOURCE \
31 -I$(STAGING_DIR)/usr/include/libnl-tiny \
32 -I$(PKG_BUILD_DIR) \
33 $(TARGET_CPPFLAGS) \
34 -I$(LINUX_DIR)/user_headers/include
35
36 define Build/Compile
37 CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
38 $(MAKE) -C $(PKG_BUILD_DIR) \
39 $(TARGET_CONFIGURE_OPTS) \
40 LIBS="$(TARGET_LDFLAGS) -lnl-tiny -lm -luci -lubox"
41 endef
42
43 define Build/InstallDev
44 $(INSTALL_DIR) $(1)/usr/include
45 $(CP) $(PKG_BUILD_DIR)/swlib.h $(1)/usr/include/
46
47 $(INSTALL_DIR) $(1)/usr/lib
48 $(CP) $(PKG_BUILD_DIR)/libsw.a $(1)/usr/lib/
49 endef
50
51 define Package/swconfig/install
52 $(INSTALL_DIR) $(1)/sbin $(1)/lib/network
53 $(INSTALL_BIN) $(PKG_BUILD_DIR)/swconfig $(1)/sbin/swconfig
54 $(INSTALL_DATA) ./files/switch.sh $(1)/lib/network/
55 endef
56
57 $(eval $(call BuildPackage,swconfig))