sysent: Reduce duplication and improve readability.

Use the power of variable to avoid spelling out source and generated
files too many times.  The previous Makefiles were hard to read, hard to
edit, and badly formatted.

Reviewed by:	kevans, emaste
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D22714
This commit is contained in:
brooks 2019-12-06 23:59:23 +00:00
parent 78b6026f7a
commit dfa2e15cbe
8 changed files with 99 additions and 46 deletions

View File

@ -7,11 +7,19 @@
.include <src.lua.mk>
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"
sysent: linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c
sysent: ${GENERATED}
linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c: \
../../tools/makesyscalls.lua syscalls.master ${.CURDIR}/syscalls.conf
${LUA} ../../tools/makesyscalls.lua syscalls.master ${.CURDIR}/syscalls.conf
${GENERATED}: ${MAKESYSCALLS} ${SRCS}
${LUA} ${MAKESYSCALLS} syscalls.master syscalls.conf

View File

@ -7,11 +7,19 @@
.include <src.lua.mk>
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"
sysent: linux32_sysent.c linux32_syscall.h linux32_proto.h linux32_syscalls.c linux32_systrace_args.c
sysent: ${GENERATED}
linux32_sysent.c linux32_syscall.h linux32_proto.h linux32_syscalls.c linux32_systrace_args.c: ../../tools/makesyscalls.lua \
syscalls.master ${.CURDIR}/syscalls.conf
${LUA} ../../tools/makesyscalls.lua syscalls.master ${.CURDIR}/syscalls.conf
${GENERATED}: ${MAKESYSCALLS} ${SRCS}
${LUA} ${MAKESYSCALLS} syscalls.master syscalls.conf

View File

@ -7,11 +7,19 @@
.include <src.lua.mk>
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"
sysent: linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c
sysent: ${GENERATED}
linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c: \
../../tools/makesyscalls.lua syscalls.master ${.CURDIR}/syscalls.conf
${LUA} ../../tools/makesyscalls.lua syscalls.master ${.CURDIR}/syscalls.conf
${GENERATED}: ${MAKESYSCALLS} ${SRCS}
${LUA} ${MAKESYSCALLS} syscalls.master syscalls.conf

View File

@ -5,15 +5,20 @@
.include <src.lua.mk>
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"
sysent: cloudabi32_sysent.c cloudabi32_syscall.h cloudabi32_proto.h \
cloudabi32_syscalls.c cloudabi32_systrace_args.c
sysent: ${GENERATED}
cloudabi32_sysent.c cloudabi32_syscall.h cloudabi32_proto.h \
cloudabi32_syscalls.c cloudabi32_systrace_args.c: \
../../tools/makesyscalls.lua ../../contrib/cloudabi/syscalls32.master \
${.CURDIR}/syscalls.conf
${LUA} ../../tools/makesyscalls.lua \
../../contrib/cloudabi/syscalls32.master ${.CURDIR}/syscalls.conf
${GENERATED}: ${MAKESYSCALLS} ${SRCS}
${LUA} ${MAKESYSCALLS} \
../../contrib/cloudabi/syscalls32.master syscalls.conf

View File

@ -5,15 +5,20 @@
# 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"
sysent: cloudabi64_sysent.c cloudabi64_syscall.h cloudabi64_proto.h \
cloudabi64_syscalls.c cloudabi64_systrace_args.c
sysent: ${GENERATED}
cloudabi64_sysent.c cloudabi64_syscall.h cloudabi64_proto.h \
cloudabi64_syscalls.c cloudabi64_systrace_args.c: \
../../tools/makesyscalls.lua ../../contrib/cloudabi/syscalls64.master \
${.CURDIR}/syscalls.conf
${LUA} ../../tools/makesyscalls.lua \
../../contrib/cloudabi/syscalls64.master ${.CURDIR}/syscalls.conf
${GENERATED}: ${MAKESYSCALLS} ${SRCS}
${LUA} ${MAKESYSCALLS} \
../../contrib/cloudabi/syscalls64.master syscalls.conf

View File

@ -7,15 +7,20 @@
.include <src.lua.mk>
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"
sysent: freebsd32_sysent.c freebsd32_syscall.h freebsd32_proto.h freebsd32_systrace_args.c
sysent: ${GENERATED}
freebsd32_sysent.c freebsd32_syscalls.c freebsd32_syscall.h freebsd32_proto.h freebsd32_systrace_args.c : \
../../tools/makesyscalls.lua syscalls.master ${.CURDIR}/syscalls.conf ../../kern/capabilities.conf
${LUA} ../../tools/makesyscalls.lua syscalls.master ${.CURDIR}/syscalls.conf
clean:
rm -f freebsd32_sysent.c freebsd32_syscalls.c freebsd32_syscall.h freebsd32_proto.h
rm -f freebsd32_systrace_args.c
${GENERATED}: ${MAKESYSCALLS} ${SRCS}
${LUA} ${MAKESYSCALLS} syscalls.master syscalls.conf

View File

@ -7,11 +7,19 @@
.include <src.lua.mk>
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"
sysent: linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c
sysent: ${GENERATED}
linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c: \
../../tools/makesyscalls.lua syscalls.master ${.CURDIR}/syscalls.conf
${LUA} ../../tools/makesyscalls.lua syscalls.master ${.CURDIR}/syscalls.conf
${GENERATED}: ${MAKESYSCALLS} ${SRCS}
${LUA} ${MAKESYSCALLS} syscalls.master syscalls.conf

View File

@ -8,13 +8,19 @@
.include <src.lua.mk>
MAKESYSCALLS= ../tools/makesyscalls.lua
SRCS= capabilities.conf \
syscalls.master
GENERATED= init_sysent.c \
syscalls.c \
../sys/syscall.h \
../sys/syscall.mk \
../sys/sysproto.h
all:
@echo "make sysent only"
sysent: init_sysent.c syscalls.c ../sys/syscall.h ../sys/syscall.mk \
../sys/sysproto.h
sysent: ${GENERATED}
init_sysent.c syscalls.c systrace_args.c ../sys/syscall.h \
../sys/syscall.mk ../sys/sysproto.h: ../tools/makesyscalls.lua syscalls.master \
capabilities.conf
${LUA} ../tools/makesyscalls.lua syscalls.master
${GENERATED}: ${MAKESYSCALLS} ${SRCS}
${LUA} ${MAKESYSCALLS} syscalls.master