deduplicate __NR_* and SYS_* syscall number definitions
diff --git a/Makefile b/Makefile
index ec54880..8246b78 100644
--- a/Makefile
+++ b/Makefile
@@ -33,7 +33,7 @@
AOBJS = $(LIBC_OBJS)
LOBJS = $(LIBC_OBJS:.o=.lo)
-GENH = obj/include/bits/alltypes.h
+GENH = obj/include/bits/alltypes.h obj/include/bits/syscall.h
GENH_INT = obj/src/internal/version.h
IMPH = $(addprefix $(srcdir)/, src/internal/stdio_impl.h src/internal/pthread_impl.h src/internal/libc.h)
@@ -96,6 +96,10 @@
obj/include/bits/alltypes.h: $(srcdir)/arch/$(ARCH)/bits/alltypes.h.in $(srcdir)/include/alltypes.h.in $(srcdir)/tools/mkalltypes.sed
sed -f $(srcdir)/tools/mkalltypes.sed $(srcdir)/arch/$(ARCH)/bits/alltypes.h.in $(srcdir)/include/alltypes.h.in > $@
+obj/include/bits/syscall.h: $(srcdir)/arch/$(ARCH)/bits/syscall.h.in
+ cp $< $@
+ sed -n -e s/__NR_/SYS_/p < $< >> $@
+
obj/src/internal/version.h: $(wildcard $(srcdir)/VERSION $(srcdir)/.git)
printf '#define VERSION "%s"\n' "$$(cd $(srcdir); sh tools/version.sh)" > $@