Skip to main content

Documentation 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.

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 (conventionally 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 to make to override defaults for a single invocation:
# Run a dry-run preview without any debug output
make MUST_MAKE=X VERBOSE=

# Build with warnings disabled and no dependency tracking
make CC_WARNINGS= YACC_WARNINGS= INCLUDE_DEPS=

Behavior options

Default: empty (disabled)When set to a non-empty value, the framework prints the targets that would be rebuilt and their newer dependencies instead of actually rebuilding them. No files are created or modified.
MUST_MAKE=X   # enable dry-run preview
MUST_MAKE=    # disable (default)
If you also pass the -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.
Default: 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.
INCLUDE_DEPS=X   # include .d files (default)
INCLUDE_DEPS=    # skip .d files
Default: empty (disabled)When enabled, the framework saves the preprocessed output for each translation unit as a *.i file inside $(OBJDIR). Useful for inspecting macro expansion.
GENERATE_PREPROCESSING_OUTPUT=X   # save .i files
GENERATE_PREPROCESSING_OUTPUT=    # discard (default)
Default: empty (disabled)When enabled, the framework saves the assembly output from the compilation phase as a *.s file inside $(OBJDIR). Useful for low-level inspection of generated code.
GENERATE_COMPILING_OUTPUT=X   # save .s files
GENERATE_COMPILING_OUTPUT=    # discard (default)
Default: 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.
GENERATE_ASSEMBLING_OUTPUT=X   # keep .o files (default)
GENERATE_ASSEMBLING_OUTPUT=    # remove after linking
Default: 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.
REGENERATE_INTERMEDIATES=X   # regenerate if missing (default)
REGENERATE_INTERMEDIATES=    # treat as truly temporary
Default: 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.
VERBOSE=X   # print detailed messages (default)
VERBOSE=    # suppress extra messages
Default: 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.
STARTUP_CHECKS=X   # validate at startup (default)
STARTUP_CHECKS=    # skip startup validation
Default: 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.
RUNTIME_CHECKS=X   # check before each invocation (default)
RUNTIME_CHECKS=    # skip runtime validation

Warning and debug options

Defaults: all X (enabled)Control whether warning flags are appended to the compiler/parser/scanner invocation.
VariableEffect when enabled
CC_WARNINGSAppends -Wall -Wpedantic to CFLAGS
YACC_WARNINGSAppends -Wall to YFLAGS
LEX_WARNINGSNo additional flags currently defined
# Disable all warnings in a single invocation
make CC_WARNINGS= YACC_WARNINGS= LEX_WARNINGS=
Defaults: CC_DEBUG=X, YACC_DEBUG= (disabled), LEX_DEBUG= (disabled)Control whether debug instrumentation is compiled into each tool’s output.
VariableEffect when enabledEffect when disabled
CC_DEBUGAppends -DDEBUG=1 to CPPFLAGS and -g3 to CFLAGSAppends -DDEBUG=0 to CPPFLAGS
YACC_DEBUGAppends -t to YFLAGS; appends -DYYDEBUG=1 to YACC_CPPFLAGSAppends -DYYDEBUG=0 to YACC_CPPFLAGS
LEX_DEBUGAppends -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.
# Enable full debug build: GDB symbols + Bison trace + Flex trace
make CC_DEBUG=X YACC_DEBUG=X LEX_DEBUG=X

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.
VariableDefaultPurpose
BINDIRbin/Final programs and libraries
OBJDIRobj/Intermediate files (.i, .s, .o, and generated .tab.c / .lex.yy.c)
DEPDIR.deps/Auto-generated dependency files (.d and .d.timestamp)
# Redirect all output to a build/ tree
BINDIR:=build/out/
OBJDIR:=build/obj/
DEPDIR:=build/deps/
Set these variables before the $(eval $(value MKFWK_FOOTER)) line. Changing them after that point has no effect because the footer makefiles have already captured the values when computing target paths.

Binary prefix variables

BINARY_PREFIXES+=BIN
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.

Build docs developers (and LLMs) love