Marcel Telka
2024-04-06 7a1e91471d4b540f48a912dfcca9f65211aa599c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
This is a guide to explain various useful targets in Userland component
Makefiles.  There is a set of targets that all Makefiles must include, plus
some addtional targets that are there for convenience.
 
component-environment-check::
  This target is present in all Makefiles.  It is defined in
  $(WS_MAKE_RULES)/environment.mk which is included by
  $(WS_MAKE_RULES)/shares-macros.mk.  It reports on some interesting
  information about the current environment and whether or not it is suitable
  to build and/or publish the component.
 
component-environment-prep::
  This target is present in all Makefiles.  It is defined in
  $(WS_MAKE_RULES)/environment.mk which is included by
  $(WS_MAKE_RULES)/shares-macros.mk.  It uses both USERLAND_REQUIRED_PACKAGES
  and REQUIRED_PACKAGES macro contents to attempt to install any required
  packages in the current environment.  To use this target user has to be
  assigned "Software Installation" or "Primary Administrator" profile.
 
component-test-environment-check::
  This target is present in all Makefiles.  It is defined in
  $(WS_MAKE_RULES)/environment.mk which is included by
  $(WS_MAKE_RULES)/shares-macros.mk.  It reports on some interesting
  information about the current environment and whether or not it is suitable
  to test the component.
 
component-test-environment-prep::
  This target is present in all Makefiles.  It is defined in
  $(WS_MAKE_RULES)/environment.mk which is included by
  $(WS_MAKE_RULES)/shares-macros.mk.  It uses both
  USERLAND_TEST_REQUIRED_PACKAGES and TEST_REQUIRED_PACKAGES macro contents to
  attempt to install any required packages in the current environment.  To use
  this target user has to be assigned "Software Installation" or "Primary
  Administrator" profile.
 
download::
  This target is present in all Makefiles.  It can be used at the top level
  to act across all components, or on an individual component basis.  It is
  typically defined by including $(WS_MAKE_RULES)/common.mk in your component
  Makefile.  This target depends on your component Makefile, so changes to your
  component Makefile will automatically trigger a re-download and subsequent
  build steps that depend on it.  You can use the MAKEFILE_PREREQ macro to
  override this behaviour and avoid rebuilding with each Makefile change.  This
  macro should only be used in the calling environment via something like:
    $ gmake MAKEFILE_PREREQ= install
 
unpack::
  This target is present in all Makefiles.  It can be used at the top level
  to act across all components, or on an individual component basis.  It is
  typically defined by including $(WS_MAKE_RULES)/common.mk in your component
  Makefile.  This target depends on the previously described "download" target,
  This target will unpack any downloaded source archives.  It is an interim
  step in the source code preparation phase of the build.
 
patch::
  This target is present in all Makefiles.  It can be used at the top level
  to act across all components, or on an individual component basis.  It is
  typically defined by including $(WS_MAKE_RULES)/common.mk in your component
  Makefile.  This target depends on the previously described "unpack" target,
  This target will patch any unpacked source.  It is an interim step in the
  source code preparation phase of the build.
 
prep::
  This target is present in all Makefiles.  It can be used at the top level
  to act across all components, or on an individual component basis.  It is 
  typically defined by including $(WS_MAKE_RULES)/common.mk in your component
  Makefile.  It depends on the previously described "download" target, as well
  as internal interim targets to unpack source archives and apply patches to
  the unpacked source.
 
build::
  This target must be present in all Makefiles.  It can be used at the top level
  to act across all components, or on an individual component basis.  It is
  defined in the individual component Makefiles, but most Makefile fragments
  under $(WS_MAKE_RULES) include targets that allow the definitions to depend
  on one of several convenience macros $(BUILD_32), $(BUILD_64),
  $(BUILD_32_and_64), and $(BUILD_NO_ARCH) to build 32-bit support, 64-bit
  support, both 32 and 64 bit support, or architecture neutral support.  The
  macro used will depend on the component.
 
