s3c6410_U-boot Makefile分析(一)
来源:互联网 发布:mac ndk环境变量 编辑:程序博客网 时间:2024/05/29 08:37
U-boot Makefile分析(一)
VERSION = 2011
PATCHLEVEL = 09
SUBLEVEL =
EXTRAVERSION =
ifneq "$(SUBLEVEL)" ""
U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
else
U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL)$(EXTRAVERSION)
endif
TIMESTAMP_FILE = $(obj)include/timestamp_autogenerated.h
VERSION_FILE = $(obj)include/version_autogenerated.h
定义U-boot版本号变量U_BOOT_VERSION、时间戳头文件TIMESTAMP_FILE及版本信息头文件VERSION_FILE
HOSTARCH := $(shell uname -m | \
sed -e s/i.86/x86/ \
-e s/sun4u/sparc64/ \
-e s/arm.*/arm/ \
-e s/sa110/arm/ \
-e s/ppc64/powerpc/ \
-e s/ppc/powerpc/ \
-e s/macppc/powerpc/\
-e s/sh.*/sh/)
HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]' | \
sed -e 's/\(cygwin\).*/cygwin/')
定义利用shell函数初始化主机(Host)架构变量HOSTARCH、主机操作系统变量HOSTOS,可能的话使用sed编辑器替换成标准名字
# Set shell to bash if possible, otherwise fall back to sh
SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
else if [ -x /bin/bash ]; then echo /bin/bash; \
else echo sh; fi; fi)
export HOSTARCH HOSTOS SHELL
转化自定义变量 HOSTARCH HOSTOS SHELL成系统环境变量
# Deal with colliding definitions from tcsh etc.
VENDOR=
?
#########################################################################
# Allow for silent builds
ifeq (,$(findstring s,$(MAKEFLAGS)))
XECHO = echo
else
XECHO = :
endif
#########################################################################
当make使用–s参数时,不打印一些过程信息
ifdef O
ifeq ("$(origin O)", "command line")
BUILD_DIR := $(O)
endif
endif
ifneq ($(BUILD_DIR),)
saved-output := $(BUILD_DIR)
# Attempt to create a output directory.
$(shell [ -d ${BUILD_DIR} ] || mkdir -p ${BUILD_DIR})
# Verify if it was successful.
BUILD_DIR := $(shell cd $(BUILD_DIR) && /bin/pwd)
$(if $(BUILD_DIR),,$(error output directory "$(saved-output)" does not exist))
endif # ifneq ($(BUILD_DIR),)
OBJTREE := $(if $(BUILD_DIR),$(BUILD_DIR),$(CURDIR))
SPLTREE := $(OBJTREE)/spl
SRCTREE := $(CURDIR)
TOPDIR := $(SRCTREE)
LNDIR := $(OBJTREE)
export TOPDIR SRCTREE OBJTREE SPLTREE
MKCONFIG := $(SRCTREE)/mkconfig
export MKCONFIG
ifneq ($(OBJTREE),$(SRCTREE))
REMOTE_BUILD := 1
export REMOTE_BUILD
endif
Makefile支持编译的*.o文件存储在源文件之外的其它路径下,当make 命令行中有定义路径变量O,makefile脚本从命令行中提取出*.o文件路径BUILD_DIR。
OBJTREE := $(if $(BUILD_DIR),$(BUILD_DIR),$(CURDIR))
SPLTREE := $(OBJTREE)/spl
SRCTREE := $(CURDIR)
TOPDIR := $(SRCTREE)
LNDIR := $(OBJTREE)
export TOPDIR SRCTREE OBJTREE SPLTREE
初始化一些路径变量
- s3c6410_U-boot Makefile分析(一)
- u-boot分析(一)-----makefile分析
- U-boot Makefile 分析
- u-boot Makefile分析
- U-Boot Makefile分析
- u-boot makefile分析
- U-Boot Makefile分析
- U-Boot Makefile分析
- U-Boot Makefile分析
- u-boot Makefile分析
- U-Boot Makefile分析
- U-boot--Makefile分析
- u-boot Makefile分析
- u-boot的Makefile分析
- U-boot的Makefile分析
- u-boot顶层Makefile分析
- u-boot的Makefile分析
- u-boot的Makefile分析
- 在JQuery中阻止表单的提交动作
- QT学习 -->Qpointer
- IOS越狱开发起步教程
- iphone:file's owner以及outlet与连线的理解
- java 和 C++ Socket通信(java作为服务端server,C++作为客户端client,解决中文乱码问题GBK和UTF8)
- s3c6410_U-boot Makefile分析(一)
- ES PES TS流的区别
- drop 一张3.7T的含lob的分区表
- Quartz 2D Programming Guide
- 图形图像处理网文
- IOS 四种保存数据的方式!
- 我喜欢的些东西收藏
- list操作
- 两个排序数组求中值