-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile_pkg_openwrt
62 lines (48 loc) · 1.35 KB
/
Makefile_pkg_openwrt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Based on OpenWrt buildroot template
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=hpt
PKG_REV:=1
PKG_VERSION:=1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
define KernelPackage/hpt
SUBMENU:=Other modules
TITLE:=High precision timer
VERSION:=$(LINUX_VERSION)+$(PKG_VERSION)-$(BOARD)-$(PKG_RELEASE)
FILES:= $(PKG_BUILD_DIR)/hpt.$(LINUX_KMOD_SUFFIX)
AUTOLOAD:=$(call AutoLoad,30,hpt)
endef
define KernelPackage/hpt/description
High precision timer module
endef
define KernelPackage/hpt/config
menu "Configuration"
depends on PACKAGE_kmod-hpt
config DEBUG_HPT
bool "Enable debug printk"
default n
endmenu
endef
BUILDFLAGS:= \
$(if $(CONFIG_DEBUG_HPT),-DDEBUG_HPT)
MAKE_ARGS:= \
ARCH="$(LINUX_KARCH)" \
KERNELDIR="$(LINUX_DIR)" \
CROSS_COMPILE="$(KERNEL_CROSS)" \
EXTRA_CFLAGS="$(BUILDFLAGS)"
define Build/Prepare
$(RM) -rf $(PKG_BUILD_DIR)
mkdir -p $(PKG_BUILD_DIR)
$(CP) $(DL_DIR)/$(PKG_SOURCE)/* $(PKG_BUILD_DIR)/
endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS)
endef
define KernelPackage/hpt/install
$(INSTALL_DIR) $(1)/lib/modules/$(LINUX_VERSION)
$(INSTALL_DATA) $(PKG_BUILD_DIR)/hpt.$(LINUX_KMOD_SUFFIX) $(1)/lib/modules/$(LINUX_VERSION)
endef
$(eval $(call KernelPackage,hpt))