Index: head/sys/amd64/linux/Makefile =================================================================== --- head/sys/amd64/linux/Makefile +++ head/sys/amd64/linux/Makefile @@ -2,27 +2,6 @@ # # $FreeBSD$ -# Don't use an OBJDIR -.OBJDIR: ${.CURDIR} +GENERATED_PREFIX= linux_ -.include - -MAKESYSCALLS= ../../tools/makesyscalls.lua -SRCS= syscalls.conf \ - syscalls.master -GENERATED= linux_proto.h \ - linux_syscall.h \ - linux_syscalls.c \ - linux_sysent.c \ - linux_systrace_args.c - -all: - @echo "make sysent only" - -# We .ORDER these explicitly so that we only run MAKESYSCALLS once, rather than -# potentially once for each ${GENERATED} file. -.ORDER: ${GENERATED} -sysent: ${GENERATED} - -${GENERATED}: ${MAKESYSCALLS} ${SRCS} - ${LUA} ${MAKESYSCALLS} syscalls.master syscalls.conf +.include "../../conf/sysent.mk" Index: head/sys/amd64/linux32/Makefile =================================================================== --- head/sys/amd64/linux32/Makefile +++ head/sys/amd64/linux32/Makefile @@ -2,27 +2,6 @@ # # $FreeBSD$ -# Don't use an OBJDIR -.OBJDIR: ${.CURDIR} +GENERATED_PREFIX= linux32_ -.include - -MAKESYSCALLS= ../../tools/makesyscalls.lua -SRCS= syscalls.conf \ - syscalls.master -GENERATED= linux32_proto.h \ - linux32_syscall.h \ - linux32_syscalls.c \ - linux32_sysent.c \ - linux32_systrace_args.c - -all: - @echo "make sysent only" - -# We .ORDER these explicitly so that we only run MAKESYSCALLS once, rather than -# potentially once for each ${GENERATED} file. -.ORDER: ${GENERATED} -sysent: ${GENERATED} - -${GENERATED}: ${MAKESYSCALLS} ${SRCS} - ${LUA} ${MAKESYSCALLS} syscalls.master syscalls.conf +.include "../../conf/sysent.mk" Index: head/sys/arm/linux/Makefile =================================================================== --- head/sys/arm/linux/Makefile +++ head/sys/arm/linux/Makefile @@ -2,27 +2,6 @@ # # $FreeBSD$ -# Don't use an OBJDIR -.OBJDIR: ${.CURDIR} +GENERATED_PREFIX= linux_ -.include - -MAKESYSCALLS= ../../tools/makesyscalls.lua -SRCS= syscalls.conf \ - syscalls.master -GENERATED= linux_proto.h \ - linux_syscall.h \ - linux_syscalls.c \ - linux_sysent.c \ - linux_systrace_args.c - -all: - @echo "make sysent only" - -# We .ORDER these explicitly so that we only run MAKESYSCALLS once, rather than -# potentially once for each ${GENERATED} file. -.ORDER: ${GENERATED} -sysent: ${GENERATED} - -${GENERATED}: ${MAKESYSCALLS} ${SRCS} - ${LUA} ${MAKESYSCALLS} syscalls.master syscalls.conf +.include "../../conf/sysent.mk" Index: head/sys/arm64/linux/Makefile =================================================================== --- head/sys/arm64/linux/Makefile +++ head/sys/arm64/linux/Makefile @@ -2,27 +2,6 @@ # # $FreeBSD$ -# Don't use an OBJDIR -.OBJDIR: ${.CURDIR} +GENERATED_PREFIX= linux_ -.include - -MAKESYSCALLS= ../../tools/makesyscalls.lua -SRCS= syscalls.conf \ - syscalls.master -GENERATED= linux_proto.h \ - linux_syscall.h \ - linux_syscalls.c \ - linux_sysent.c \ - linux_systrace_args.c - -all: - @echo "make sysent only" - -# We .ORDER these explicitly so that we only run MAKESYSCALLS once, rather than -# potentially once for each ${GENERATED} file. -.ORDER: ${GENERATED} -sysent: ${GENERATED} - -${GENERATED}: ${MAKESYSCALLS} ${SRCS} - ${LUA} ${MAKESYSCALLS} syscalls.master syscalls.conf +.include "../../conf/sysent.mk" Index: head/sys/compat/cloudabi32/Makefile =================================================================== --- head/sys/compat/cloudabi32/Makefile +++ head/sys/compat/cloudabi32/Makefile @@ -1,27 +1,6 @@ # $FreeBSD$ -# Don't use an OBJDIR -.OBJDIR: ${.CURDIR} +SYSENT_FILE= ${SYSDIR}/contrib/cloudabi/syscalls32.master +GENERATED_PREFIX= cloudabi32_ -.include - -MAKESYSCALLS= ../../tools/makesyscalls.lua -SRCS= syscalls.conf \ - ../../contrib/cloudabi/syscalls32.master -GENERATED= cloudabi32_proto.h \ - cloudabi32_syscall.h \ - cloudabi32_syscalls.c \ - cloudabi32_sysent.c \ - cloudabi32_systrace_args.c - -all: - @echo "make sysent only" - -# We .ORDER these explicitly so that we only run MAKESYSCALLS once, rather than -# potentially once for each ${GENERATED} file. -.ORDER: ${GENERATED} -sysent: ${GENERATED} - -${GENERATED}: ${MAKESYSCALLS} ${SRCS} - ${LUA} ${MAKESYSCALLS} \ - ../../contrib/cloudabi/syscalls32.master syscalls.conf +.include "../../conf/sysent.mk" Index: head/sys/compat/cloudabi64/Makefile =================================================================== --- head/sys/compat/cloudabi64/Makefile +++ head/sys/compat/cloudabi64/Makefile @@ -1,27 +1,6 @@ # $FreeBSD$ -.include +SYSENT_FILE= ${SYSDIR}/contrib/cloudabi/syscalls64.master +GENERATED_PREFIX= cloudabi64_ -# Don't use an OBJDIR -.OBJDIR: ${.CURDIR} - -MAKESYSCALLS= ../../tools/makesyscalls.lua -SRCS= syscalls.conf \ - ../../contrib/cloudabi/syscalls64.master -GENERATED= cloudabi64_proto.h \ - cloudabi64_syscall.h \ - cloudabi64_syscalls.c \ - cloudabi64_sysent.c \ - cloudabi64_systrace_args.c - -all: - @echo "make sysent only" - -# We .ORDER these explicitly so that we only run MAKESYSCALLS once, rather than -# potentially once for each ${GENERATED} file. -.ORDER: ${GENERATED} -sysent: ${GENERATED} - -${GENERATED}: ${MAKESYSCALLS} ${SRCS} - ${LUA} ${MAKESYSCALLS} \ - ../../contrib/cloudabi/syscalls64.master syscalls.conf +.include "../../conf/sysent.mk" Index: head/sys/compat/freebsd32/Makefile =================================================================== --- head/sys/compat/freebsd32/Makefile +++ head/sys/compat/freebsd32/Makefile @@ -2,28 +2,6 @@ # # $FreeBSD$ -# Don't use an OBJDIR -.OBJDIR: ${.CURDIR} +GENERATED_PREFIX= freebsd32_ -.include - -MAKESYSCALLS= ../../tools/makesyscalls.lua -SRCS= ../../kern/capabilities.conf \ - syscalls.conf \ - syscalls.master -GENERATED= freebsd32_proto.h \ - freebsd32_syscall.h \ - freebsd32_syscalls.c \ - freebsd32_sysent.c \ - freebsd32_systrace_args.c - -all: - @echo "make sysent only" - -# We .ORDER these explicitly so that we only run MAKESYSCALLS once, rather than -# potentially once for each ${GENERATED} file. -.ORDER: ${GENERATED} -sysent: ${GENERATED} - -${GENERATED}: ${MAKESYSCALLS} ${SRCS} - ${LUA} ${MAKESYSCALLS} syscalls.master syscalls.conf +.include "../../conf/sysent.mk" Index: head/sys/conf/sysent.mk =================================================================== --- head/sys/conf/sysent.mk +++ head/sys/conf/sysent.mk @@ -0,0 +1,35 @@ +# $FreeBSD$ + +# Don't use an OBJDIR +.OBJDIR: ${.CURDIR} + +.include +.include + +COMMON_GENERATED= proto.h \ + syscall.h \ + syscalls.c \ + sysent.c \ + systrace_args.c + +GENERATED_PREFIX?= +GENERATED?= ${COMMON_GENERATED:S/^/${GENERATED_PREFIX}/} +SYSENT_FILE?= syscalls.master +SYSENT_CONF?= syscalls.conf + +# Including Makefile should override SYSENT_FILE and SYSENT_CONF as needed, +# and set GENERATED. +SRCS+= ${SYSENT_FILE} +SRCS+= ${SYSENT_CONF} +MAKESYSCALLS= ${SYSDIR}/tools/makesyscalls.lua + +all: + @echo "make sysent only" + +# We .ORDER these explicitly so that we only run MAKESYSCALLS once, rather than +# potentially once for each ${GENERATED} file. +.ORDER: ${GENERATED} +sysent: ${GENERATED} + +${GENERATED}: ${MAKESYSCALLS} ${SRCS} + ${LUA} ${MAKESYSCALLS} ${SYSENT_FILE} ${SYSENT_CONF} Index: head/sys/i386/linux/Makefile =================================================================== --- head/sys/i386/linux/Makefile +++ head/sys/i386/linux/Makefile @@ -2,27 +2,6 @@ # # $FreeBSD$ -# Don't use an OBJDIR -.OBJDIR: ${.CURDIR} +GENERATED_PREFIX= linux_ -.include - -MAKESYSCALLS= ../../tools/makesyscalls.lua -SRCS= syscalls.conf \ - syscalls.master -GENERATED= linux_proto.h \ - linux_syscall.h \ - linux_syscalls.c \ - linux_sysent.c \ - linux_systrace_args.c - -all: - @echo "make sysent only" - -# We .ORDER these explicitly so that we only run MAKESYSCALLS once, rather than -# potentially once for each ${GENERATED} file. -.ORDER: ${GENERATED} -sysent: ${GENERATED} - -${GENERATED}: ${MAKESYSCALLS} ${SRCS} - ${LUA} ${MAKESYSCALLS} syscalls.master syscalls.conf +.include "../../conf/sysent.mk" Index: head/sys/kern/Makefile =================================================================== --- head/sys/kern/Makefile +++ head/sys/kern/Makefile @@ -3,28 +3,12 @@ # # Makefile for init_sysent -# Don't use an OBJDIR -.OBJDIR: ${.CURDIR} +SYSENT_CONF= +GENERATED= init_sysent.c \ + syscalls.c \ + systrace_args.c \ + ${SYSDIR}/sys/syscall.h \ + ${SYSDIR}/sys/syscall.mk \ + ${SYSDIR}/sys/sysproto.h -.include - -MAKESYSCALLS= ../tools/makesyscalls.lua -SRCS= capabilities.conf \ - syscalls.master -GENERATED= init_sysent.c \ - syscalls.c \ - systrace_args.c \ - ../sys/syscall.h \ - ../sys/syscall.mk \ - ../sys/sysproto.h - -all: - @echo "make sysent only" - -# We .ORDER these explicitly so that we only run MAKESYSCALLS once, rather than -# potentially once for each ${GENERATED} file. -.ORDER: ${GENERATED} -sysent: ${GENERATED} - -${GENERATED}: ${MAKESYSCALLS} ${SRCS} - ${LUA} ${MAKESYSCALLS} syscalls.master +.include "../conf/sysent.mk"