> For the complete documentation index, see [llms.txt](https://docs.interlynk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.interlynk.io/lynkctl/how-to-guides/gnu-make.md).

# GNU Make Projects

This guide covers generating an SBOM for a C/C++ project built with GNU Make.

## Prerequisites

* lynkctl installed — see [Installation](/lynkctl/installation.md)
* GNU Make 3.81 or newer, on `PATH`

lynkctl runs `make` in dry-run and introspection modes only. It never compiles the project.

***

## Generate an SBOM

From the project root:

```bash
lynkctl generate . -o sbom.cdx.json
```

lynkctl auto-detects a `Makefile` or `GNUmakefile`. To be explicit, pass `--provider gnu-make`.

## Choose a Build Target

By default lynkctl analyses the `all` target. Use `--make-target` (`-t`) to analyse a different one:

```bash
lynkctl generate . --make-target firmware -o sbom.cdx.json
```

## Pass Build Variables

Some Makefiles change what gets compiled based on variables. Supply them with `--make-config-vars`, which is repeatable:

```bash
lynkctl generate . \
  --make-config-vars BUILD=release \
  --make-config-vars ARCH=arm64 \
  -o sbom.cdx.json
```

## Troubleshooting

If a run reports warnings or errors, rerun with `-v` to see the individual diagnostics and their suggested actions. See [Diagnostics & Exit Codes](/lynkctl/diagnostics.md) for severity levels, exit codes, and strict mode. For help interpreting a specific diagnostic, contact Interlynk.
