The framework exposes a set of option variables that let you tune how builds behave without touching recipe code. Each option is enabled by assigning it any non-empty value (conventionallyDocumentation 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.
X) and disabled by leaving it empty. You can override any option from the command line with make VARIABLE=value, or set permanent defaults in your GNUmakefile before the $(eval $(value MKFWK_FOOTER)) call.
Overriding options from the command line
Pass one or more variable assignments directly tomake to override defaults for a single invocation:
Behavior options
MUST_MAKE — dry-run preview mode
MUST_MAKE — dry-run preview mode
-t / --touch flag on the Make command line, Make’s own touch mechanism takes precedence and MUST_MAKE is automatically overridden (set back to empty). The framework prints a notice when this override happens.INCLUDE_DEPS — auto-generated dependency files
INCLUDE_DEPS — auto-generated dependency files
X (enabled)Controls whether the auto-generated $(DEPDIR)*.d dependency makefiles are included. These files record the full header chain for each translation unit so that changing a header triggers a rebuild of every source that includes it. Disabling this option speeds up cold starts at the cost of potentially stale builds.GENERATE_PREPROCESSING_OUTPUT — save .i files
GENERATE_PREPROCESSING_OUTPUT — save .i files
*.i file inside $(OBJDIR). Useful for inspecting macro expansion.GENERATE_COMPILING_OUTPUT — save .s files
GENERATE_COMPILING_OUTPUT — save .s files
*.s file inside $(OBJDIR). Useful for low-level inspection of generated code.GENERATE_ASSEMBLING_OUTPUT — save .o files
GENERATE_ASSEMBLING_OUTPUT — save .o files
X (enabled)Controls whether compiled object files (*.o) are retained in $(OBJDIR) after linking. Keeping them allows incremental rebuilds. Disabling this causes object files to be removed once the final binary is linked.REGENERATE_INTERMEDIATES — rebuild removed intermediates
REGENERATE_INTERMEDIATES — rebuild removed intermediates
X (enabled)When enabled, the framework treats intermediate target files (.i, .s, .o) as precious: if they are manually deleted they will be regenerated on the next build. When disabled, Make treats them as truly temporary and will not recreate them on their own.VERBOSE — detailed build messages
VERBOSE — detailed build messages
X (enabled)When enabled, the framework prints detailed status messages as each step runs, including tool pathnames, installed versions, and option activation state. Disabling it produces quieter output.STARTUP_CHECKS — validate tools at startup
STARTUP_CHECKS — validate tools at startup
X (enabled)When enabled, the framework checks at parse time that the shell exists, that core utilities (GNU coreutils, findutils, awk, sed) can be found, and that required source files and linking orders are set for every declared binary. Disabling this skips all of those checks and can reduce startup latency in environments where the tools are known to be present.RUNTIME_CHECKS — validate commands before use
RUNTIME_CHECKS — validate commands before use
X (enabled)When enabled, the framework verifies that each required tool (CC, YACC, LEX, AR, GDB, VALGRIND) is set and can be located before the recipe that uses it runs. This catches missing tools early rather than mid-build.Warning and debug options
CC_WARNINGS / YACC_WARNINGS / LEX_WARNINGS
CC_WARNINGS / YACC_WARNINGS / LEX_WARNINGS
X (enabled)Control whether warning flags are appended to the compiler/parser/scanner invocation.| Variable | Effect when enabled |
|---|---|
CC_WARNINGS | Appends -Wall -Wpedantic to CFLAGS |
YACC_WARNINGS | Appends -Wall to YFLAGS |
LEX_WARNINGS | No additional flags currently defined |
CC_DEBUG / YACC_DEBUG / LEX_DEBUG
CC_DEBUG / YACC_DEBUG / LEX_DEBUG
CC_DEBUG=X, YACC_DEBUG= (disabled), LEX_DEBUG= (disabled)Control whether debug instrumentation is compiled into each tool’s output.| Variable | Effect when enabled | Effect when disabled |
|---|---|---|
CC_DEBUG | Appends -DDEBUG=1 to CPPFLAGS and -g3 to CFLAGS | Appends -DDEBUG=0 to CPPFLAGS |
YACC_DEBUG | Appends -t to YFLAGS; appends -DYYDEBUG=1 to YACC_CPPFLAGS | Appends -DYYDEBUG=0 to YACC_CPPFLAGS |
LEX_DEBUG | Appends -d to LFLAGS (activates Flex debug tracing) | No change to flags |
YACC_CPPFLAGS always receives either -DYYDEBUG=1 or -DYYDEBUG=0 regardless of the YACC_DEBUG state. This ensures the YYDEBUG macro is always explicitly defined in Bison-generated translation units.Directory variables
The three directory variables control where the framework places output files. All values must end with a trailing slash, or be left empty to use the top-level makefile directory.| Variable | Default | Purpose |
|---|---|---|
BINDIR | bin/ | Final programs and libraries |
OBJDIR | obj/ | Intermediate files (.i, .s, .o, and generated .tab.c / .lex.yy.c) |
DEPDIR | .deps/ | Auto-generated dependency files (.d and .d.timestamp) |
Binary prefix variables
BINARY_PREFIXES is a space-separated list of prefixes that the framework iterates over when looking for program and library declarations. The default prefix BIN means the framework will look for BIN_PROGRAMS, BIN_LIBRARIES, and BIN_SOLIBRARIES, and will use BINDIR as the output directory for that prefix.
You can add additional prefixes to support multiple output directories — for example a prefix TEST would introduce TEST_PROGRAMS, TEST_LIBRARIES, and TESTDIR for a separate test-binary tree.