From bf60065bb8224395f4a3341d1d65ae2e6af98c17 Mon Sep 17 00:00:00 2001 From: Mark Paronyan Date: Thu, 1 Oct 2026 12:33:00 +0000 Subject: [PATCH] fix(make): warn when config.def.h is newer than config.h --- Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e51e770..f05a75d 100644 --- a/Makefile +++ b/Makefile @@ -10,8 +10,13 @@ DEBUG_CFLAGS = ${CFLAGS} -UNDEBUG -O0 -g -ggdb -Wall -Wextra -Wno-unused-paramet all: dvtm dvtm-editor -config.h: - cp config.def.h config.h +config.h: config.def.h + @if [ -e $@ ]; then \ + echo "warning: $< is newer than $@, review the changes and merge them into $@ or delete $@ to regenerate it" >&2; \ + else \ + echo "cp $< $@"; \ + cp $< $@; \ + fi dvtm: config.h config.mk *.c *.h ${CC} ${CFLAGS} ${SRC} ${LDFLAGS} ${LIBS} -o $@