From: Vincent Bernat Date: Sun, 31 May 2020 05:22:47 +0000 (+0200) Subject: build: ensure build process stops if not able to generate syscall-names.h X-Git-Tag: 1.0.6~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b74e151dcfa98411abc354ab52a5e090c44a7e82;p=thirdparty%2Flldpd.git build: ensure build process stops if not able to generate syscall-names.h --- diff --git a/src/daemon/Makefile.am b/src/daemon/Makefile.am index cc41a8a1..740a0588 100644 --- a/src/daemon/Makefile.am +++ b/src/daemon/Makefile.am @@ -104,13 +104,15 @@ endif # seccomp support if USE_SECCOMP BUILT_SOURCES += syscall-names.h -CLEANFILES += syscall-names.h +CLEANFILES += syscall-names.h syscall-names.h.tmp syscall-names.h: $(AM_V_GEN) - $(AM_V_at)echo "static const char *syscall_names[] = {" > $@ ;\ - echo "#include " | $(CPP) -dM | grep '^#define __NR_' | \ + $(AM_V_at)echo "#include " | $(CPP) -dM > $@.tmp ;\ + echo "static const char *syscall_names[] = {" > $@ ;\ + grep '^#define __NR_' $@.tmp | \ LC_ALL=C sed -r -n -e 's/^\#define[ \t]+__NR_([a-z0-9_]+)[ \t]+([0-9]+)(.*)/ [\2] = "\1",/p' >> $@ ;\ - echo "};" >> $@ + echo "};" >> $@ ;\ + rm $@.tmp nodist_liblldpd_la_SOURCES += syscall-names.h liblldpd_la_SOURCES += priv-seccomp.c liblldpd_la_CFLAGS += @libseccomp_CFLAGS@