OpenSolaris uts源代码的makefile结构

原创 2007年09月20日 14:12:00

Makefile Layout

This discussion is intended to provide a step-by-step explanation of what targets exist and how they are built by the makefiles. I ignore the platform-specific module architecture because it is unlikely to be of significant interest except to hardware support engineers. The three main subtrees of interest are the kernel (uts), commands and daemons (cmd), and libraries (lib). The next three subsections cover these three subtrees in turn. There are also a handful of makefiles which apply to all builds:

usr/src/Makefile
This is the top-level makefile. It drives builds for various targets in each subdirectory. It is aware of the specific targets that need to be built in each subdirectory in order to perform a complete build, and itself knows how to create a skeleton proto area for later use by install and install_h targets.
usr/src/Makefile.lint
All linting from the top level is driven by this makefile. It contains long lists of directories known to be lint-clean and contains simple recursive rules for rebuilding each subdirectory's lint target. The actual linting is driven by the lower-level makefiles.
usr/src/Makefile.master
usr/src/Makefile.master.64
These two makefiles contain generic definitions, such as build and installation tools locations, template macros for compilers, linkers, and other tools to be used by other makefiles in defining rules, and global definitions such as the ISA and machine names that apply to this build. Makefile.master.64 contains definitions specific to 64-bit builds that override the generic definitions.
usr/src/Makefile.msg.targ
Common targets for building message catalogues are defined here. Message catalogues provide translations of messages for g11n purposes.
usr/src/Makefile.psm
This makefile defines the installation locations for platform-specific modules. These are analogous to the other kernel module install locations /kernel and /usr/kernel (see section 3.2.6 below for more information on kernel module installation).
usr/src/Makefile.psm.targ
Installation target definitions for platform-specific modules are defined here. This instructs the build system how to install files into the directories defined by Makefile.psm.
usr/src/Targetdirs
This is a set of definitions for the owner, group, and permissions of each directory that will be created by the installation process. It also contains information about special symbolic links to be installed for some 64-bit library versions.

3.2.3.1 Kernel Makefile Layout

The driving makefile for any module is located in the leaf directory (build directory) where the module and its component objects are built. After a 'make clobber' operation, the makefile should be the only file remaining in that directory. There are two other types of makefiles in the tree: suffixed and non-suffixed. Common definitions and rules needed by all leaf makefiles are contained in the suffixed makefiles; these are included by leaf makefiles. Non-suffixed makefiles generally invoke multiple lower-level makefiles with the same target so that many modules can be built with a single make invocation.

uts/Makefile
uts/sparc/Makefile
uts/sun4u/Makefile
uts/intel/Makefile
uts/intel/ia32/Makefile
uts/i86pc/Makefile
These makefiles generally are cognizant of the components made in subdirectories and invoke makefiles in those sub- directories to perform the actual build. Some targets (or pseudo-targets) may be directly built at this level (such as the cscope databases).
uts/Makefile.uts
Contains common definitions for all possible architectures.
uts/Makefile.targ
Contains common targets for all possible architectures.
uts/common/Makefile.files
uts/sun/Makefile.files
uts/sparc/Makefile.files
uts/sun4/Makefile.files
uts/sun4u/Makefile.files
uts/intel/Makefile.files
uts/intel/ia32/Makefile.files
uts/i86pc/Makefile.files
These makefiles are divided into two sections. The first section defines the object lists which comprise each module. The second section defines the appropriate header search paths and other machine-specific global build parameters.
uts/common/Makefile.rules
uts/sun/Makefile.rules
uts/sparc/Makefile.rules
uts/sun4/Makefile.rules
uts/sun4u/Makefile.rules
uts/intel/Makefile.rules
uts/intel/ia32/Makefile.rules
uts/intel/amd64/Makefile.rules
uts/i86pc/Makefile.rules
The files provide build rules (targets) which allow make to function in a multiple directory environment. Each source tree below the directory containing the makefile has a build rule in the file.
uts/sun4/Makefile.sun4
uts/sun4u/Makefile.sun4u
uts/intel/Makefile.intel
uts/intel/ia32/Makefile.ia32
uts/i86pc/Makefile.i86pc
These makefiles contain the definitions specific (defaults) to the obvious ``implementation architecture''. These rules can be overridden in specific leaf node makefiles if necessary.
uts/sun4u/unix/Makefile
uts/i86pc/unix/Makefile
Main driving makefile for building unix.
uts/sun4u/MODULE/Makefile (for MODULE in cgsix, cpu, kb, ...)
Main driving makefile for building MODULE.
uts/sun4u/genunix/Makefile
uts/i86pc/genunix/Makefile
Main driving makefile for building genunix.

