Quality gates for Makefile
This repository contains a complete hello_world Python package with a comprehensive Makefile that includes all the tools necessary to validate a Makefile.
.
├── hello_world/ # Python package
│ └── __init__.py # Package with hello() function
├── pyproject.toml # Modern Python packaging configuration
├── Makefile # Comprehensive validation targets
├── demo.py # Demonstration script
└── README.md # This file
The Makefile includes targets for all these validation tools:
- almost-make: Check Makefile compatibility with make alternatives
- make2help: Generate help documentation from Makefile
- make-help: Help system validation
- make-help-helper: Help utilities
- makefile-checker: Validate Makefile syntax and best practices
- shellcheck-makefile: Check shell scripts in Makefile with shellcheck
- shellcheck-py: Check Python scripts with shellcheck-py
- mbake: Makefile build tool validation
-
Quick Demo: Run the demonstration script
python3 demo.py
-
Install Package: Install the hello_world package
make install-core # Install core tools (handles conflicts) -
Run All Validations: Execute the complete validation pipeline
make validate-makefile
-
Get Help: See all available targets
make help -
Test Package: Run basic package tests
make test
- Graceful Fallbacks: All validation tools have fallback behavior when not installed
- Dependency Management: Resolves conflicts between make-help and mbake through optional dependencies
- Comprehensive Pipeline: Single target (
validate-makefile) runs all validation tools - Development Workflow: Includes clean, build, test, and format targets
- Self-Documenting: Auto-generated help from target descriptions
help- Show help messageall- Install dependencies, validate Makefile, and run testsinstall- Install package with all available toolsinstall-core- Install core validation tools (no conflicts)test- Run basic package testsvalidate-makefile- Run all Makefile validation toolsclean- Clean build artifactsbuild- Build the packageshow-structure- Display package structure
Each validation tool has its own target for granular control:
almost-make,make2help,make-help,make-help-helpermakefile-checker,shellcheck-makefile,shellcheck-py,mbake
The Makefile demonstrates best practices for:
- Tool availability checking
- Graceful error handling
- Comprehensive documentation
- Modular validation pipeline
- Cross-platform compatibility