Introduce ENDLIST to terminate multiline makefile lists

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Introduce ENDLIST to terminate multiline makefile lists
Date: 2025-12-29 01:43:30
Message-ID: CAEoWx2nsiH9PxBKtD_pVLLYVHUv8=FohczchT550a7VT+LZq4g@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Hacker,

Patch [1] reminded me of a technique that was used long ago in my early
C/C++ projects at Lucent Technologies (for those who still remember the
company :) ). In those projects, multi-line lists in Makefiles were always
terminated with $(ENDLIST), where ENDLIST is just a global dummy variable.

The benefits are:

* It clearly marks the end of a list.
* Adding or removing items does not require worrying about a trailing “\”.
* Changes at the end of a list do not introduce extra diff noise from
adjusting backslashes.

This is not a new invention on my part. I’m simply proposing to bring this
existing technique into the PostgreSQL source tree.

In this patch, I’ve only applied $(ENDLIST) to the Makefiles touched
by [1]. If this approach is acceptable, I can follow up with a patch to
apply it more broadly.

Note that since ENDLIST is defined in Makefile.global.in, this change
requires rerunning ./configure.

[1] https://postgr.es/m/DF6HDGB559U5.3MPRFCWPONEAE@jeltef.nl

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

Attachment Content-Type Size
v1-0001-Introduce-ENDLIST-to-terminate-multiline-makefile.patch application/octet-stream 5.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Henson Choi 2025-12-29 01:46:26 Re: RFC: PostgreSQL Storage I/O Transformation Hooks
Previous Message zengman 2025-12-29 01:43:12 Re: [Patch] timezone/zic.c: Fix file handle leak in dolink()