source: branches/backfire/package/swconfig/Makefile @ 24992

Last change on this file since 24992 was 24992, checked in by juhosg, 6 years ago

backfire: package/swconfig: add sanity checks to prevent a segfault (backport of r24932)

File size: 1.1 KB
Line 
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
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=swconfig
11PKG_RELEASE:=7
12
13include $(INCLUDE_DIR)/package.mk
14include $(INCLUDE_DIR)/kernel.mk
15
16define Package/swconfig
17  SECTION:=base
18  CATEGORY:=Base system
19  DEPENDS:=@LINUX_2_6 @!TARGET_brcm47xx +libuci +libnl-tiny
20  TITLE:=Switch configuration utility
21endef
22
23TARGET_CPPFLAGS := \
24        -D_GNU_SOURCE \
25        -I$(STAGING_DIR)/usr/include/libnl-tiny \
26        -I$(LINUX_DIR)/include \
27        -I$(LINUX_DIR)/arch/$(LINUX_KARCH)/include \
28        -I$(PKG_BUILD_DIR) \
29        $(TARGET_CPPFLAGS)
30
31define Build/Prepare
32        mkdir -p $(PKG_BUILD_DIR)
33        $(CP) ./src/* $(PKG_BUILD_DIR)/
34endef
35
36define 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"
41endef
42
43define Package/swconfig/install
44        $(INSTALL_DIR) $(1)/sbin $(1)/lib/network
45        $(INSTALL_BIN) $(PKG_BUILD_DIR)/swconfig $(1)/sbin/swconfig
46        $(INSTALL_DATA) ./files/switch.sh $(1)/lib/network/
47endef
48
49$(eval $(call BuildPackage,swconfig))
Note: See TracBrowser for help on using the repository browser.