how the dist target is built?

1,249 views
Skip to first unread message

Yongqin Liu

unread,
Aug 7, 2023, 2:24:04 PM8/7/23
to Android Building
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 

Dan Willemsen

unread,
Aug 7, 2023, 3:36:56 PM8/7/23
to android-...@googlegroups.com
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 which chooses between calling soong_ui and make depending on 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 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 `DIST` to the makefile "packaging" step. That controls this conditional which adds a dependency and this conditional 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.

- Dan

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com
To unsubscribe from this group, send email to
android-buildi...@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-buildi...@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.

Yongqin Liu

unread,
Aug 10, 2023, 5:53:50 PM8/10/23
to Android Building
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 which chooses between calling soong_ui and make depending on 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 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 `DIST` to the makefile "packaging" step. That controls this conditional which adds a dependency and this conditional 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.

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?



Thanks,
Yongqin Liu 
Reply all
Reply to author
Forward
0 new messages