First, it's a call to $(eval ...) which evaluates the string resulting from its content as Makefile code during parsing.
Within eval, a macro or function _add-target is called via $(call _add-target, ...).
function call:
User
product.row.certs what is this
Assistant
The phrase product.row.certs looks like a dotted notation referring to some piece of data or a variable in a programming or configuration context. Without additional context, there are several possibilities what it might be:
1. In Programming / Data Structures
If product is an object or dictionary:
python
product = {
"row": {
"certs": [...]
}
}
Then product.row.certs (in some languages or pseudo-code) accesses the certs field inside the row sub-object or dictionary inside the product object.
For example:
product could be a variable representing a product.
row is a property or nested object within product.
certs is a property containing certificates related to that row.
2. In a Database or Tabular Data Context
product might be a table or dataset.
row means a single record or row.
certs is a field or column inside that row containing certificates.
For example:
product.row.certs means: the certs field of a one specific row of product data.
3. In a Text or Template File
If in some configuration file or template language using dot notation (e.g., JSONPath, Jinja2, or similar template engines), product.row.certs is an expression used to refer to certificates inside a product’s row data.
4. In your previous Makefile context
If you encountered this as a variable or a placeholder like $(product.row.certs), it might be:
a composite variable referring to a list or collection of certificates related to a product’s row,
or it might be a serialized or structured piece of data being referenced.
Summary
product.row.certs means: "The certificates field/property attached to the row inside the product object or dataset."
It references data nested two levels deep:
product → row → certs.
If you provide the programming language, file, or context where you saw product.row.certs I can give a more precise explanation tailored to that environment.
User
LOCAL_MODULE := $(cert-type).certs
Assistant
The line
makefile
LOCAL_MODULE := $(cert-type).certs
is a simple Makefile variable assignment. Here's what it means:
LOCAL_MODULE is being set to the value of the variable cert-type with .certs appended.
Breakdown:
$(cert-type) expands to whatever value is assigned to the variable cert-type.
Then .certs is concatenated literally to that value.
The := operator means immediate/simple variable assignment in Makefiles:
The right side is expanded immediately (at the time of parsing).
So, if for example:
makefile
cert-type := firmware
then
makefile
LOCAL_MODULE := $(cert-type).certs
becomes
makefile
LOCAL_MODULE := firmware.certs
In practice:
LOCAL_MODULE might be used later as a module name or identifier.
In your certificate packaging/build system, LOCAL_MODULE is now named after the certificate type suffixed by .certs — e.g., firmware.certs, kernel.certs, etc.
Summary:
This assigns LOCAL_MODULE to a name based on the current certificate type with .certs appended.
If you want to share more context about what LOCAL_MODULE is used for, I can help explain its role further.
Thanks for sharing the _add-target definition! This is a GNU Make "define" macro/function that sets up a prebuilt module target in an Android-style build system (or a similar build environment using BUILD_PREBUILT).
define _add-target ... endef
Defines a multi-line macro named _add-target that takes three parameters ($(1), $(2), $(3)).
Within macro:
include $$(CLEAR_VARS)
Includes the file or snippet CLEAR_VARSbut note the double dollar signs $$:
With double $, when the macro is expanded and then passed to eval, this becomes a single$ in the final Makefile text, so $(CLEAR_VARS) is included during build file processing, clearing/initializing local variables for a new module definition.
LOCAL_MODULE := $(1)
Set the module name to the 1st argument passed to _add-target.
LOCAL_MODULE_STEM := $(notdir $(2))
Sets the stem name of the module to the filename part (no directory) of the 2nd argument, which is a file path.
LOCAL_MODULE_TAGS := optional
Tags this module as optional. This usually means the module is optionally included in builds.
LOCAL_MODULE_CLASS := ETC
Classify the module as ETC (usually meaning it is not executables/libraries but data/config/etc).
LOCAL_MODULE_PATH := $(3)
Set the destination path for the module to the 3rd argument.
LOCAL_SRC_FILES := $(2)
Set source files for this prebuilt module to the 2nd argument (the path to the certificate file here).
User
What is CRL
Assistant
CRL stands for Certificate Revocation List.
What is a CRL?
A Certificate Revocation List (CRL) is a list maintained by a Certificate Authority (CA) that contains digital certificates that have been revoked before their scheduled expiration date and are no longer trustworthy.
Why are CRLs needed?
Digital certificates are used to verify the identity of entities (like websites, users, or devices) in secure communications (e.g., TLS/SSL).
Sometimes, a certificate needs to be revoked because:
The private key was compromised.
The certificate owner no longer should be trusted (e.g., employee leaves a company).
Certificate was issued in error.
The certificate is replaced by a new one.
Revocation ensures that systems can check if a certificate is still valid and safe to trust.
How does a CRL work?
The CA publishes a list (the CRL) of all revoked certificates by serial number.
Clients (like browsers or other software) download this list periodically.
When a client encounters a certificate, it can check the CRL to see if the certificate's serial number is on the list.
If yes → certificate is revoked → do not trust.
If no → certificate is (likely) still valid.
Format
CRLs are typically digitally signed by the CA to prevent tampering.
They follow a standard format defined in X.509 specification.
CRLs can be distributed via URLs (HTTP, LDAP), or embedded in protocols.
Alternatives / complements
OCSP (Online Certificate Status Protocol):
Instead of downloading the whole CRL, clients query the CA in real time about a specific certificate’s status.
Some systems use CRL and/or OCSP.
Summary:
Term
Description
CRL
Certificate Revocation List
Purpose
Lists revoked certificates for trust checking
Maintained by
Certificate Authority (CA)
Used by
Clients verifying certificates
Format
Digitally signed list of serial numbers
Alternative(s)
OCSP, Online Certificate Status Protocol
If you're working with certificates or secure systems, understanding and using CRLs (or OCSP) is crucial to maintaining secure trusted connections!
User
There are many certificate chains for different function in the certificate tree, including secure boot, verified boot, SWDL, SAM.... If we want to replace the certificates, how to do it and where are the certificates located in the source code?
Assistant
You’re working with a system that uses multiple certificate chains for different functions—Secure Boot, Verified Boot, Software Download (SWDL), SAM (Secure Application Manager? or Secure Access Module?), etc. You want to replace the existing certificates and want to know how to do it and where to find them in the source code.
Typical Certificate Usage in Secure Boot & Related Features
Certificates are used to verify and authenticate components during different boot or secure operations.
Certificate chains form a “trust anchor” for things like Secure Boot and Verified Boot.
These certificates are normally prebuilt and included as part of your device’s firmware or software images.
You often have multiple cert chains — e.g., for OEM certificates, platform certificates, trusted keys, etc.
How to replace the certificates?
Step 1 — Identify certificate files to be replaced
Locate the actual certificate files (usually .pem, .der, .cer or sometimes .bin).
Certificates are often stored in the source tree as either raw .pem or pre-processed files.
Certificates might be packaged in blobs, binary blobs, or source directories dedicated to certificates.
Step 2 — Find where certificates are stored in the source
This depends a lot on your build system and project layout. Here are the typical places to check:
A. Directories in the source code that might contain certs
certs/, security/certs/, or keys/ directory at the root or under vendor/ or device/ folders.
Sometimes under platform/security/ or platform/vendor/security/.
For Android Open Source Project (AOSP) style trees:
device/<vendor>/<device>/certs/
vendor/<vendor>/certs/
It may be named after their purpose, e.g.,
secureboot_certs/
verifiedboot_certs/
oem_certs/ (as per your Makefile example)
Look for .pem, .der, , or similarly named files.
Not yet included in a published release.
_add-target
Arguments supplied:
target-$(cert-type)-oem_cert-$(notdir $(_cert))
Builds a target name string.
$(notdir $(_cert)) strips directory parts of the cert file path, yielding only the filename.
So combined, e.g., target-firmware-oem_cert-cert1.pem
$(_cert)
The full path/name of the current cert file.
$(melco_oem_cert_tree_target_directory)
Some directory path (likely a destination directory)
Without the definition of _add-target, we can only guess, but it probably defines a new target in the Makefile to copy or build based on the cert file.
Summary:
This Makefile snippet loops over each OEM certificate file defined for a given cert-type's list of certs, and for each certificate it:
Calls the function _add-target, passing:
A generated unique target name based on the cert-type and the certificate's basename.
The certificate file path.
A target directory.
The eval causes dynamically generated Makefile rules to be created during parsing.
For cert /path/cert1.pem, define target target-firmware-oem_cert-cert1.pem with file /path/cert1.pem and destination $(melco_oem_cert_tree_target_directory).
For cert /path/cert2.pem, define target target-firmware-oem_cert-cert2.pem analogously.
The _add-target likely sets up build rules or dependencies for copying/installing these cert files.
TL;DR
Iterate over all OEM cert files for the current cert-type.
For each cert file, dynamically create a Makefile target named like target-<cert-type>-oem_cert-<cert file name>.
Each target is associated with the cert file and a destination directory.
These targets are defined at parse time via eval and _add-target function calls.
If you want, I can help explain or guess the _add-target implementation as well.
include $$(BUILD_PREBUILT)
Includes the BUILD_PREBUILT file for build rules for prebuilt files, again carefully escaping with $$ so it will expand properly.
This uses _add-target to create multiple prebuilt modules, one per OEM certificate file defined by the variable $(cert-type)-oem_certs.
Summary
_add-target creates a prebuilt module in the build system.
It sets variables like LOCAL_MODULE, LOCAL_SRC_FILES, and uses the BUILD_PREBUILT build script.
It is used to "register" certificate files as installable modules.
The parameters are:
Module name
Source file path (certificate)
Target installation directory
If you want, I can help explain what each variable means in the Android build system or help with examples.
.crt
B. Build files referencing certificates
Look for Makefiles or build rules mentioning certificates, similar to what you posted:
Variables like firmware-oem_certs or $(cert-type)-oem_certs.
Targets created with _add-target or BUILD_PREBUILT that include certificates.
Paths mentioned in LOCAL_SRC_FILES or similar.
C. Binary blobs
Certificates might be baked inside binary blobs or packed images (signed images).
Then the source might have scripts or binary blobs, or .img files holding certificates.
Step 3 — Replace certificates with your new ones
Replace the old certificate files with your new certs (keeping the same filenames or update build rules).
If the build system references certificates with variable names, update those accordingly.
If you regenerate keys/certs, make sure the new certificates are valid and follow the expected format.
Step 4 — Rebuild and test
Run your build system to regenerate the images/binaries that include the new certificates.
Test the boot flow, verified boot, and any authentication mechanisms dependent on the cert chain.
Verify your new certs are being used (e.g., debug logs or by dumping images).
Additional notes:
If your system uses secure elements or hardware-protected keys, some certificates or keys might be provisioned or downloaded at runtime or loaded into hardware.
For software download (SWDL) or secure application management (SAM), certificates might also live in the bootloader or firmware blobs.
Be careful with certificate chains: order and hierarchy matter. The root CA cert must remain trusted and unchanged unless you re-issue a whole new chain.
Summary: How and where
Step
What to do
Where to look
Identify cert files
Find .pem/.der cert files for each function
certs/, device/<xxx>/certs/, vendor/<xxx>/certs/ or as Makefile variables
Locate build references
Find Makefiles or build scripts defining certs
Makefiles referencing *-oem_certs or BUILD_PREBUILT rules
Replace certificates
Swap out cert files with new ones
Overwrite files or update build variables
Rebuild & test
Rebuild the system and verify boot/security works
Build output, logs, device boot diagnostics
Example from your snippets:
You have variables like $(cert-type)-oem_certs and _add-target building prebuilt modules for cert files, so
Look for variables like firmware-oem_certs, verifiedboot-oem_certs, etc. in Makefiles, .mk or .bp files.
Locate those cert files in the filesystem.
Replace cert files at that path or point the variables to your new files.
Run make or your build command to rebuild with new certs.
If you want, I can help guide you through an example with your specific source tree structure. Just provide:
The build system name (Android, Yocto, etc.)
Source tree layout or some folder names
Samples of build files you have
In short: Replace the .pem (or other cert) files found under cert directories and/or update build variables referencing those certs, then rebuild your images.