source: trunk/kBuild/doc/QuickReference-kBuild.txt@ 2341

Last change on this file since 2341 was 2341, checked in by bird, 16 years ago

kickoff for the kBuild docs.

  • Property svn:eol-style set to native
File size: 3.1 KB
Line 
1
2kBuild Quick Reference
3======================
4
5This is an attempt at summarizing the magic of kBuild makefiles.
6
7
8The anatomy of a kBuild Makefile
9--------------------------------
10
11A typical template::
12
13 # $Id: $
14 ## @file
15 # Makefile descriptions
16 #
17
18 #
19 # Copyright (c) year
20 # License and other legal stuff.
21 #
22
23 SUB_DEPTH = ../..
24 include $(KBUILD_PATH)/subheader.kmk
25
26 #
27 # Global variables (optional).
28 #
29 MYPREFIX_SOMETHING = or another
30
31 #
32 # Target lists.
33 #
34 DLLS += mydll
35 PROGRAMS += myprogs
36
37 #
38 # mydll - description.
39 #
40 mydll_TEMPLATE = MYDLL
41 mydll_SOURCES = mydll.c
42 mydll_SOURCES.win = $(mydll_0_OUTDIR)/mydll.def
43
44 #
45 # myprog - description.
46 #
47 myprog_TEMPLATE = MYPROG
48 myprog_SOURCES = myprog.c
49
50 #
51 # Custom rules (optional of course).
52 #
53 $$(mydll_0_OUTDIR)/mydll.def:
54 $(APPEND) -t $@ LIBRARY mydll.dll
55 $(APPEND) $@ EXPORTS
56 $(APPEND) $@ ' myfunction'
57
58 include $(FILE_KBUILD_SUB_FOOTER)
59
60 #
61 # More optional rules.
62 #
63
64That's it.
65
66
67Target lists
68------------
69
70The table gives the target lists in the typical pass order.
71
72+----------------------+-------------------------------------------------------+
73| Name | Description |
74+======================+=======================================================+
75| ``BLDPROGS`` | Build programs, targets the host platform. |
76+----------------------+-------------------------------------------------------+
77| ``LIBRARIES`` | Libraries (not shared). |
78+----------------------+-------------------------------------------------------+
79| ``IMPORT_LIBS`` | Import libraries or stub shared libraries. |
80+----------------------+-------------------------------------------------------+
81| ``DLL`` | DLLs, Shared Libraries, DYLIBs, etc. |
82+----------------------+-------------------------------------------------------+
83| ``PROGRAMS`` | Executable programs. |
84+----------------------+-------------------------------------------------------+
85| ``SYSMODS`` | System modules (kexts, kernel modules, drivers, etc). |
86+----------------------+-------------------------------------------------------+
87| ``MISCBINS`` | Miscellanceous binaries like BIOS images and such. |
88+----------------------+-------------------------------------------------------+
89| ``OTHERS`` | List of targets made during the others pass. |
90+----------------------+-------------------------------------------------------+
91| ``INSTALLS`` | Things to install. [1]_ |
92+----------------------+-------------------------------------------------------+
93| ``FETCHES`` | Things to fetch. [1]_ |
94+----------------------+-------------------------------------------------------+
95
96
97
98-----
99
100.. [1] Normally not one of the default passes.
101
102-----
103
104:Status: $Id$
105:Copyright: Copyright (c) 2009 knut st. osmundsen
106
Note: See TracBrowser for help on using the repository browser.