X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=Makefile.am;h=b16c01ae6780c2c39456c3c6e4ab743fc909ea3a;hp=cf911a0fe4b818c6723d6c51869311ebbb175bd8;hb=8351ceaea9480d9c2979aa2ff0f4982cfdfef58d;hpb=6fa9a6109250d964db1f0690150b657db056ef81 diff --git a/Makefile.am b/Makefile.am index cf911a0fe..b16c01ae6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -961,11 +961,15 @@ libsystemd_core_la_SOURCES = \ src/core/switch-root.h \ src/core/switch-root.c \ src/core/killall.h \ - src/core/killall.c + src/core/killall.c \ + src/core/syscall-list.c \ + src/core/syscall-list.h nodist_libsystemd_core_la_SOURCES = \ src/core/load-fragment-gperf.c \ - src/core/load-fragment-gperf-nulstr.c + src/core/load-fragment-gperf-nulstr.c \ + src/core/syscall-from-name.h \ + src/core/syscall-to-name.h libsystemd_core_la_CFLAGS = \ $(AM_CFLAGS) \ @@ -998,7 +1002,23 @@ EXTRA_DIST += \ CLEANFILES += \ src/core/load-fragment-gperf.gperf \ src/core/load-fragment-gperf.c \ - src/core/load-fragment-gperf-nulstr.c + src/core/load-fragment-gperf-nulstr.c \ + src/core/syscall-list.txt \ + src/core/syscall-from-name.gperf \ + src/core/syscall-from-name.h \ + src/core/syscall-to-name.h + +src/core/syscall-list.txt: Makefile + $(AM_V_GEN)cpp -dM -include sys/syscall.h < /dev/null | $(AWK) '/^#define[ \t]+__NR_[^ ]+[ \t]+[0-9]/ { sub(/__NR_/, "", $$2); print $$2; }' > $@ || rm $@ + +src/core/syscall-from-name.gperf: src/core/syscall-list.txt Makefile + $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct syscall_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, __NR_%s\n", $$1, $$1 }' < $< > $@ + +src/core/syscall-from-name.h: src/core/syscall-from-name.gperf Makefile + $(AM_V_GEN)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_syscall -H hash_syscall_name -p -C < $< > $@ + +src/core/syscall-to-name.h: src/core/syscall-list.txt Makefile + $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const syscall_names[] = { "} { printf "[__NR_%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' < $< > $@ # ------------------------------------------------------------------------------ systemd_SOURCES = \