Skip to content
This repository was archived by the owner on Apr 25, 2026. It is now read-only.

cwchentw/mkg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

218 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mkg - Opinionated GNU Make-based Project Generator

License: MIT Build status

mkg is a CLI tool that generates GNU Make-based projects for C and C++.

⚠️ Project Status (Archived)

This project is no longer maintained and will not receive further updates.

The reason is not technical, but conceptual:

A generic project generator is not a good abstraction for C/C++ ecosystems.

After building and using mkg, I concluded that:

  • There is no single project structure that fits all scenarios
  • Build systems, toolchains, and workflows vary significantly across projects
  • Customization quickly becomes user-specific rather than general-purpose
  • The real complexity lies after project creation, not in the boilerplate itself

Because of this, maintaining a general-purpose project generator does not provide enough value.

✅ What works better

Instead of using a generator, a more practical approach is:

Maintain a small set of personal boilerplate repositories and reuse them.

For example, I created:

You can equally create your own boilerplates. It takes much less time than you might expect.

🎯 Who this repository is for

Although mkg is no longer maintained, this repository may still be useful if you are interested in:

  • Designing a CLI tool
  • Implementing a project generator
  • Understanding why such tools often fail in practice

You can treat this repository as a reference implementation and a case study.

System Requirements

To use mkg-generated projects, you need:

  • A C (or C++) compiler
  • GNU Make

To compile mkg from source, you need:

  • A Go compiler

Install

Pre-compiled executables are available here: https://github.com/cwchentw/mkg/releases

Move the mkg executable to any directory in your system PATH.

Or install via Go:

go get github.com/cwchentw/mkg

Synopsis

Batch mode:

mkg [option] path/to/project

Interactive mode (recommended defaults):

mkg

Interactive mode (full customization):

mkg --custom

Usage

mkg generates projects using the system's default C/C++ compiler (e.g. GCC, Clang, MSVC). You can override this via environment variables.

Example:

mkg myapp

Customized example:

mkg -cpp --library --flat mylib

Interactive mode:

mkg

(Interactive prompts omitted for brevity)

Options

Program metadata

  • -v, --version
  • -h, --help
  • --licenses
  • --standards

Project metadata

  • --program
  • --author
  • --brief
  • --output
  • --license

Behavior modifiers

  • -c, -cpp
  • --standard
  • --console, --library
  • --nested, --flat
  • --force (dangerous)
  • --custom

Project structure

  • --source
  • --include
  • --dist
  • --test
  • --example

Philosophy

mkg was designed with the following goals:

  • Simple: Use plain Makefiles instead of introducing another DSL
  • Portable: Works across major desktop platforms
  • Lightweight: No external runtime dependencies

It was inspired by tools like:

  • Autotools
  • CMake
  • Bakefile

However, the conclusion of this project is that:

The problem is not the lack of tools, but the lack of a universal workflow.

License

Copyright (c) 2018–2020 Michelle Chen.

mkg is licensed under MIT.

Projects generated by mkg are not restricted and may use any license.

Contributors

Languages