analogdevicesinc / msdk

Software Development Kit for Analog Device's MAX-series microcontrollers
Apache License 2.0
60 stars 75 forks source link

feat(Build): Add Ability to Selectively Introspect Build Variables #931

Closed Jake-Carter closed 4 months ago

Jake-Carter commented 4 months ago

Pull Request Template

Description

Add the make query target. This allows IDEs and scripts to query the value of a specific build variable for a project by also setting QUERY_VARIABLE.

Useful for https://github.com/Analog-Devices-MSDK/MSDKGen/commit/17017774f9e7945a07e09f93f5ef0485287bc2e0

Ex:

~/repos/msdk/Examples/MAX78000/Hello_World (feat/query*) » make query QUERY_VAR=TARGET
Loaded project.mk
TARGET=MAX78000

The output must still be parsed, since other Makefiles might print extra $(info) statements. This could be improved in a future PR that implements some sort of log-level mechanism for suppressing all $(info) output.