Hi, Dan

在2023年8月8日星期二 UTC+8 03:36:56<Dan Willemsen> 写道:

I've described the `dist` command line argument as a modifier, as it's not 
really a target itself. In general, it's changing the behavior of other 
targets so that they also perform copies into $DIST_DIR.

1. there seem no Makefile in the AOSP root now, how does the make command 
find the make files?


We haven't actually been using the `make` tool for many years. `m` is the 
suggested entry point to the build (which is implemented by soong_ui), but 
`make` still works in some places due to this shell function 
<https://cs.android.com/android/platform/superproject/main/+/main:build/make/envsetup.sh;drc=11f188c09ae2cd0446296f8bcf996f2e63f3a0e0;l=1903>
 which 
chooses between calling soong_ui and make depending on 
<https://cs.android.com/android/platform/superproject/main/+/main:build/make/envsetup.sh;drc=11f188c09ae2cd0446296f8bcf996f2e63f3a0e0;l=1807>
 
where and how you call it.

2. there seems no dist target defined in the build/make repository 
explicitly, how should I understand it?


This is parsed out 
<https://cs.android.com/android/platform/superproject/main/+/main:build/soong/ui/build/config.go;drc=6d1e348cc37df5f52b06ebcd9b722c03f7021096;l=949>
 
in soong_ui, and used directly in a few different places in soong_ui. But 
the general `dist` setup in Android.bp files (and `$(call dist-for-goals` 
in makefiles) is enabled via soong_ui passing in 
<https://cs.android.com/android/platform/superproject/main/+/main:build/soong/ui/build/kati.go;drc=f2af38d2cceb85f93180e666ca88b796410f69db;l=390>
 
`DIST` to the makefile "packaging" step. That controls this conditional 
<https://cs.android.com/android/platform/superproject/main/+/main:build/make/packaging/distdir.mk;drc=fd5f1e75964d0d5631f33597daf1e6b50dccb2e4;l=28>
 
which adds a dependency and this conditional 
<https://cs.android.com/android/platform/superproject/main/+/main:build/make/packaging/distdir.mk;drc=fd5f1e75964d0d5631f33597daf1e6b50dccb2e4;l=40>
 which 
implements the actual copy rules. The dependencies to these `_dist_*` 
targets are always set up in the main portion of the build, based on all 
the goals(/targets) passed into dist-for-goals, here 
<https://cs.android.com/android/platform/superproject/main/+/main:build/make/core/distdir.mk;drc=45c0c2c9ac5402b629c17fb0e3495b4ce994158a;l=211>
.

Thanks very much for the detailed explanation!

I am asking because I have one building time problem when run the make dist 
command for the hikey960 build[1],
the error message is like this:
    *01:46:58* cp: bad 'out/target/product/hikey960/dt.img': No such file 
or directory
I try to understand how the "make dist" works and resolve the problem.

the generation of the dt.img is defined here[2],  I tried to add 
    $(call dist-for-goals, droidcore, $(PRODUCT_OUT)/dt.img)
there, but it does not help.
Finally I found deleting the lines of INSTALLED_RADIOIMAGE_TARGET
and BOARD_PACK_RADIOIMAGES helps, like the change submitted here[3]

Not sure if you have any idea about the reason?


[1]: https://ci.linaro.org/job/96boards-hikey960-aosp-master/2294/console
[2]: 
https://android.googlesource.com/device/linaro/hikey/+/refs/heads/main/build/tasks/dtimage.mk
[3]: https://android-review.googlesource.com/c/device/linaro/hikey/+/2702633

Thanks,
Yongqin Liu 

On Mon, Aug 7, 2023 at 2:23 PM Yongqin Liu <[email protected]> wrote:

Hi, All

This may be a silly question, but I could not find how the dist target is 
executed,
could anyone here help give some explanations on it?

1. there seem no Makefile in the AOSP root now, how does the make command 
find the make files?
2. there seems no dist target defined in the build/make repository 
explicitly, how should I understand it?

Thanks,
Yongqin Liu  

-- 
-- 
You received this message because you are subscribed to the "Android 
Building" mailing list.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an 
email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-building/48997402-f201-4929-b040-8459b003f520n%40googlegroups.com
 
<https://groups.google.com/d/msgid/android-building/48997402-f201-4929-b040-8459b003f520n%40googlegroups.com?utm_medium=email&utm_source=footer>
.

-- 
-- 
You received this message because you are subscribed to the "Android Building" 
mailing list.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-building/ef54031e-5355-4d0f-a90f-b50a85008721n%40googlegroups.com.

Reply via email to