git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Overwriting files in Makefile

From
Horst von Brand <vonbrand@inf.utfsm.cl>
Date
May 12, 2005, 15:56 UTC
Message-ID
<200505121556.j4CFuRVS010004@laptop11.inf.utfsm.cl>

The current setup disturbs me. The Makefile copies the scripts into the destination, and then edits them in place. Why not just generate them from .in files before installing, i.e. by a rule something like

%: %.in
   sed -e 's;@LIBDIR@;$(sedlibdir);g' $^ > $@

with '@LIBDIR@' in the .in file whereever the substitution should take place. This way you also avoid the possible loss of the permission bits when fooling around (any SUID/SGID would get lost; not that it matters here).

In any case, the '\/'s (LTS, "Leaning Toothpick Syndrome") when futzing around with file paths can be avoided by using something else than '/' as delimiter for sed(1)'s substitute command, like ';' here.

-- 
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513
Message 1 of 1 in “Overwriting files in Makefile”
  1. Horst von BrandMay 12, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.