MKPM is a simple yet effective package manager designed to enhance the power of GNU Make. By enabling the sharing and reusing of Makefiles across various projects, MKPM streamlines workflows and integrates seamlessly with local and remote artifact registries. Try it out to simplify your build processes.
MKPM, or Make Package Manager, is a minimalist package manager designed specifically for GNU Make, enabling the sharing and reuse of Makefiles, known as "packages," across various projects. This functionality is powered by both local workspaces and remote OCI registries through ORAS, which serves as a versatile artifact store structured around the OCI registry specification.
To initialize MKPM, bootstrap it into your current directory:
make -f <(curl -fsSL https://mkpm.io) install
Once installed, configure your project's registry to use GitHub Container Registry or another preferred registry by editing the autogenerated .mkpmrc file comprising basic settings such as registry address and plugin configurations.
Packages can be loaded into your Makefile by calling:
$(call mkpm_load,<package_name>) # Load latest version
$(call mkpm_load,<package_name>@<version>) # Load pinned version
To scaffold a new package structure, use:
make mkpm-init name=<pkg-name>
This generates an mkpkg file defining essential parameters like package name, version, and main Makefile. Users can publish their packages easily by running:
make mkpm-pack # Package the contents
make mkpm-publish # Push to the configured registry
MKPM reads configuration from two key files, .mkpmrc and .mkpmrc.local, which define settings such as the registry address and plugin lists. Local overrides can be maintained in the local configuration for personal secrets and customized settings without affecting shared project configurations.
While MKPM brings significant advantages for simple package management, it has limitations inherent in Make's variable scoping. It provides basic dependency resolution based on exact semantic version matches, with capabilities potentially expanding in future iterations.
No comments yet.
Sign in to be the first to comment.