blob: 04e0161181057d791148bffacae2db8ce62a1d05 [file] [log] [blame] [view]
Dan Willemsen77338622017-11-08 16:39:18 -08001# Build System Changes for Android.mk Writers
2
Dan Willemsen26076252020-01-02 20:08:10 -08003## Rules executed within limited environment
4
5With `ALLOW_NINJA_ENV=false` (soon to be the default), ninja, and all the
6rules/actions executed within it will only have access to a limited number of
7environment variables. Ninja does not track when environment variables change
8in order to trigger rebuilds, so changing behavior based on arbitrary variables
9is not safe with incremental builds.
10
11Kati and Soong can safely use environment variables, so the expectation is that
12you'd embed any environment variables that you need to use within the command
13line generated by those tools. See the [export section](#export_keyword) below
14for examples.
15
16For a temporary workaround, you can set `ALLOW_NINJA_ENV=true` in your
17environment to restore the previous behavior, or set
18`BUILD_BROKEN_NINJA_USES_ENV_VAR := <var> <var2> ...` in your `BoardConfig.mk`
19to allow specific variables to be passed through until you've fixed the rules.
20
Dan Willemsen0cb422f2019-11-25 17:51:18 -080021## LOCAL_C_INCLUDES outside the source/output trees are an error {#BUILD_BROKEN_OUTSIDE_INCLUDE_DIRS}
22
23Include directories are expected to be within the source tree (or in the output
24directory, generated during the build). This has been checked in some form
25since Oreo, but now has better checks.
26
27There's now a `BUILD_BROKEN_OUTSIDE_INCLUDE_DIRS` variable, that when set, will
28turn these errors into warnings temporarily. I don't expect this to last more
29than a release, since they're fairly easy to clean up.
30
31Neither of these cases are supported by Soong, and will produce errors when
32converting your module.
33
34### Absolute paths
35
36This has been checked since Oreo. The common reason to hit this is because a
37makefile is calculating a path, and ran abspath/realpath/etc. This is a problem
38because it makes your build non-reproducible. It's very unlikely that your
39source path is the same on every machine.
40
41### Using `../` to leave the source/output directories
42
43This is the new check that has been added. In every case I've found, this has
44been a mistake in the Android.mk -- assuming that `LOCAL_C_INCLUDES` (which is
45relative to the top of the source tree) acts like `LOCAL_SRC_FILES` (which is
46relative to `LOCAL_PATH`).
47
48Since this usually isn't a valid path, you can almost always just remove the
49offending line.
50
51
Dan Willemsen26076252020-01-02 20:08:10 -080052## `BOARD_HAL_STATIC_LIBRARIES` and `LOCAL_HAL_STATIC_LIBRARIES` are obsolete {#BOARD_HAL_STATIC_LIBRARIES}
Yifan Hong88adfc62019-10-11 15:52:44 -070053
54Define proper HIDL / Stable AIDL HAL instead.
55
56* For libhealthd, use health HAL. See instructions for implementing
57 health HAL:
58
59 * [hardware/interfaces/health/2.1/README.md] for health 2.1 HAL (recommended)
60 * [hardware/interfaces/health/1.0/README.md] for health 1.0 HAL
61
62* For libdumpstate, use at least Dumpstate HAL 1.0.
63
Tao Bao84f88a42019-05-28 16:30:18 -070064## PRODUCT_STATIC_BOOT_CONTROL_HAL is obsolete {#PRODUCT_STATIC_BOOT_CONTROL_HAL}
65
66`PRODUCT_STATIC_BOOT_CONTROL_HAL` was the workaround to allow sideloading with
67statically linked boot control HAL, before shared library HALs were supported
68under recovery. Android Q has added such support (HALs will be loaded in
69passthrough mode), and the workarounds are being removed. Targets should build
70and install the recovery variant of boot control HAL modules into recovery
71image, similar to the ones installed for normal boot. See the change to
72crosshatch for example of this:
73
74* [device/google/crosshatch/bootctrl/Android.bp] for `bootctrl.sdm845` building
75 rules
76* [device/google/crosshatch/device.mk] for installing `bootctrl.sdm845.recovery`
77 and `android.hardware.boot@1.0-impl.recovery` into recovery image
78
79[device/google/crosshatch/bootctrl/Android.bp]: https://android.googlesource.com/device/google/crosshatch/+/master/bootctrl/Android.bp
80[device/google/crosshatch/device.mk]: https://android.googlesource.com/device/google/crosshatch/+/master/device.mk
81
Dan Willemsen695849e2019-04-17 12:25:09 -070082## Deprecation of `BUILD_*` module types
83
84See [build/make/Deprecation.md](Deprecation.md) for the current status.
85
Dan Willemsen3d05a082019-02-22 23:06:03 +000086## `PRODUCT_HOST_PACKAGES` split from `PRODUCT_PACKAGES` {#PRODUCT_HOST_PACKAGES}
87
88Previously, adding a module to `PRODUCT_PACKAGES` that supported both the host
89and the target (`host_supported` in Android.bp; two modules with the same name
90in Android.mk) would cause both to be built and installed. In many cases you
91only want either the host or target versions to be built/installed by default,
92and would be over-building with both. So `PRODUCT_PACKAGES` will be changing to
93just affect target modules, while `PRODUCT_HOST_PACKAGES` is being added for
94host modules.
95
96Functional differences between `PRODUCT_PACKAGES` and `PRODUCT_HOST_PACKAGES`:
97
98* `PRODUCT_HOST_PACKAGES` does not have `_ENG`/`_DEBUG` variants, as that's a
99 property of the target, not the host.
100* `PRODUCT_HOST_PACKAGES` does not support `LOCAL_MODULE_OVERRIDES`.
101* `PRODUCT_HOST_PACKAGES` requires listed modules to exist, and be host
102 modules. (Unless `ALLOW_MISSING_DEPENDENCIES` is set)
103
104This is still an active migration, so currently it still uses
105`PRODUCT_PACKAGES` to make installation decisions, but verifies that if we used
106`PRODUCT_HOST_PACKAGES`, it would trigger installation for all of the same host
107packages. This check ignores shared libraries, as those are not normally
108necessary in `PRODUCT_*PACKAGES`, and tended to be over-built (especially the
10932-bit variants).
110
111Future changes will switch installation decisions to `PRODUCT_HOST_PACKAGES`
112for host modules, error when there's a host-only module in `PRODUCT_PACKAGES`,
113and do some further cleanup where `LOCAL_REQUIRED_MODULES` are still merged
114between host and target modules with the same name.
115
Dan Willemsen46267cb2019-01-25 14:35:58 -0800116## `*.c.arm` / `*.cpp.arm` deprecation {#file_arm}
117
118In Android.mk files, you used to be able to change LOCAL_ARM_MODE for each
119source file by appending `.arm` to the end of the filename in
120`LOCAL_SRC_FILES`.
121
122Soong does not support this uncommonly used behavior, instead expecting those
123files to be split out into a separate static library that chooses `arm` over
124`thumb` for the entire library. This must now also be done in Android.mk files.
125
Dan Willemsenf2646902019-01-25 16:54:37 -0800126## Windows cross-compiles no longer supported in Android.mk
127
128Modules that build for Windows (our only `HOST_CROSS` OS currently) must now be
129defined in `Android.bp` files.
130
Dan Willemsene048f7e2019-02-09 18:58:36 -0800131## `LOCAL_MODULE_TAGS := eng debug` are obsolete {#LOCAL_MODULE_TAGS}
Dan Willemsen9569ddd2019-01-22 19:38:56 -0800132
Dan Willemsene048f7e2019-02-09 18:58:36 -0800133`LOCAL_MODULE_TAGS` value `eng` and `debug` are now obsolete. They allowed
Dan Willemsen9569ddd2019-01-22 19:38:56 -0800134modules to specify that they should always be installed on `-eng`, or `-eng`
135and `-userdebug` builds. This conflicted with the ability for products to
136specify which modules should be installed, effectively making it impossible to
137build a stripped down product configuration that did not include those modules.
138
139For the equivalent functionality, specify the modules in `PRODUCT_PACKAGES_ENG`
140or `PRODUCT_PACKAGES_DEBUG` in the appropriate product makefiles.
141
142Core android packages like `su` got added to the list in
143`build/make/target/product/base_system.mk`, but for device-specific modules
144there are often better base product makefiles to use instead.
145
Dan Willemsen06364282019-01-02 14:32:54 -0800146## `USER` deprecation {#USER}
147
148`USER` will soon be `nobody` in many cases due to the addition of a sandbox
149around the Android build. Most of the time you shouldn't need to know the
150identity of the user running the build, but if you do, it's available in the
151make variable `BUILD_USERNAME` for now.
152
153Similarly, the `hostname` tool will also be returning a more consistent value
154of `android-build`. The real value is available as `BUILD_HOSTNAME`.
155
Dan Willemsen6dbb33d2018-10-21 19:41:49 -0700156## `BUILD_NUMBER` removal from Android.mk {#BUILD_NUMBER}
157
158`BUILD_NUMBER` should not be used directly in Android.mk files, as it would
159trigger them to be re-read every time the `BUILD_NUMBER` changes (which it does
160on every build server build). If possible, just remove the use so that your
161builds are more reproducible. If you do need it, use `BUILD_NUMBER_FROM_FILE`:
162
163``` make
164$(LOCAL_BUILT_MODULE):
165 mytool --build_number $(BUILD_NUMBER_FROM_FILE) -o $@
166```
167
168That will expand out to a subshell that will read the current `BUILD_NUMBER`
169whenever it's run. It will not re-run your command if the build number has
170changed, so incremental builds will have the build number from the last time
171the particular output was rebuilt.
172
Dan Willemsen78c40be2018-10-17 16:50:49 -0700173## `DIST_DIR`, `dist_goal`, and `dist-for-goals` {#dist}
174
175`DIST_DIR` and `dist_goal` are no longer available when reading Android.mk
176files (or other build tasks). Always use `dist-for-goals` instead, which takes
177a PHONY goal, and a list of files to copy to `$DIST_DIR`. Whenever `dist` is
178specified, and the goal would be built (either explicitly on the command line,
179or as a dependency of something on the command line), that file will be copied
180into `$DIST_DIR`. For example,
181
182``` make
183$(call dist-for-goals,foo,bar/baz)
184```
185
186will copy `bar/baz` into `$DIST_DIR/baz` when `m foo dist` is run.
187
188#### Renames during copy
189
190Instead of specifying just a file, a destination name can be specified,
191including subdirectories:
192
193``` make
194$(call dist-for-goals,foo,bar/baz:logs/foo.log)
195```
196
197will copy `bar/baz` into `$DIST_DIR/logs/foo.log` when `m foo dist` is run.
198
Dan Willemsen5fb16a62018-09-04 16:23:14 -0700199## `.PHONY` rule enforcement {#phony_targets}
200
201There are several new warnings/errors meant to ensure the proper use of
202`.PHONY` targets in order to improve the speed and reliability of incremental
203builds.
204
205`.PHONY`-marked targets are often used as shortcuts to provide "friendly" names
206for real files to be built, but any target marked with `.PHONY` is also always
207considered dirty, needing to be rebuilt every build. This isn't a problem for
208aliases or one-off user-requested operations, but if real builds steps depend
209on a `.PHONY` target, it can get quite expensive for what should be a tiny
210build.
211
212``` make
213...mk:42: warning: PHONY target "out/.../foo" looks like a real file (contains a "/")
214```
215
216Between this warning and the next, we're requiring that `.PHONY` targets do not
217have "/" in them, and real file targets do have a "/". This makes it more
218obvious when reading makefiles what is happening, and will help the build
219system differentiate these in the future too.
220
221``` make
222...mk:42: warning: writing to readonly directory: "kernel-modules"
223```
224
225This warning will show up for one of two reasons:
226
2271. The target isn't intended to be a real file, and should be marked with
228 `.PHONY`. This would be the case for this example.
2292. The target is a real file, but it's outside the output directories. All
230 outputs from the build system should be within the output directory,
231 otherwise `m clean` is unable to clean the build, and future builds may not
232 work properly.
233
234``` make
235...mk:42: warning: real file "out/.../foo" depends on PHONY target "buildbins"
236```
237
238If the first target isn't intended to be a real file, then it should be marked
239with `.PHONY`, which will satisfy this warning. This isn't the case for this
240example, as we require `.PHONY` targets not to have '/' in them.
241
242If the second (PHONY) target is a real file, it may unnecessarily be marked
243with `.PHONY`.
244
245### `.PHONY` and calling other build systems
246
247One common pattern (mostly outside AOSP) that we've seen hit these warning is
248when building with external build systems (firmware, bootloader, kernel, etc).
249Those are often marked as `.PHONY` because the Android build system doesn't
250have enough dependencies to know when to run the other build system again
251during an incremental build.
252
253We recommend to build these outside of Android, and deliver prebuilts into the
254Android tree instead of decreasing the speed and reliability of the incremental
255Android build.
256
257In cases where that's not desired, to preserve the speed of Android
258incrementals, over-specifying dependencies is likely a better option than
259marking it with `.PHONY`:
260
261``` make
262out/target/.../zImage: $(sort $(shell find -L $(KERNEL_SRCDIR)))
263 ...
264```
265
266For reliability, many of these other build systems do not guarantee the same
267level of incremental build assurances as the Android Build is attempting to do
268-- without custom checks, Make doesn't rebuild objects when CFLAGS change, etc.
269In order to fix this, our recommendation is to do clean builds for each of
270these external build systems every time anything they rely on changes. For
271relatively smaller builds (like the kernel), this may be reasonable as long as
272you're not trying to actively debug the kernel.
273
274## `export` and `unexport` deprecation {#export_keyword}
Dan Willemsen8b9c3cc2018-02-27 02:15:32 -0800275
Dan Willemsen3a1072a2019-05-14 22:03:58 -0700276The `export` and `unexport` keywords are obsolete, and will throw errors when
277used.
Dan Willemsen8b9c3cc2018-02-27 02:15:32 -0800278
Dan Willemsen8b9c3cc2018-02-27 02:15:32 -0800279Device specific configuration should not be able to affect common core build
280steps -- we're looking at triggering build steps to be invalidated if the set
281of environment variables they can access changes. If device specific
282configuration is allowed to change those, switching devices with the same
283output directory could become significantly more expensive than it already can
284be.
285
Dan Willemsen3a1072a2019-05-14 22:03:58 -0700286If used during Android.mk files, and later tasks, it is increasingly likely
287that they are being used incorrectly. Attempting to change the environment for
288a single build step, and instead setting it for hundreds of thousands.
Dan Willemsen8b9c3cc2018-02-27 02:15:32 -0800289
290It is not recommended to just move the environment variable setting outside of
291the build (in vendorsetup.sh, or some other configuration script or wrapper).
292We expect to limit the environment variables that the build respects in the
293future, others will be cleared. (There will be methods to get custom variables
294into the build, just not to every build step)
295
296Instead, write the export commands into the rule command lines themselves:
297
298``` make
299$(intermediates)/generated_output.img:
300 rm -rf $@
301 export MY_ENV_A="$(MY_A)"; make ...
302```
303
304If you want to set many environment variables, and/or use them many times,
305write them out to a script and source the script:
306
307``` make
308envsh := $(intermediates)/env.sh
309$(envsh):
310 rm -rf $@
311 echo 'export MY_ENV_A="$(MY_A)"' >$@
312 echo 'export MY_ENV_B="$(MY_B)"' >>$@
313
314$(intermediates)/generated_output.img: PRIVATE_ENV := $(envsh)
315$(intermediates)/generated_output.img: $(envsh) a/b/c/package.sh
316 rm -rf $@
317 source $(PRIVATE_ENV); make ...
318 source $(PRIVATE_ENV); a/b/c/package.sh ...
319```
320
Dan Willemsen5f76fc02018-06-21 21:42:29 -0700321## Implicit make rules are obsolete {#implicit_rules}
Dan Willemsen62db0f02018-06-16 09:37:13 -0700322
323Implicit rules look something like the following:
324
325``` make
326$(TARGET_OUT_SHARED_LIBRARIES)/%_vendor.so: $(TARGET_OUT_SHARED_LIBRARIES)/%.so
327 ...
328
329%.o : %.foo
330 ...
331```
332
Dan Willemsen5f76fc02018-06-21 21:42:29 -0700333These can have wide ranging effects across unrelated modules, so they're now obsolete. Instead, use static pattern rules, which are similar, but explicitly match the specified outputs:
Dan Willemsen62db0f02018-06-16 09:37:13 -0700334
335``` make
336libs := $(foreach lib,libfoo libbar,$(TARGET_OUT_SHARED_LIBRARIES)/$(lib)_vendor.so)
337$(libs): %_vendor.so: %.so
338 ...
339
340files := $(wildcard $(LOCAL_PATH)/*.foo)
341gen := $(patsubst $(LOCAL_PATH)/%.foo,$(intermediates)/%.o,$(files))
342$(gen): %.o : %.foo
343 ...
344```
345
Dan Willemsenac926592018-06-11 22:28:00 -0700346## Removing '/' from Valid Module Names {#name_slash}
347
348The build system uses module names in path names in many places. Having an
349extra '/' or '../' being inserted can cause problems -- and not just build
350breaks, but stranger invalid behavior.
351
352In every case we've seen, the fix is relatively simple: move the directory into
353`LOCAL_MODULE_RELATIVE_PATH` (or `LOCAL_MODULE_PATH` if you're still using it).
354If this causes multiple modules to be named the same, use unique module names
355and `LOCAL_MODULE_STEM` to change the installed file name:
356
357``` make
358include $(CLEAR_VARS)
359LOCAL_MODULE := ver1/code.bin
360LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/firmware
361...
362include $(BUILD_PREBUILT)
363
364include $(CLEAR_VARS)
365LOCAL_MODULE := ver2/code.bin
366LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/firmware
367...
368include $(BUILD_PREBUILT)
369```
370
371Can be rewritten as:
372
373```
374include $(CLEAR_VARS)
375LOCAL_MODULE := ver1_code.bin
376LOCAL_MODULE_STEM := code.bin
377LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/firmware/ver1
378...
379include $(BUILD_PREBUILT)
380
381include $(CLEAR_VARS)
382LOCAL_MODULE := ver2_code.bin
383LOCAL_MODULE_STEM := code.bin
384LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/firmware/ver2
385...
386include $(BUILD_PREBUILT)
387```
388
389You just need to make sure that any other references (`PRODUCT_PACKAGES`,
390`LOCAL_REQUIRED_MODULES`, etc) are converted to the new names.
391
Dan Willemsenbbe6a022018-06-10 14:49:01 -0700392## Valid Module Names {#name}
393
394We've adopted lexical requirements very similar to [Bazel's
395requirements](https://docs.bazel.build/versions/master/build-ref.html#name) for
396target names. Valid characters are `a-z`, `A-Z`, `0-9`, and the special
Dan Willemsenac926592018-06-11 22:28:00 -0700397characters `_.+-=,@~`. This currently applies to `LOCAL_PACKAGE_NAME`,
Dan Willemsenbbe6a022018-06-10 14:49:01 -0700398`LOCAL_MODULE`, and `LOCAL_MODULE_SUFFIX`, and `LOCAL_MODULE_STEM*`.
399
400Many other characters already caused problems if you used them, so we don't
401expect this to have a large effect.
402
Dan Willemsen5039ef42018-05-18 11:00:17 -0700403## PATH Tools {#PATH_Tools}
404
405The build has started restricting the external host tools usable inside the
406build. This will help ensure that build results are reproducible across
407different machines, and catch mistakes before they become larger issues.
408
409To start with, this includes replacing the $PATH with our own directory of
410tools, mirroring that of the host PATH. The only difference so far is the
411removal of the host GCC tools. Anything that is not explicitly in the
412configuration as allowed will continue functioning, but will generate a log
413message. This is expected to become more restrictive over time.
414
415The configuration is located in build/soong/ui/build/paths/config.go, and
416contains all the common tools in use in many builds. Anything not in that list
417will currently print a warning in the `$OUT_DIR/soong.log` file, including the
418command and arguments used, and the process tree in order to help locate the
419usage.
420
421In order to fix any issues brought up by these checks, the best way to fix them
422is to use tools checked into the tree -- either as prebuilts, or building them
423as host tools during the build.
424
425As a temporary measure, you can set `TEMPORARY_DISABLE_PATH_RESTRICTIONS=true`
426in your environment to temporarily turn off the error checks and allow any tool
427to be used (with logging). Beware that GCC didn't work well with the interposer
428used for logging, so this may not help in all cases.
429
Dan Willemsen79fd6962017-11-28 22:32:05 -0800430## Deprecating / obsoleting envsetup.sh variables in Makefiles
Dan Willemsen77338622017-11-08 16:39:18 -0800431
432It is not required to source envsetup.sh before running a build. Many scripts,
433including a majority of our automated build systems, do not do so. Make will
434transparently make every environment variable available as a make variable.
435This means that relying on environment variables only set up in envsetup.sh will
436produce different output for local users and scripted users.
437
438Many of these variables also include absolute path names, which we'd like to
439keep out of the generated files, so that you don't need to do a full rebuild if
440you move the source tree.
441
442To fix this, we're marking the variables that are set in envsetup.sh as
443deprecated in the makefiles. This will trigger a warning every time one is read
Dan Willemsen79fd6962017-11-28 22:32:05 -0800444(or written) inside Kati. Once all the warnings have been removed for a
445particular variable, we'll switch it to obsolete, and any references will become
446errors.
Dan Willemsen77338622017-11-08 16:39:18 -0800447
448### envsetup.sh variables with make equivalents
449
450| instead of | use |
451|--------------------------------------------------------------|----------------------|
Yasuhiro Kubotacd301f62018-10-09 15:51:23 +0900452| OUT {#OUT} | PRODUCT_OUT |
Dan Willemsen77338622017-11-08 16:39:18 -0800453| ANDROID_HOST_OUT {#ANDROID_HOST_OUT} | HOST_OUT |
454| ANDROID_PRODUCT_OUT {#ANDROID_PRODUCT_OUT} | PRODUCT_OUT |
455| ANDROID_HOST_OUT_TESTCASES {#ANDROID_HOST_OUT_TESTCASES} | HOST_OUT_TESTCASES |
456| ANDROID_TARGET_OUT_TESTCASES {#ANDROID_TARGET_OUT_TESTCASES} | TARGET_OUT_TESTCASES |
457
458All of the make variables may be relative paths from the current directory, or
459absolute paths if the output directory was specified as an absolute path. If you
460need an absolute variable, convert it to absolute during a rule, so that it's
461not expanded into the generated ninja file:
462
463``` make
464$(PRODUCT_OUT)/gen.img: my/src/path/gen.sh
465 export PRODUCT_OUT=$$(cd $(PRODUCT_OUT); pwd); cd my/src/path; ./gen.sh -o $${PRODUCT_OUT}/gen.img
466```
467
468### ANDROID_BUILD_TOP {#ANDROID_BUILD_TOP}
469
470In Android.mk files, you can always assume that the current directory is the
471root of the source tree, so this can just be replaced with '.' (which is what
472$TOP is hardcoded to), or removed entirely. If you need an absolute path, see
473the instructions above.
474
475### Stop using PATH directly {#PATH}
476
477This isn't only set by envsetup.sh, but it is modified by it. Due to that it's
478rather easy for this to change between different shells, and it's not ideal to
479reread the makefiles every time this changes.
480
481In most cases, you shouldn't need to touch PATH at all. When you need to have a
482rule reference a particular binary that's part of the source tree or outputs,
483it's preferrable to just use the path to the file itself (since you should
484already be adding that as a dependency).
485
486Depending on the rule, passing the file path itself may not be feasible due to
487layers of unchangable scripts/binaries. In that case, be sure to add the
488dependency, but modify the PATH within the rule itself:
489
490``` make
491$(TARGET): myscript my/path/binary
492 PATH=my/path:$$PATH myscript -o $@
493```
494
495### Stop using PYTHONPATH directly {#PYTHONPATH}
496
497Like PATH, this isn't only set by envsetup.sh, but it is modified by it. Due to
498that it's rather easy for this to change between different shells, and it's not
499ideal to reread the makefiles every time.
500
501The best solution here is to start switching to Soong's python building support,
502which packages the python interpreter, libraries, and script all into one file
503that no longer needs PYTHONPATH. See fontchain_lint for examples of this:
504
505* [external/fonttools/Lib/fontTools/Android.bp] for python_library_host
506* [frameworks/base/Android.bp] for python_binary_host
507* [frameworks/base/data/fonts/Android.mk] to execute the python binary
508
509If you still need to use PYTHONPATH, do so within the rule itself, just like
510path:
511
512``` make
513$(TARGET): myscript.py $(sort $(shell find my/python/lib -name '*.py'))
514 PYTHONPATH=my/python/lib:$$PYTHONPATH myscript.py -o $@
515```
Yifan Hong97de88c2017-12-12 18:01:09 -0800516### Stop using PRODUCT_COMPATIBILITY_MATRIX_LEVEL_OVERRIDE directly {#PRODUCT_COMPATIBILITY_MATRIX_LEVEL_OVERRIDE}
517
518Specify Framework Compatibility Matrix Version in device manifest by adding a `target-level`
519attribute to the root element `<manifest>`. If `PRODUCT_COMPATIBILITY_MATRIX_LEVEL_OVERRIDE`
520is 26 or 27, you can add `"target-level"="1"` to your device manifest instead.
Dan Willemsen77338622017-11-08 16:39:18 -0800521
Stephen Hines178cf8e2018-01-11 11:54:48 -0800522### Stop using USE_CLANG_PLATFORM_BUILD {#USE_CLANG_PLATFORM_BUILD}
523
524Clang is the default and only supported Android compiler, so there is no reason
525for this option to exist.
526
Dan Willemsen77338622017-11-08 16:39:18 -0800527### Other envsetup.sh variables {#other_envsetup_variables}
528
529* ANDROID_TOOLCHAIN
530* ANDROID_TOOLCHAIN_2ND_ARCH
531* ANDROID_DEV_SCRIPTS
532* ANDROID_EMULATOR_PREBUILTS
533* ANDROID_PRE_BUILD_PATHS
534
535These are all exported from envsetup.sh, but don't have clear equivalents within
536the makefile system. If you need one of them, you'll have to set up your own
537version.
538
539
540[build/soong/Changes.md]: https://android.googlesource.com/platform/build/soong/+/master/Changes.md
541[external/fonttools/Lib/fontTools/Android.bp]: https://android.googlesource.com/platform/external/fonttools/+/master/Lib/fontTools/Android.bp
542[frameworks/base/Android.bp]: https://android.googlesource.com/platform/frameworks/base/+/master/Android.bp
543[frameworks/base/data/fonts/Android.mk]: https://android.googlesource.com/platform/frameworks/base/+/master/data/fonts/Android.mk
Yifan Hong88adfc62019-10-11 15:52:44 -0700544[hardware/interfaces/health/1.0/README.md]: https://android.googlesource.com/platform/hardware/interfaces/+/master/health/1.0/README.md
545[hardware/interfaces/health/2.1/README.md]: https://android.googlesource.com/platform/hardware/interfaces/+/master/health/2.1/README.md