install::
  This target must be present in all Makefiles.  It can be used at the top level
  to act across all components, or on an individual component basis.  It is
  defined in the individual component Makefiles, but most Makefile fragments
  under $(WS_MAKE_RULES) include targets that allow the definitions to depend
  on one of several convenience macros $(INSTALL_32), $(INSTALL_64),
  $(INSTALL_32_and_64), and $(INSTALL_NO_ARCH) to install 32-bit support, 64-bit
  support, both 32 and 64 bit support, or architecture neutral support.  The
  macro used will depend on the component and corresponds to the build target
  macro used.
 
pkglint::
  This target is an optional target is automatically defined in each Makefile
  by the inclusion of $(WS_MAKE_RULES)/common.mk.  It will run the build steps
  necessary to pkglint the manifests for a component.
 
pre-publish::
  This target is present in all Makefiles.  It can be used at the top level
  to act across all components, or on an individual component basis.  It is
  automatically defined by including $(WS_MAKE_RULES)/common.mk.  It depends
  on the previously described 'install' target and will perform a series of
  internal, intermediate steps to use the component package manifests to
  generate and validate consistency of packages for that component.
 
  NOTE: The pre-publish target aims to help a recipe developer to make sure
  that the recipe can produce a valid package without actually pushing its
  bits into his or her repository (allows to experiment, saves some time, and
  avoids polluting the repository with known-bad code during development cycles).
 
publish::
  This target is present in all Makefiles.  It can be used at the top level
  to act across all components, or on an individual component basis.  It is
  automatically defined by including $(WS_MAKE_RULES)/common.mk.  It depends
  on the previously described 'pre-publish' target and will actually publish
  packages for that component to the repository configured in $(WS_REPO).
 
clean::
  This target is present in all Makefiles.  It can be used at the top level
  to act across all components, or on an individual component basis.  It is
  automatically defined by including $(WS_MAKE_RULES)/common.mk.  It cleans
  up any files created by building the component with the exception of any
  downloaded files.
 
clobber::
 
  This target is present in all Makefiles.  It can be used at the top level
  to act across all components, or on an individual component basis.  It is
  automatically defined by including $(WS_MAKE_RULES)/common.mk.  It depends
  on the previously described 'clean' target and additionally cleans up any
  downloaded source archives.
 
REQUIRED_PACKAGES::
  This target is present in all component Makefiles.  It is automatically
  defined by including $(WS_MAKE_RULES)/common.mk.  It is a convenience that can
  be used to generate the set of REQUIRED_PACKAGES that is needed by the
  'pkgdepend resolve' portion of package generation and publication (publish
  target).  It automatically appends to the component Makefile, but the results
  should be manually verified.
 
env-check::
  This target serves as an alias for component-environment-check target. It exists
  only for user convenience.
 
env-prep::
  This target serves as an alias for component-environment-prep target. It exists
  only for user convenience.
 
test-env-check::
  This target serves as an alias for component-test-environment-check target.
  It exists only for user convenience.
 
test-env-prep::
  This target serves as an alias for component-test-environment-prep target. It
  exists only for user convenience.
 
print-VAR
  This target will print contents of variable VAR and also provide information
  about variable origin and variable flavor.
 
print-value-VAR
  This target will print contents of variable VAR.
 
format
  This target will apply different refactoring rules to update the Makefile
  to the current style: deprecation of macros, use of new target, autoindent...
  The rules are implemented in the userland-component utility.
 
update
  This target will format the Makefile then bump the COMPONENT_REVISION variable
  if no VERSION value is provided. If a VERSION value is provided it will set
  the COMPONENT_VERSION to the given value and remove COMPONENT_REVISION.
  For some supported build style it may peform additional actions like:
  - infering the latest version if VERSION=latest is passed,
  - updating the archive checksum.
 
update-latest
  This target is a convenience shortcut for 'update VERSION=latest'.