{"thread":{"id":"586","subject":"Overwriting files in Makefile","startedAt":"2005-05-12T15:56:27Z","lastAt":"2005-05-12T15:56:27Z","messageCount":1,"participants":["Horst von Brand"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"3160","messageId":"200505121556.j4CFuRVS010004@laptop11.inf.utfsm.cl","threadId":"586","inReplyTo":null,"subject":"Overwriting files in Makefile","fromName":"Horst von Brand","fromEmail":"vonbrand@inf.utfsm.cl","sentAt":"2005-05-12T15:56:27Z","receivedAt":"2005-05-12T15:56:27Z","isPatch":false,"sender":{"key":"vonbrand@inf.utfsm.cl","avatar":"https://avatars.githubusercontent.com/u/211384?v=4"},"body":"The current setup disturbs me. The Makefile copies the scripts into the\ndestination, and then edits them in place. Why not just generate them from\n.in files before installing, i.e. by a rule something like\n\n%: %.in\n   sed -e 's;@LIBDIR@;$(sedlibdir);g' $^ > $@\n\nwith '@LIBDIR@' in the .in file whereever the substitution should take\nplace. This way you also avoid the possible loss of the permission bits\nwhen fooling around (any SUID/SGID would get lost; not that it matters\nhere).\n\nIn any case, the '\\/'s (LTS, \"Leaning Toothpick Syndrome\") when futzing\naround with file paths can be avoided by using something else than '/' as\ndelimiter for sed(1)'s substitute command, like ';' here.\n-- \nDr. Horst H. von Brand                   User #22616 counter.li.org\nDepartamento de Informatica                     Fono: +56 32 654431\nUniversidad Tecnica Federico Santa Maria              +56 32 654239\nCasilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513\n"}]}