Makefile
# This file is executed by the acceptance test suite (living documentation)
#
# Rules:
# - Step definitions live in: <test-source-root>/steps/ (or equivalent per language)
# - Keep scenarios focused: one behaviour per scenario.
# - Use exact terms from specs/glossary.md.
Feature: Properties of Makefile
As a software engineer
I want all Makefiles to provide a minimal set of targets
So that I can quickly build, run tests, determin coverage, etc.
Makefiles are also excecutable documentation as one can learn from them how to invoke certain tools etc.
Scenario: Properties of all Makefiles, regardles of language, artifact type, or CI type
Given a generated Makefile for:
| Languange | Artifact Type |
| cpp | tool |
| cpp | library |
| cpp | service |
| go | tool |
| go | library |
| go | service |
| java | library |
| java | service |
Then the Makefile contains at least these targets:
| Target | Purpose |
| init | Run once after cloning or after adding/removing dependencies |
| build | Debug build of the artifact, debug symbols, no optimizations |
| release-build | Release build of the artifact, no debug symbols, optimized for speed |
| test | Execute all unit/component tests on debug builds (JUnit XML report) |
| coverage | Determines test coverage (Cobertura format) |
| docs | Builds documentation locally for review |
| clean | Deletes all build artifacts |
| scan | Scans repository for secrets and vulnerabilities |
| lint | Static code checks |
Scenario: Properties of Makefiles specific to CLI tools and services (CI type does't care)
Given a generated Makefile for:
| Languange | Artifact Type |
| cpp | tool |
| cpp | service |
| go | tool |
| go | service |
| java | service |
Then the Makefile contains at least these targets:
| Target | Purpose |
| run | Runs the service or CLI tool locally for manual testing |
| image | Builds debuggable Docker image |
| release-image | Builds non-debuggable Docker image |
| scan-image | Scans target Docker images for secrets and vulnerabilities |
Scenario: Properties of Makefiles specific to C++ and Java libraries (CI type does't care)
Given a generated Makefile for:
| Languange | Artifact Type |
| cpp | library |
| java | library |
Then the Makefile contains at least these targets:
| Target | Purpose |
| package | Locally build Conan (C++) or Maven (Java) packages |