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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.interlynk.io/lynkctl/how-to-guides/gnu-make.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
