]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
build: ensure build process stops if not able to generate syscall-names.h
authorVincent Bernat <vincent@bernat.ch>
Sun, 31 May 2020 05:22:47 +0000 (07:22 +0200)
committerVincent Bernat <vincent@bernat.ch>
Sun, 31 May 2020 05:28:55 +0000 (07:28 +0200)
src/daemon/Makefile.am

index cc41a8a151d8692dfae42ca2a1403e064ea8c088..740a0588da083009af837d7a77ee63e02404c183 100644 (file)
@@ -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 <sys/syscall.h>" | $(CPP) -dM | grep '^#define __NR_' | \
+       $(AM_V_at)echo "#include <sys/syscall.h>" | $(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@