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>
.

- Dan

On Mon, Aug 7, 2023 at 2:23 PM Yongqin Liu <yongqin....@linaro.org> 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 android-building@googlegroups.com
> To unsubscribe from this group, send email to
> android-building+unsubscr...@googlegroups.com
> 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 android-building+unsubscr...@googlegroups.com.
> 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 android-building@googlegroups.com
To unsubscribe from this group, send email to
android-building+unsubscr...@googlegroups.com
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 android-building+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-building/CALQgHdn2xB7p1xgLGKUsFNyVF7GzafGs_hTAgJ_7fpSprs0VBg%40mail.gmail.com.

Reply via email to