Ravenports generated: 10 Sep 2023 14:51
[ravenports.git] / Mk / raven.sequence.mk
1 # Autogenerated -- Do not edit!
2 # This is the final logic which controls the build sequence.
3 # This is very similar to FreeBSD Ports Collection sequence logic.
4
5 # The order of _TARGET_STAGES is signficant.
6 # Consider returning SANITY stage if required
7
8 _TARGETS_STAGES=        FETCH EXTRACT PATCH CONFIGURE BUILD STAGE TEST
9
10 # --------------------------------------------------------------------------
11 # --  Sequence definition
12 # --------------------------------------------------------------------------
13
14 # Define the SEQ of actions to take when each target is run, and which targets
15 # they depend on before executing its SEQ.
16 #
17 # The main target has a priority of 500, pre-target priority is 300,
18 # post-target priority is 700, and target-depends has a priority of 150.
19 # The remaining targets are slotted according to sequence requirements.
20
21 _FETCH_DEP=             # none currently
22 _FETCH_SEQ=             100:fetch-message \
23                         300:pre-fetch \
24                         350:pre-fetch-option \
25                         400:pre-fetch-opsys \
26                         450:pre-fetch-script \
27                         500:do-fetch \
28                         525:do-fetch-option \
29                         550:do-fetch-opsys \
30                         700:post-fetch \
31                         750:post-fetch-option \
32                         800:post-fetch-opsys \
33                         850:post-fetch-script \
34                         ${_USES_fetch}
35
36 _EXTRACT_DEP=           fetch
37 _EXTRACT_SEQ=           100:extract-message \
38                         101:disable-network \
39                         150:checksum \
40                         200:clean-wrkdir \
41                         250:create-extract-dirs \
42                         300:pre-extract \
43                         350:pre-extract-option \
44                         400:pre-extract-opsys \
45                         450:pre-extract-script \
46                         500:do-extract \
47                         525:do-extract-option \
48                         550:do-extract-opsys \
49                         575:shift-wrksrc \
50                         576:github-relocation \
51                         577:crate-relocation \
52                         600:apply-slist \
53                         625:extract-licenses \
54                         650:compile-package-desc \
55                         700:post-extract \
56                         750:post-extract-option \
57                         800:post-extract-opsys \
58                         850:post-extract-script \
59                         999:extract-fixup-modes \
60                         ${_SITES_extract} \
61                         ${_USES_extract}
62
63 _PATCH_DEP=             extract
64 _PATCH_SEQ=             100:patch-message \
65                         300:pre-patch \
66                         350:pre-patch-option \
67                         400:pre-patch-opsys \
68                         450:pre-patch-script \
69                         500:do-patch \
70                         525:do-patch-option \
71                         550:do-patch-opsys \
72                         700:post-patch \
73                         750:post-patch-option \
74                         800:post-patch-opsys \
75                         850:post-patch-script \
76                         ${_USES_patch}
77
78 _CONFIGURE_DEP=         patch
79 _CONFIGURE_SEQ=         200:configure-message \
80                         300:pre-configure \
81                         350:pre-configure-option \
82                         400:pre-configure-opsys \
83                         450:pre-configure-script \
84                         500:do-configure \
85                         525:do-configure-option \
86                         550:do-configure-opsys \
87                         700:post-configure \
88                         750:post-configure-option \
89                         800:post-configure-opsys \
90                         850:post-configure-script \
91                         ${_USES_configure}
92
93 _BUILD_DEP=             configure
94 _BUILD_SEQ=             100:build-message \
95                         300:pre-build \
96                         350:pre-build-option \
97                         400:pre-build-opsys \
98                         450:pre-build-script \
99                         500:do-build \
100                         525:do-build-option \
101                         550:do-build-opsys \
102                         700:post-build \
103                         750:post-build-option \
104                         800:post-build-opsys \
105                         850:post-build-script \
106                         ${_USES_build}
107
108 # STAGE is special in its numbering as it has install and stage,
109 # so install is the main, and stage goes after.
110
111 # Some ports use the compiler and binutils in stage, which means
112 # they are still building when they should be installing.  To force
113 # correctness, provide an alternative sequence where pre-install
114 # and do-install are done during the build stage.
115
116 .if defined(INSTALL_REQ_TOOLCHAIN)
117 _BUILD_SEQ+=            852:stage-dir \
118                         854:pre-install \
119                         856:pre-install-option \
120                         858:pre-install-opsys \
121                         860:generate-plist \
122                         862:create-users-groups \
123                         864:do-install \
124                         866:do-install-option \
125                         868:do-install-opsys
126 .endif
127
128 _STAGE_DEP=             build
129 _STAGE_SEQ=             100:stage-message
130 .if !defined(INSTALL_REQ_TOOLCHAIN)
131 _STAGE_SEQ+=            200:stage-dir \
132                         300:pre-install \
133                         325:pre-install-option \
134                         350:pre-install-opsys \
135                         400:generate-plist \
136                         450:create-users-groups \
137                         500:do-install \
138                         525:do-install-option \
139                         550:do-install-opsys
140 .endif
141 _STAGE_SEQ+=            700:post-install \
142                         725:post-install-option \
143                         750:post-install-opsys \
144                         775:post-install-script \
145                         800:post-stage \
146                         820:post-stage-option \
147                         840:post-stage-opsys \
148                         850:compress-man \
149                         860:install-rc-script \
150                         870:install-smf-manifest \
151                         880:install-license \
152                         890:install-desktop-entries \
153                         900:add-plist-info \
154                         910:add-plist-docs \
155                         920:add-plist-examples \
156                         925:add-plist-nls \
157                         930:add-plist-licenses \
158                         940:add-plist-post \
159                         ${POST_PLIST_TARGET:C/^/990:/} \
160                         995:stage-qa \
161                         ${_USES_install} \
162                         ${_USES_stage}
163
164 _TEST_DEP=              stage
165 _TEST_SEQ=              100:test-message \
166                         300:pre-test \
167                         325:pre-test-option \
168                         350:pre-test-opsys \
169                         500:do-test \
170                         525:do-test-option \
171                         550:do-test-opsys \
172                         700:post-test \
173                         750:post-test-option \
174                         800:post-test-opsys \
175                         ${_USES_test}
176
177 # --------------------------------------------------------------------------
178 # --  Target ordering
179 # --------------------------------------------------------------------------
180
181 # Enforce order for -jN builds
182 .for _t in ${_TARGETS_STAGES}
183 .  for s in ${_${_t}_SEQ:O:C/^[0-9]+://}
184 .    if target(${s})
185 _PHONY_TARGETS+=        ${s}
186 _${_t}_REAL_SEQ+=       ${s}
187 .    endif
188 .  endfor
189 .ORDER: ${_${_t}_DEP} ${_${_t}_REAL_SEQ}
190 .endfor
191
192 # --------------------------------------------------------------------------
193 # --  pre-* and post-script targets
194 # --------------------------------------------------------------------------
195
196 .for subphase in pre post
197 .  for name in fetch extract patch configure build install
198 .    if exists(${SCRIPTDIR}/${subphase}-${name})
199 .      if !target(${subphase}-${name}-script)
200 ${subphase}-${name}-script:
201         @cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} \
202                 ${SH} ${SCRIPTDIR}/${subphase}-${name}
203 .      endif
204 .    endif
205 .  endfor
206 .endfor
207
208 # --------------------------------------------------------------------------
209 # --  Phase target definition
210 # --------------------------------------------------------------------------
211
212 # Define all of the main targets which depend on a sequence of other targets.
213 # See above *_SEQ and *_DEP. The _DEP will run before this defined target is
214 # ran. The _SEQ will run as this target once _DEP is satisfied.
215
216 # Names of cookies used to skip already completed stages
217
218 EXTRACT_COOKIE=         ${WRKDIR}/.done_extract
219 PATCH_COOKIE=           ${WRKDIR}/.done_patch
220 CONFIGURE_COOKIE=       ${WRKDIR}/.done_configure
221 BUILD_COOKIE=           ${WRKDIR}/.done_build
222 STAGE_COOKIE=           ${WRKDIR}/.done_stage
223
224 # Disable build
225 .if defined(NO_BUILD)
226 build: configure
227         @${TOUCH} ${TOUCH_FLAGS} ${BUILD_COOKIE}
228 .endif
229
230 # Disable test
231 .if defined(NO_TEST)
232 test: stage
233         @${DO_NADA}
234 .endif
235
236 .for target in extract patch configure build stage
237
238 .  if !target(${target})
239 _PHONY_TARGETS+= ${target}
240 ${target}: ${${target:tu}_COOKIE}
241 .  endif
242
243 .  if exists(${${target:tu}_COOKIE})
244 ${${target:tu}_COOKIE}::
245         @if [ -e ${.TARGET} ]; then \
246                 ${DO_NADA}; \
247         else \
248                 cd ${.CURDIR} && ${MAKE} ${.TARGET}; \
249         fi
250 .  else
251 ${${target:tu}_COOKIE}: ${_${target:tu}_DEP} ${_${target:tu}_REAL_SEQ}
252         @${TOUCH} -f ${.TARGET}
253 .  endif
254
255 .endfor # foreach(targets)
256
257 .for target in fetch test
258 .  if !target(${target})
259 _PHONY_TARGETS+= ${target}
260 ${target}: ${_${target:tu}_DEP} ${_${target:tu}_REAL_SEQ}
261 .  endif
262 .endfor
263
264 .PHONY: ${_PHONY_TARGETS}
265
266 # --------------------------------------------------------------------------
267 # --  Special Targets
268 # --------------------------------------------------------------------------
269
270 .if !target(restage)
271 restage:
272         @${RM} -r ${STAGEDIR} ${STAGE_COOKIE} ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
273         @cd ${.CURDIR} && ${MAKE} stage
274 .endif