aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-07-05 20:28:23 +0200
committerMattias Andrée <maandree@kth.se>2023-07-05 20:28:23 +0200
commitbf1ccb7ce4f13deb52013b9cbddfe2ad7cceba00 (patch)
treec0213fdb769a77f3aac3c1a0e91794bdaa4812d9 /Makefile
parentImprove make config file portability and remove -g from CFLAGS and -s from LDFLAGS (diff)
downloadcontacts-bf1ccb7ce4f13deb52013b9cbddfe2ad7cceba00.tar.gz
contacts-bf1ccb7ce4f13deb52013b9cbddfe2ad7cceba00.tar.bz2
contacts-bf1ccb7ce4f13deb52013b9cbddfe2ad7cceba00.tar.xz
Improve multicall-binary: keep dashs as are when printing that a command was not found
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile9
1 files changed, 8 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index f71def1..b00cb8f 100644
--- a/Makefile
+++ b/Makefile
@@ -86,9 +86,16 @@ contacts: contacts.o $(BOBJ)
contacts.c: contacts.c.in Makefile
printf '#define LIST_COMMANDS' > $@
- printf '\\\n\tX(%s)' $(BIN) | tr - _ >> $@
+ for bin in $(BIN); do\
+ printf '\\\n\tX(%s, %s)' $$bin $$(printf '%s\n' $$bin | tr - _) || exit 1;\
+ done >> $@
printf '\n\n' >> $@
cat contacts.c.in >> $@
+# (printf '\\\n\tX(%s)' $(BIN); printf '\n\n') are run together
+# because the input of sed must be a text file, and the first
+# printf(1) do not generate a text file as text files are by
+# definition LF terminated unless they are empty (also no line
+# may exceed 2048 bytes including the LF)
add-contact: add-contact.o
$(CC) -o $@ $@.o $(LDFLAGS)