From 4383640bfe4c40c055824d9c42ed8809bb3163b4 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 31 May 2020 00:23:22 +0200 Subject: Print signal names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 3631779..251e7ed 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,8 @@ OBJ =\ HDR =\ arg.h\ common.h\ - list-errnos.h + list-errnos.h\ + list-signums.h all: sctrace $(OBJ): $(@:.o=.c) $(HDR) @@ -32,6 +33,13 @@ list-errnos.h: | sed -n '/^[ \t]*#[ \t]*define[ \t].*[ \t][0-9]*[ \t]*$$/s/^[ \t#]*define[ \t]*\([^ \t]*\).*$$/_(\1)/p' \ | sort | uniq | tr '\n' '#' | sed 's/#_/\\\n\t_/g' | tr '#' '\n' >> $@ +list-signums.h: + printf '#define LIST_SIGNUMS(_)\\\n\t' > $@ + cat /usr/include/bits/signum.h /usr/include/bits/signum-generic.h \ + | sed 's/\/\/.*$$//' | tr -d '$$' | sed 's/\*\//\$$/g' | sed 's/\/\*[^$$]*\$$//g' \ + | sed -n '/^[ \t]*#[ \t]*define[ \t][^_]*[ \t][0-9]*[ \t]*$$/s/^[ \t#]*define[ \t]*\([^ \t]*\).*$$/_(\1)/p' \ + | sort | uniq | tr '\n' '#' | sed 's/#_/\\\n\t_/g' | tr '#' '\n' >> $@ + install: sctrace mkdir -p -- "$(DESTDIR)$(PREFIX)/bin" cp -- sctrace "$(DESTDIR)$(PREFIX)/bin" @@ -40,7 +48,7 @@ uninstall: -rm -f -- "$(DESTDIR)$(PREFIX)/bin/sctrace" clean: - -rm -f -- *.o list-errnos.h sctrace + -rm -f -- *.o list-*.h sctrace .SUFFIXES: .SUFFIXES: .c .o -- cgit v1.2.3-70-g09d2