Root/package/switch/Makefile

1#
2# Copyright (C) 2006 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
9include $(INCLUDE_DIR)/kernel.mk
10
11PKG_NAME:=kmod-switch
12PKG_RELEASE:=3
13
14include $(INCLUDE_DIR)/package.mk
15
16define KernelPackage/switch
17  SUBMENU:=Other modules
18  DEPENDS:=@TARGET_brcm_2_4||TARGET_brcm47xx||TARGET_brcm63xx
19  TITLE:=Switch drivers
20  FILES:= \
21    $(PKG_BUILD_DIR)/switch-core.$(LINUX_KMOD_SUFFIX) \
22    $(PKG_BUILD_DIR)/switch-adm.$(LINUX_KMOD_SUFFIX) \
23    $(PKG_BUILD_DIR)/switch-robo.$(LINUX_KMOD_SUFFIX)
24  AUTOLOAD:=$(call AutoLoad,20,switch-core switch-robo switch-adm)
25endef
26
27define KernelPackage/switch/description
28 This package contains switch drivers for ADM6996L and BCM53XX RoboSwitch.
29endef
30
31define Build/Prepare
32    mkdir -p $(PKG_BUILD_DIR)
33    $(CP) ./src/* $(PKG_BUILD_DIR)/
34endef
35
36ifeq ($(BOARD),brcm-2.4)
37  BUILDFLAGS := -DBROADCOM -DBCMDRIVER -I$(LINUX_DIR)/arch/mips/bcm947xx/include
38else
39  ifeq ($(BOARD),brcm47xx)
40    BUILDFLAGS := -DBROADCOM
41  endif
42endif
43
44
45define Build/Compile
46    $(MAKE) -C "$(LINUX_DIR)" \
47        CROSS_COMPILE="$(TARGET_CROSS)" \
48        ARCH="$(LINUX_KARCH)" \
49        SUBDIRS="$(PKG_BUILD_DIR)" \
50        EXTRA_CFLAGS="$(BUILDFLAGS)" \
51        modules
52endef
53
54define Build/InstallDev
55    mkdir -p $(1)/usr/include
56    $(CP) ./src/switch-core.h $(1)/usr/include/
57endef
58
59define Build/UninstallDev
60    rm -f $(1)/usr/include/switch-core.h
61endef
62
63define KernelPackage/switch/install
64    $(INSTALL_DIR) $(1)/lib/network/
65    $(INSTALL_BIN) ./files/switch.sh $(1)/lib/network/
66endef
67
68$(eval $(call KernelPackage,switch))
69

Archive Download this file



interactive