Issuing the command 'make' in the uts directory will cause all supported, modularized kernels and modules to be built.

Issuing the command 'make' in a uts/ARCHITECTURE directory (i.e.: uts/sparc) will cause all supported, ``implementation architecture''-independent modules for ARCHITECTURE to be built.

Issuing the command 'make' in a uts/MACHINE directory (i.e.: uts/sun4u) will cause that kernel and all supported, ``implementation architecture''- dependent modules for MACHINE to be built.

The makefiles are verbosely commented. It is desired that they should stay this way.

 

linux命名空间UTS 总结

本文介绍linux上域名命名空间的例子和试验结果。
  • caleb_zhou
  • caleb_zhou
  • 2017年06月06日 01:21
  • 285

工作日志——UTS数据库同步操作

1、新建设置 右键单击——>新建设置 登录账号为用户给的名字(一般默认为证券简称拼音) 用户名称一致 2、常规设置 选择数据库下载,oracel数据库,数据库地址为安装数据库...
  • liucunguang2
  • liucunguang2
  • 2014年03月20日 14:22
  • 1072

Linux命名空间入门(一) UTS命名空间

http://www.tuicool.com/articles/7v2ai22 时间 2014-12-25 16:26:47  极客头条 原文  http://dockerone.com/...
  • weifenghai
  • weifenghai
  • 2016年10月17日 09:32
  • 692

源代码到可执行代码的过程以及Makefile的编写

源代码到可执行代码的过程以及Makefile的编写1过程的三个步骤 预处理。C预处理扩展代码,插入所有用#include命令制定的文件,并扩展所有的用#define声明的宏。 编译。编译器产生源代码的...
  • men_wen
  • men_wen
  • 2016年09月18日 22:24
  • 510

OpenSolaris的下载地址

本文发表于: http://www.usenix.cn/viewthread.php?tid=4&extra=page%3D1  转载请保留该地址OpenSolaris下载:http://www.op...
  • enjoyo
  • enjoyo
  • 2007年09月19日 09:40
  • 1503

【Linux】linux源码Makefile的详细分析

众多的资料(《嵌入式Linux应用开发完全手册》、Documentation/kbuild/makefiles.txt)已经向我们展示了一个初级Linux用户者应该懂得的知识--怎样添加需要编译的文件...
  • d521000121
  • d521000121
  • 2017年04月07日 22:51
  • 584

Solaris:OpenSolaris体验〔安装篇〕

之前我也曾经安装过Solaris 10,但是由于是安装在移动硬盘里的,我的本本有4个usb接口,比较郁闷,那时我都是随便插的,使用其他usb接口时会导致Solaris在启动过程中不断重启。我以为是So...
  • wargrey
  • wargrey
  • 2008年10月17日 11:23
  • 4024

安装Opensolaris 2008.11

Opensolaris 2008.11正式发布,赶紧拿来在自己的笔记本上安装,很想体验一下ZFS的Time Slider功能是如何的强大。DELL Inspiron 1420半年前曾经在1420上装过...
  • yayong
  • yayong
  • 2008年12月26日 21:43
  • 2230

最近OpenSolaris很红火,但是到底哪个版本更适合你呢?

如果您需要运行基于 OpenSolaris 的发行版本,请从下列选项选择:Solaris Express, Community Release – DVD: 下载 | CD: 下载Solaris Ex...
  • magicbreaker
  • magicbreaker
  • 2008年02月02日 14:26
  • 920

bootstrap源码分析系列:一,文件结构和开发环境

本文基于bootstrap2.3.2。 一,文件结构: ▾ docs/   ▸ assets/   ▸ build/   ▸ examples/   ▸ templates/    ...
  • lihongxun945
  • lihongxun945
  • 2014年01月02日 17:23
  • 13041
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:OpenSolaris uts源代码的makefile结构
举报原因:
原因补充:

(最多只允许输入30个字)