This directory contains comprehensive examples for using the Makefile build system with various project types and configurations.
| Example | Description | Use Case |
|---|---|---|
| 🔧 Basic Makefile | Simple Makefile-based project | Standard C/C++ projects with basic Makefile |
| ⚙️ Autotools Project | GNU autotools-based build | Projects using autoconf/automake |
| 📦 CMake Makefile | CMake with Makefile generator | CMake projects generating Makefiles |
| 🐧 Kernel Module | Linux kernel module build | Kernel module development |
| 🌐 Multi-Platform | Cross-platform matrix build | Testing across multiple OS/compilers |
| 🔒 Security-Focused | Security-enhanced build | Security scanning and compliance |
| 📊 Comprehensive | Full-featured build pipeline | Enterprise-grade CI/CD |
Copy the appropriate example to your repository:
# For basic Makefile projects
cp examples/makefile-build/basic-makefile.yml .github/workflows/build.yml
# For autotools projects
cp examples/makefile-build/autotools-project.yml .github/workflows/build.yml
# For CMake projects
cp examples/makefile-build/cmake-makefile.yml .github/workflows/build.ymlEdit the configuration in .github/config/makefile-build/:
# Choose or customize a configuration
cp .github/config/makefile-build/default.yml .github/config/makefile-build/my-config.yml
vim .github/config/makefile-build/my-config.ymlUpdate the config-file parameter in your workflow:
with:
config-file: 'my-config' # References my-config.yml| Config | Description | Best For |
|---|---|---|
default |
Basic autotools/make setup | Standard projects |
autotools |
Full GNU autotools support | Complex autotools projects |
cmake-makefile |
CMake Makefile generator | CMake-based projects |
kernel-module |
Linux kernel development | Kernel modules |
matrix |
Multi-platform testing | Cross-platform projects |
Create custom configurations in .github/config/makefile-build/:
# .github/config/makefile-build/my-project.yml
name: "My Project Build"
description: "Custom configuration for my project"
configure:
script: "./configure"
args: ["--enable-feature", "--with-library"]
build:
targets: ["all", "docs"]
parallel_jobs: 4
test:
targets: ["check", "integration-test"]name: 🔨 Build & Test
on: [push, pull_request]
jobs:
build:
uses: bauer-group/automation-templates/.github/workflows/makefile-build.yml@main
with:
config-file: 'autotools'
make-targets: 'all'
check-targets: 'check installcheck'
distcheck-enabled: truename: 🔨 CMake Build
on: [push, pull_request]
jobs:
build:
uses: bauer-group/automation-templates/.github/workflows/makefile-build.yml@main
with:
config-file: 'cmake-makefile'
configure-script: 'cmake'
configure-args: '-S . -B build -DCMAKE_BUILD_TYPE=Release'
make-targets: 'all'
working-directory: 'build'name: 🌐 Multi-Platform Build
on: [push, pull_request]
jobs:
build:
uses: bauer-group/automation-templates/.github/workflows/makefile-build.yml@main
with:
config-file: 'matrix'
make-targets: 'all'
check-targets: 'check'
upload-artifacts: trueEnable security scanning in your workflow:
with:
config-file: 'default'
security-scan: true
fail-on-warnings: trueAutomatically scan for secrets before building:
jobs:
security:
uses: bauer-group/automation-templates/.github/workflows/makefile-build.yml@main
with:
security-scan: true
# Build will only run if security scan passesUpload build artifacts and test results:
with:
generate-reports: true
upload-artifacts: trueEnable build caching for faster builds:
with:
cache-enabled: true
config-file: 'autotools' # Includes cache configurationConfigure parallel compilation:
with:
parallel-jobs: 'auto' # Use all available cores
# or specify a number:
# parallel-jobs: '4'-
Configure script not found
# Generate configure script from configure.ac configure-script: 'autoreconf -fiv && ./configure'
-
Missing dependencies
# Enable dependency installation install-dependencies: true
-
Test failures
# Continue on test errors for debugging check-targets: 'check || true' generate-reports: true
Enable verbose output for debugging:
with:
fail-on-warnings: false
generate-reports: true
# Check uploaded artifacts for detailed logs- Makefile Build Action Documentation
- Configuration Reference
- GNU Autotools Manual
- CMake Documentation
- Make Manual
Have a useful Makefile build example? Please contribute:
- Create your example workflow
- Add appropriate documentation
- Test with real projects
- Submit a pull request
Follow the existing naming convention: {category}-{type}.yml