major target cleanup. it is now possible to have subtargets that can override many...
[openwrt.git] / 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 # $Id$
8
9 include $(TOPDIR)/rules.mk
10 include $(INCLUDE_DIR)/kernel.mk
11
12 PKG_NAME:=kmod-switch
13 PKG_RELEASE:=1
14
15 include $(INCLUDE_DIR)/package.mk
16
17 define KernelPackage/switch
18 SUBMENU:=Other modules
19 DEPENDS:=@TARGET_brcm_2_4||TARGET_brcm47xx
20 TITLE:=Switch drivers
21 FILES:= \
22 $(PKG_BUILD_DIR)/switch-core.$(LINUX_KMOD_SUFFIX) \
23 $(PKG_BUILD_DIR)/switch-adm.$(LINUX_KMOD_SUFFIX) \
24 $(PKG_BUILD_DIR)/switch-robo.$(LINUX_KMOD_SUFFIX)
25 AUTOLOAD:=$(call AutoLoad,20,switch-core switch-robo switch-adm)
26 endef
27
28 define KernelPackage/switch/description
29 This package contains switch drivers for ADM6996L and BCM53XX RoboSwitch.
30 endef
31
32 define Build/Prepare
33 mkdir -p $(PKG_BUILD_DIR)
34 $(CP) ./src/* $(PKG_BUILD_DIR)/
35 endef
36
37 ifeq ($(BOARD),brcm-2.4)
38 BUILDFLAGS := -DBROADCOM -DBCMDRIVER -I$(LINUX_DIR)/arch/mips/bcm947xx/include
39 else
40 ifeq ($(BOARD),brcm47xx)
41 BUILDFLAGS := -DBROADCOM
42 endif
43 endif
44
45
46 define Build/Compile
47 $(MAKE) -C "$(LINUX_DIR)" \
48 CROSS_COMPILE="$(TARGET_CROSS)" \
49 ARCH="$(LINUX_KARCH)" \
50 SUBDIRS="$(PKG_BUILD_DIR)" \
51 EXTRA_CFLAGS="$(BUILDFLAGS)" \
52 modules
53 endef
54
55 define KernelPackage/switch/install
56 $(INSTALL_DIR) $(1)/lib/network/
57 $(INSTALL_BIN) ./files/switch.sh $(1)/lib/network/
58 endef
59
60 $(eval $(call KernelPackage,switch))
This page took 0.041556 seconds and 5 git commands to generate.