package/swconfig: don't use kernel headers
[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:=10
12
13 PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
14
15 include $(INCLUDE_DIR)/package.mk
16 include $(INCLUDE_DIR)/kernel.mk
17
18 define Package/swconfig
19 SECTION:=base
20 CATEGORY:=Base system
21 DEPENDS:=@!TARGET_brcm47xx +libuci +libnl-tiny
22 TITLE:=Switch configuration utility
23 endef
24
25 TARGET_CPPFLAGS := \
26 -D_GNU_SOURCE \
27 -I$(STAGING_DIR)/usr/include/libnl-tiny \
28 -I$(PKG_BUILD_DIR) \
29 $(TARGET_CPPFLAGS)
30
31 define Build/Prepare
32 mkdir -p $(PKG_BUILD_DIR)
33 $(CP) ./src/* $(PKG_BUILD_DIR)/
34 endef
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"
41 endef
42
43 define 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/
47 endef
48
49 $(eval $(call BuildPackage,swconfig))