简体   繁体   English

Openwrt的makefile

[英]Openwrt makefile

I'm new with OpenWrt and I'm trying to cross compile a new kernel. 我是OpenWrt的新手,正在尝试交叉编译新内核。 To have a clue, I checked one file in /source/package/kernel/linux/modules called video.mk 为了提供线索,我检查了/ source / package / kernel / linux / modules中的一个文件video.mk

I can see there are some variables, like $(VIDEO_MENU) which I can clearly see it was defined, but what is $(LINUX_DIR)? 我可以看到有一些变量,例如$(VIDEO_MENU),可以清楚地看到它已定义,但是$(LINUX_DIR)是什么? I though it was a env variable, but when I go to the terminal and enter echo $LINUX_DIR I get nothing 我虽然是一个环境变量,但是当我进入终端并输入echo $LINUX_DIR我什么也没得到

#
# Copyright (C) 2009 David Cooper <dave@kupesoft.com>
# Copyright (C) 2006-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

VIDEO_MENU:=Video Support

V4L2_DIR=v4l2-core
V4L2_USB_DIR=usb

#
# Video Display
#

define KernelPackage/backlight
        SUBMENU:=$(VIDEO_MENU)
        TITLE:=Backlight support
        DEPENDS:=@DISPLAY_SUPPORT
        HIDDEN:=1
        KCONFIG:=CONFIG_BACKLIGHT_CLASS_DEVICE \
                CONFIG_BACKLIGHT_LCD_SUPPORT=y \
                CONFIG_LCD_CLASS_DEVICE=n \
                CONFIG_BACKLIGHT_GENERIC=n \
                CONFIG_BACKLIGHT_ADP8860=n \
                CONFIG_BACKLIGHT_ADP8870=n \
                CONFIG_BACKLIGHT_OT200=n \
                CONFIG_BACKLIGHT_PM8941_WLED=n
        FILES:=$(LINUX_DIR)/drivers/video/backlight/backlight.ko
        AUTOLOAD:=$(call AutoProbe,video backlight)
endef

.
.
.

LINUX_DIR and kernel related variable and generic build functions are written inside kernel.mk, which is part of source/include directory. LINUX_DIR以及与内核相关的变量和通用构建函数都在kernel.mk中编写,该文件是source / include目录的一部分。

If you want to print the value of any of these variable, you can use Makefile log functionality as described in GNU make 如果要打印任何这些变量的值,可以使用GNU make中描述的Makefile日志功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM