aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2020-05-31 00:23:22 +0200
committerMattias Andrée <maandree@kth.se>2020-05-31 00:23:22 +0200
commit4383640bfe4c40c055824d9c42ed8809bb3163b4 (patch)
treedf194cbc3764320a88e25e1f77855aaaed4631ea /Makefile
parentWork around valgrind issue (diff)
downloadsctrace-4383640bfe4c40c055824d9c42ed8809bb3163b4.tar.gz
sctrace-4383640bfe4c40c055824d9c42ed8809bb3163b4.tar.bz2
sctrace-4383640bfe4c40c055824d9c42ed8809bb3163b4.tar.xz
Print signal names
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 10 insertions, 2 deletions
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