Makefiles Description
The dmake 道具 uses makefile.mk.
The に引き続いて sections 述べる the general structure of
makefile.mk makefiles.
- General
Structure of
makefile.mkMakefiles - 世代 of 反対する とじ込み/提出するs and Libraries
- 世代 of 資源 とじ込み/提出するs
- 世代 of 使用/適用s
- 世代 of 株d Libraries or Dynamic Link Libraries
- 内部の Structure of the Makefiles
- Setting 付加 選択s
- 創造 of 付加 的s
General
Structure of makefile.mk Makefiles
The general 輪郭(を描く) of makefiles is as follows:
PRJ=..
PRJNAME=SW
TARGET=核心
.含む:settings.mk
# use the predefined 大型のs
.含む:的.mk
|
The に引き続いて (米)棚上げする/(英)提議する 述べるs the 大型のs you use in the general 輪郭(を描く) of a makefile.
| 大型の | 機能の Description |
|---|---|
PRJ |
This 大型の gives the 親族 position of the root of the 現在の module. |
PRJNAME |
This 大型の gives the 指名する of the module. This 指名する must be unique within the tree. |
TARGET |
This 大型の 明示するs an identifier for the 現在の directory. This
指名する must be unique within the module, or a filename 衝突 may occur in
the 生産(高) or the solver tree. |
世代 of 反対する とじ込み/提出するs and Libraries
The に引き続いて (米)棚上げする/(英)提議する 述べるs the 大型のs you use to 生成する 反対する とじ込み/提出するs and libraries. The x in these 大型のs signifies a number between one and nine. This 明示するs support for up to nine different libraries.
| 大型の | 機能の Description |
|---|---|
OBJFILES=$(OBJ)$/file1.obj $(OBJ)$/とじ込み/提出する.obj |
You must 始める,決める this 大型の to 生成する the appropriate 反対する とじ込み/提出するs
from the に引き続いて source とじ込み/提出するs:
This 大型の 確実にするs that the build 過程 creates the 反対する とじ込み/提出するs
for the compiler in the You can use these 的s can be used to 収集する C and C++ sources
設立する in different 場所s. See the The build 過程 usually creates a library from the 反対する とじ込み/提出するs
in the |
LIBTARGET=NO |
始める,決める this 大型の when you do not want to build a library. |
LIBxTARGET=$(LB)$/指名する.lib |
You can use several library 大型のs of this form to build libraries that do not consist of all 反対する とじ込み/提出するs in a directory or to 合併する different libraries. |
LIBxARCHIV=$(LB)$/libname.a |
始める,決めるs up support for static linking of libraries. Linux, Solaris, and Mac OS X support this 大型の. |
LIBxOBJFILES |
明示するs 反対する とじ込み/提出するs to 貯蔵所d into linked libraries. |
LIBxFILES |
明示するs その上の とじ込み/提出するs to link into the linked library. |
世代 of 資源 とじ込み/提出するs
The に引き続いて (米)棚上げする/(英)提議する 述べるs the 大型のs you use to 生成する 資源
とじ込み/提出するs. The German language 資源 とじ込み/提出するs are built by default. To support
other 地元のs, the 環境 variable UPDATER must be 始める,決める
to YES and the corresponding 地元の 環境 variable RES_language
must also be 始める,決める.
The x in these 大型の 指名するs signifies a number between one and nine. This 明示するs support for up to nine different 資源 とじ込み/提出するs.
| 大型の | 機能の Description |
|---|---|
SRCFILES=file1.src file2.src |
You must 始める,決める up this 大型の to 生成する 資源 とじ込み/提出するs. To create
one 資源 とじ込み/提出する from these とじ込み/提出するs the $(TARGET).srs とじ込み/提出する is
created in the srs subdirectory of the 生産(高) tree, for example:
|
SRSxNAMES and SRSxFILES |
You can use these 大型のs to support the building of several srs
とじ込み/提出するs. |
RESLIBxNAME and RESLIBxSRSFILES |
You can use these 大型のs to build 資源 DLLs. |
You can also 始める,決める the give_me_all_languages 環境 variable
to build 資源 とじ込み/提出するs for languages. However, this builds 資源 とじ込み/提出するs
for all languages.
世代 of 使用/適用s
The に引き続いて (米)棚上げする/(英)提議する 述べるs the 大型のs you use to 生成する 使用/適用s. The x in these 大型の 指名するs signifies a number between one and nine. This 明示するs support for up to nine different 使用/適用s.
| 大型の | 機能の Description |
|---|---|
APPxTARGET |
示すs the filename of the 使用/適用. The 使用/適用 is always
built in the 貯蔵所 directory of the 生産(高) tree. |
APPxOBJS |
示すs 反対する とじ込み/提出するs that link to the 使用/適用. Do not use this 大型の to build 反対するs, as it does not 認める dependencies. |
APPxSTDLIBS |
示すs 輸入する libraries that link to the 使用/適用. These
are 基準 binary libraries, such as .a and .so
とじ込み/提出するs. |
APPxLIBS |
示すs libraries from the same module that link to the 使用/適用. For UNIX these are simple text 名簿(に載せる)/表(にあげる)s of 反対する とじ込み/提出するs, rather than normal binary libraries. |
APPxDEF |
明示するs a 鮮明度/定義 とじ込み/提出する, if you use one in linking. For Win32 only. |
APPxDEPN |
明示するs dependencies. |
APPxRES |
明示するs system 資源s. For Win32 only. |
APPxICON |
明示するs an 使用/適用 icon. For Win32 only. |
世代 of 株d Libraries or Dynamic Link Libraries
The に引き続いて (米)棚上げする/(英)提議する 述べるs the 大型のs you use to 生成する 株d libraries or dynamic link libraries (DLLs). The x in these 大型の 指名するs signifies a number between one and nine. This 明示するs support for up to nine different 株d libraries.
| 大型の | 機能の Description |
|---|---|
SHLxTARGET |
示すs the filename of the 株d library.
In Win32, 株d libraries are always built as In UNIX, 株d libraries are built as |
UPD and DLLPOSTFIX |
供給する 壇・綱領・公約 and 解放(する) 独立した・無所属 指名するs, for example: bla$(UPD)$(DLLPOSTFIX)
results in bla599mi.dll for 解放(する) 599 on Windows NT. |
SHLxOBJS |
明示する the 反対する とじ込み/提出するs that are used to create the library. |
SHLxSTDLIBS |
Links 輸入する libraries. |
SHLxLIBS |
明示するs libraries from the same module to put into the 株d library. |
SHLxDEF |
明示するs the 輸出(する)d symbols とじ込み/提出する. For Win32 only. |
SHLxDEPN |
示すs dependencies. |
SHLxRES |
System 扶養家族 資源s use this 大型の. |
SHLxIMPLIB |
明示するs an 輸入する library to create. For Win32 only. |
DEFxNAME |
明示するs the 指名する of the 鮮明度/定義 とじ込み/提出する. This is usually a 類似の 指名する to the 株d library. |
DEFxDEPN |
示すs 鮮明度/定義 とじ込み/提出する dependencies. |
DEFLIBxNAME |
明示するs the library 指名する to parse for symbols. For Win32 only. |
DEFxDES |
A comment on the 鮮明度/定義 とじ込み/提出する. |
DEFxEXPORTyy |
A symbol 指名する. The y in this 大型の 指名する signifies a number from 1-99. |
DEFxEXPORTFILE |
A とじ込み/提出する of symbols to 輸出(する). |
The に引き続いて example shows how you can use these 大型のs:
$(MISC)$/$(SHLxTARGET).flt: @echo string >> $@
公式文書,認める: The new line and indentation are necessary for these lines to work.
This 命令(する) 生成するs a filter とじ込み/提出する for automatically creating a 鮮明度/定義
とじ込み/提出する. The ldump 道具 parses the library 明示するd in DEFLIBxNAME
for symbols, 除去するs all symbols that match the string in the *.flt
とじ込み/提出する, and 令状s the resulting 名簿(に載せる)/表(にあげる) into the 鮮明度/定義 とじ込み/提出する.
You can only do this for Win32. A 類似の 過程 for Linux, Solaris, and Mac OS X is planned.
内部の Structure of the Makefiles
Each makefile 含む/封じ込めるs an 含む 指示的な to a settings.mk
とじ込み/提出する, followed by an 含む 指示的な to a 的.mk とじ込み/提出する.
The に引き続いて sections 述べる these とじ込み/提出するs.
The settings.mk
とじ込み/提出する
The とじ込み/提出する settings.mk 始める,決めるs all the 全世界の settings for the
makefiles. It 始める,決めるs 大型のs, based on the に引き続いて:
- The underlying operating system.
- The compiler used.
- The 見解/翻訳/版 of the office 控訴 you are building.
For example, it 始める,決めるs the 指名する of the compiler used, linker, or library 経営者/支配人. It can also define the 指名するs of libraries, compiler switches, and link switches.
In the 的.mk とじ込み/提出する, the 基準 的 is predefined
depending on the 大型のs you 始める,決める. For example, it can 含む/封じ込める 声明s for
linking 使用/適用s, libraries, or 資源s. Typically, the 含む
指示的な gets these とじ込み/提出するs from solenv/inc. Typically, the
含む 指示的な gets these とじ込み/提出するs from solenv/inc.
There are other makefiles that 明示する particular settings that 支配(する)/統制する
parts of the build. The に引き続いて (米)棚上げする/(英)提議する 述べるs these special settings
makefiles. These makefiles are 含むd by either settings.mk
or 的.mk.
| Makefiles | Description |
|---|---|
unitools.mk |
This とじ込み/提出する defines 大型のs for 道具s which are 利用できる on different
壇・綱領・公約s, for example:
|
[upd]minor.mk |
大型のs such as BUILD and LAST_MINOR are
始める,決める in this とじ込み/提出する. |
libs.mk |
The 壇・綱領・公約-扶養家族 環境 体制/機構 for LIBRARIES
is 蓄える/店d in this とじ込み/提出する. |
壇・綱領・公約-指名する.mk |
These makefiles 明示する 壇・綱領・公約-扶養家族 特徴, for
example:
Other 壇・綱領・公約-明確な/細部 makefiles may also 存在する. For example:
These とじ込み/提出するs typically 含む/封じ込める variables which are used to change the build:
In 新規加入 there are 旗s enabled for profiling or debug builds:
There are corresponding linker 旗s for profiled and debug builds:
There is also support for whether the 的 is a 命令(する)-line 使用者 interface (CUI) or graphical 使用者 interface (GUI), whether it is an 反対する or 株d library and whether it is 選び出す/独身-threaded (ST) or multi- threaded (MT) by using the に引き続いて 旗s:
|
支配するs.mk |
This とじ込み/提出するs 明示するs the 支配するs for 収集するing the に引き続いて types
of とじ込み/提出する:
There may be many 支配するs to build each type of とじ込み/提出する. From these 支配するs, 存在するing source とじ込み/提出するs can build 的s. |
The 的.mk
とじ込み/提出する
After the 含む of settings.mk, the next major 含む
is the 的.mk とじ込み/提出する which 述べるs how to build the 的s
of each 壇・綱領・公約. The 的.mk とじ込み/提出する is divided into the に引き続いて
parts:
- 拡大 of the 全体にわたる 的s.
- Dependency order.
- Description of the に引き続いて individual 的s:
_tg_def.mk- the 鮮明度/定義 とじ込み/提出するs for 株d libraries (DLLs)._tg_sdi.mk- the 的 鮮明度/定義 for the IDL (svidl) とじ込み/提出するs.tg_obj.mk- the building of the library from 反対する とじ込み/提出するs.tg_slo.mk- the building of the library from.sloとじ込み/提出するs._tg_lib.mk- the building of the library from any とじ込み/提出するs._tg_srs.mk- the translation of the.srcとじ込み/提出するs._tg_res.mk- the translation of the.srsとじ込み/提出するs._tg_rslb.mk- 世代 of the 資源 DLLs._tg_shl.mk- 世代 of the 株d libraries.tg_jar.mk- 世代 of the jar とじ込み/提出するs.tg_dep.mk- 世代 of the dependencies.
The とじ込み/提出する also 含むs the descriptions of many その上の 的s such as
killobj, killbin, and so on.
Setting 付加 選択s
You use the 大型のs 述べるd in the に引き続いて (米)棚上げする/(英)提議する to 始める,決める 付加 選択s.
| Makefiles | Description |
|---|---|
ENVCFLAGS |
This 大型の supports 付加 compiler 選択s for C. |
ENVCXXFLAGS |
This 大型の supports 付加 compiler 選択s for C++. |
ENVLINKFLAGS |
This 大型の supports 付加 linker 選択s. |
創造 of 付加 的s
The に引き続いて sections 述べる ways to create 付加 的s in a makefile.
追加する 的s to all
To build 的s other than the default 的s that are created by the
的.mk とじ込み/提出する, follow these steps:
- 追加する the 的s to the 的
allas dependencies. - End the 名簿(に載せる)/表(にあげる) of 的s with
ALLTAR. - Make sure
的 allに先行するs the 含む of的.mkin the makefile.
If you 令状 your 的 in a 壇・綱領・公約 独立した・無所属 form without using
any hard-coded pathnames, 確実にする that your 的 appears before the .含む:的.mk
指示的な. If this 作品, this is an 許容できる way to create an 付加
的.
追加するing 的s to a Makefile That 含む 的s
The typical way to 追加する a 的 is to 追加する it to an 存在するing makefile.mk
that already 含むs 的s. This 原因(となる)s the に引き続いて problems:
- If you place your 的 before the
.含む:的.mk指示的な in the makefile, it 無能にするs the 全世界の 的s. - If you place your 的 after the
.含む:的.mk指示的な,dmakedoes not build the 的. - If you try to build your 的 by using the technique in the に引き続いて
見本, you may 遭遇(する) several other problems.
all: \ new-的 \
ALLTARThe first 的 is always built. When doing an 初期の build,
dmakeenters 明言する/公表するs where noALLTARis defined and 陳列する,発揮するs an error message and stops.There is also no 保証(人)d order of 死刑執行 of those two 的s. It may work most of the time and produce unusual errors on multiprocessor machines.
宣言するing Dependencies Before 追加するing 的s
Define explicit dependencies as follows:
#this 反対する depends on 生成するd source
$(OBJ)$/myobject.obj : $(MISC)$/myobject.cxx
|
Then define the 的 to 生成する the source とじ込み/提出する after this 声明.
If this 反対する is needed now, there is a dependency on the source とじ込み/提出する and
the 的 is 遂行する/発効させるd. You must define all the 的s and dependencies
after the .含む:的.mk指示的な.
There is still a 可能性のある problem of 衝突s with 的s 追加するd to the 全世界の makefiles in the 未来. If something in the build 環境 changes and 影響する/感情s your 的, it may be difficult to identify the change.

