The framework is distributed as a directory of plain GNU Make files. There is no package manager, no compiled binary, and no installer — you copyDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/fernandodanielmaqueda/gcc-bison-flex-GNUmakefile/llms.txt
Use this file to discover all available pages before exploring further.
mkframework/ into your project root and it is ready to use. This page covers what your system needs, what the framework checks on startup, and how to obtain and place the files.
System requirements
Required
| Component | Minimum version | Notes |
|---|---|---|
| GNU Make | 3.81 | Must be invoked as make or gmake |
GCC (cc) | Any recent version | Controlled by the CC variable; clang also works |
| POSIX shell | /bin/sh | Required for $(shell ...) calls inside the makefiles |
| GNU coreutils | Any | cut, expr, false, mkdir, mv, printf, rm, rmdir, sort, test, touch, tr, true, uname |
| GNU findutils | Any | find |
| awk | Any POSIX awk | Used in cleaning targets |
| sed | Any POSIX sed | Used in source and flag discovery |
Optional
These tools are only needed if you use the corresponding features:| Tool | Purpose | Make targets |
|---|---|---|
| Bison | Parser generator for .y grammar files | all (when .y sources are present) |
| Flex | Scanner generator for .l scanner files | all (when .l sources are present) |
| GDB | Source-level debugger | gdb-<program> |
| Valgrind | Memory and thread analysis | valgrind-<tool>-<program> |
| ar | Static library archiver | all (when BIN_LIBRARIES is set) |
| ranlib | Static library index generator | all (when BIN_LIBRARIES is set) |
Startup checks
WhenSTARTUP_CHECKS is enabled (it is enabled by default — STARTUP_CHECKS=X), the framework validates your environment before attempting any build. These checks run during makefile parsing, so failures appear immediately when you invoke make.
The checks are defined in mkframework/header/core.mk and cover:
- Shell existence — verifies that the path in
SHELL(default/bin/sh) points to an actual file - Shell function — confirms that GNU Make’s
$(shell ...)function executes correctly; on some Windows configurations this can silently fail - Incompatible flags — detects
-n/--just-print/--dry-run/--recon, which disable$(shell ...)and would silently break source discovery - GNU coreutils — checks that each command in
MKFWK_COREUTILS_CORE_COMMANDSresolves viacommand -v - GNU findutils — checks that
findresolves viacommand -v - Standalone utilities — checks that
awkandsedresolve viacommand -v
Startup checks add a small overhead on every Make invocation because they use
$(shell ...) calls during parsing. If you are running Make in a tight CI loop and your environment is known-good, you can disable them by passing STARTUP_CHECKS= on the command line or setting it empty in your makefile before the footer expansion.Obtaining the framework
- Clone from GitHub
- Download archive
Clone the full repository and copy the You can also add the repository as a Git submodule if you want to track upstream changes:
mkframework/ directory into your project:Framework directory layout
After copying,mkframework/ contains the following files:
lang/) contains message string makefiles. The active locale is controlled by MKFWK_CODE_DIR (default en_US/). You can switch to Spanish messages by setting MKFWK_CODE_DIR=es_AR/ before the framework is included.
Where to place mkframework/
Place mkframework/ in the same directory as your GNUmakefile (your project root). The default include path in main.mk is:
MKFWK_MAIN_MAKEFILE to the actual path on the command line or in an environment variable:
What gets created in your project
The firstmake all invocation creates these directories alongside your source files:
| Directory | Variable | Cleaned by |
|---|---|---|
bin/ | BINDIR | cleandirs |
obj/ | OBJDIR | cleandirs |
.deps/ | DEPDIR | cleandeps, then cleandirs |
cleandeps— removes.ddependency filesmostlyclean— removes programs and.o/.s/.iintermediate filesclean— also removes library files (.a,.so)distclean/realclean/clobber— available for project-specific extensionsmaintainer-clean— also removes Bison- and Flex-generated C filescleandirs— removes thebin/,obj/, and.deps/directories themselves
Windows note
- Unix-like systems
- Windows
On Linux, macOS, and other POSIX systems, no extra configuration is needed. The
EXEEXT variable is empty and programs are placed in bin/ without a file extension.Next steps
Quickstart
Build your first program with the framework end to end.
Framework structure
Detailed walkthrough of the header/footer architecture.
Configuration variables
Full reference for all variables you can set to control the build.
C-only project guide
Step-by-step guide for a plain C project with no grammar files.