Adam Števko
2016-05-08 d180f2068774a734140412f7d02bb6f83c4525b3
commit | author | age
d180f2 1
2 This is a guide to explain various useful targets in Userland component
3 Makefiles.  There is a set of targets that all Makefiles must include, plus
4 some addtional targets that are there for convenience.
5
6 component-environment-check::
7   This target is an optional target that will be included in most Makefiles
8   automatically.  It is defined in $(WS_MAKE_RULES)/environment.mk which is
9   included by $(WS_MAKE_RULES)/shares-macros.mk.  It reports on some interesting
10   information about the current environment and whether or not it is suitable
11   to build, publish, or test the component.
12
13 component-environment-prep::
14   This target is an optional target that will be included in most Makefiles
15   automatically.  It is defined in $(WS_MAKE_RULES)/environment.mk which is
16   included by $(WS_MAKE_RULES)/shares-macros.mk.  It uses the REQUIRE_PACKAGES
17   macro contents to attempt to install any required packages in the current
18   environment.  It should never by used by developers to update any public
19   build machines as those are managed by dedicated staff.
20
21 download::
22   This target is present in all Makefiles.  It can be used at the top level
23   to act across all components, or on an individual component basis.  It is
24   typically defined by including $(WS_MAKE_RULES)/prep.mk in your component
25   Makefile.  This target depends on your component Makefile, so changes to your
26   component Makefile will automatically trigger a re-download and subsequent
27   build steps that depend on it.  You can use the MAKEFILE_PREREQ macro to
28   override this behaviour and avoid rebuilding with each Makefile change.  This
29   macro should only be used in the calling environment via something like:
30     $ gmake MAKEFILE_PREREQ= install
31
32 unpack::
33   This target is present in all Makefiles.  It can be used at the top level
34   to act across all components, or on an individual component basis.  It is
35   typically defined by including $(WS_MAKE_RULES)/prep.mk in your component
36   Makefile.  This target depends on the previously described "download" target,
37   This target will unpack any downloaded source archives.  It is an interim
38   step in the source code preparation phase of the build.
39
40 patch::
41   This target is present in all Makefiles.  It can be used at the top level
42   to act across all components, or on an individual component basis.  It is
43   typically defined by including $(WS_MAKE_RULES)/prep.mk in your component
44   Makefile.  This target depends on the previously described "unpack" target,
45   This target will patch any unpacked source.  It is an interim step in the
46   source code preparation phase of the build.
47
48 prep::
49   This target is present in all Makefiles.  It can be used at the top level
50   to act across all components, or on an individual component basis.  It is 
51   typically defined by including $(WS_MAKE_RULES)/prep.mk in your component
52   Makefile.  It depends on the previously described "download" target, as well
53   as internal interim targets to unpack source archives and apply patches to
54   the unpacked source.
55
56 configure:
57   This target is an optional target that can be included in component Makefiles
58   to run the community source configuration phase of a component build.  It is
59   typically defined in component Makefiles that make use of the
60   $(WS_MAKE_RULES)/configure.mk Makefile fragment, but could be defined in
61   others that include a source code configuration step.  It is not explicitly
62   called during the build, but provides a convenient means of downloading,
63   unpacking, patching, and "configuring" component source for building without
64   actually compiling the bits.
65
66 build::
67   This target must be present in all Makefiles.  It can be used at the top level
68   to act across all components, or on an individual component basis.  It is
69   defined in the individual component Makefiles, but most Makefile fragments
70   under $(WS_MAKE_RULES) include targets that allow the definitions to depend
71   on one of several convenience macros $(BUILD_32), $(BUILD_64),
72   $(BUILD_32_and_64), and $(BUILD_NO_ARCH) to build 32-bit support, 64-bit
73   support, both 32 and 64 bit support, or architecture neutral support.  The
74   macro used will depend on the component.
75
76 install::
77   This target must be present in all Makefiles.  It can be used at the top level
78   to act across all components, or on an individual component basis.  It is
79   defined in the individual component Makefiles, but most Makefile fragments
80   under $(WS_MAKE_RULES) include targets that allow the definitions to depend
81   on one of several convenience macros $(INSTALL_32), $(INSTALL_64),
82   $(INSTALL_32_and_64), and $(INSTALL_NO_ARCH) to install 32-bit support, 64-bit
83   support, both 32 and 64 bit support, or architecture neutral support.  The
84   macro used will depend on the component and corresponds to the build target
85   macro used.
86
87 pkglint::
88   This target is an optional target is automatically defined in each Makefile
89   by the inclusion of $(WS_MAKE_RULES)/prep.mk.  It will run the build steps
90   necessary to pkglint the manifests for a component.
91
92 publish::
93   This target is present in all Makefiles.  It can be used at the top level
94   to act across all components, or on an individual component basis.  It is
95   automatically defined by including $(WS_MAKE_RULES)/ips.mk.  It depends
96   on the previously described 'install' target and will perform a series of
97   internal, intermediate steps to use the component package manifests to
98   generate and publish packages for that component.
99
100 clean::
101   This target is present in all Makefiles.  It can be used at the top level
102   to act across all components, or on an individual component basis.  It is
103   often automatically defined by including one of the $(WS_MAKE_RULES)
104   Makefile fragments.  It cleans up any files created by building the component
105   with the exception of any downloaded files.
106
107 clobber::
108   This target is present in all Makefiles.  It can be used at the top level
109   to act across all components, or on an individual component basis.  It is
110   often automatically defined by including one of the $(WS_MAKE_RULES)
111   Makefile fragments.  It depends on the previously described 'clean' target
112   and additionally cleans up any downloaded source archives.  In addition,
113   when done from the top level or component sub-directory, it will do a find
114   of 'manifest-*.published' and clean those up; these can be left over from
115   components that were published but then 'hg rm'd before the next clobber.
116
117 REQUIRED_PACKAGES::
118   This target is present in all component Makefiles.  It is automatically
119   defined by including $(WS_MAKE_RULES)/ips.mk.  It is a convenience that can
120   be used to generate the set of REQUIRED_PACKAGES that is needed by the
121   'pkgdepend resolve' portion of package generation and publication (publish
122   target).  It automatically appends to the component Makefile, but the results
123   should be
124   manually verified.