Mtek0512 | ea5f1c2 | 2025-08-21 20:56:51 +0800 | [diff] [blame^] | 1 | # |
| 2 | # Copyright (C) 2007 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 | |
| 9 | include $(TOPDIR)/rules.mk |
| 10 | include $(INCLUDE_DIR)/kernel.mk |
| 11 | |
| 12 | PKG_NAME:=opt-cmd-36 |
| 13 | PKG_VERSION:=1 |
| 14 | |
| 15 | PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) |
| 16 | PREBUILT_DIR:=$(CURDIR)/files |
| 17 | |
| 18 | PKG_MAINTAINER:=<you.chen@mobiletek.cn> |
| 19 | |
| 20 | include $(INCLUDE_DIR)/package.mk |
| 21 | |
| 22 | define KernelPackage/opt-cmd-36 |
| 23 | TITLE:=Mbtk Optimize command 36 |
| 24 | DEPENDS:=@TARGET_mmp |
| 25 | FILES:=$(PKG_BUILD_DIR)/opt_cmd_36.ko |
| 26 | VERSION:=$(LINUX_VERSION)+$(PKG_NAME)-$(PKG_VERSION) |
| 27 | endef |
| 28 | |
| 29 | define KernelPackage/opt_cmd_36/description |
| 30 | Kernel support for Optimize command 36 |
| 31 | endef |
| 32 | |
| 33 | EXTRA_CFLAGS:= \ |
| 34 | |
| 35 | |
| 36 | MAKE_CMD:=$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \ |
| 37 | ARCH="$(LINUX_KARCH)" \ |
| 38 | CROSS_COMPILE="$(TARGET_CROSS)" \ |
| 39 | M="$(PKG_BUILD_DIR)" \ |
| 40 | cmd_ar='rm -f $$$$@; $(TARGET_CROSS)ar cDrs $$$$@ $$$$(real-prereqs)' \ |
| 41 | EXTRA_CFLAGS="$(EXTRA_CFLAGS)" |
| 42 | |
| 43 | |
| 44 | CLEAN_CMD:=rm -rf $(PKG_BUILD_DIR)/{*.o,*.mod.*,modules.order,Module.symvers,ipkg-*,*.ko,*.a,ipkg-*} \ |
| 45 | rm -rf $(MRVLDIR)/fastpath/{*.o,*.mod.*,modules.order,Module.symvers,ipkg-*,*.ko,*.a,ipkg-*} |
| 46 | |
| 47 | define Build/Prepare/Prebuilt |
| 48 | @rm -rf $(PKG_BUILD_DIR) |
| 49 | endef |
| 50 | |
| 51 | $(STAMP_PREPARED): FORCE |
| 52 | |
| 53 | define Build/Prepare |
| 54 | @mkdir -p $(PKG_BUILD_DIR) |
| 55 | @cp -rf $(PREBUILT_DIR)/* $(PKG_BUILD_DIR) |
| 56 | endef |
| 57 | |
| 58 | define Build/Compile |
| 59 | $(MAKE_CMD) modules |
| 60 | mkdir -p $(BIN_DIR)/symbol/modules |
| 61 | cp -rf $(PKG_BUILD_DIR)/opt_cmd_36.o $(BIN_DIR)/symbol/modules/ |
| 62 | endef |
| 63 | |
| 64 | define Build/Clean |
| 65 | $(if $(wildcard $(USE_SOURCE_DIR)), $(CLEAN_CMD),) |
| 66 | endef |
| 67 | |
| 68 | $(eval $(call KernelPackage,opt-cmd-36)) |