Extract shared Makefile config into common.mk

CC, CFLAGS, and BUILD are now defined once in common.mk at the repo root.
Each module and CLI Makefile sets ROOT then includes common.mk, eliminating
the repeated definitions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-25 22:15:03 +00:00
parent eb65181fe7
commit e1b848333b
5 changed files with 39 additions and 33 deletions

7
common.mk Normal file
View File

@@ -0,0 +1,7 @@
# Included by all module and cli Makefiles.
# Each including Makefile must set ROOT before including this file:
# ROOT := $(abspath <relative path to repo root>)
CC = gcc
CFLAGS = -std=c11 -Wall -Wextra -D_GNU_SOURCE -flto -I$(ROOT)/include
BUILD = $(ROOT)/build