xref: /freebsd/sys/conf/sysent.mk (revision b64c5a0ace59af62eff52bfe110a521dc73c937b)
1
2# Don't use an OBJDIR
3.OBJDIR: ${.CURDIR}
4
5.include <bsd.sysdir.mk>
6.include <src.lua.mk>
7
8COMMON_GENERATED=	proto.h		\
9			syscall.h	\
10			syscalls.c	\
11			sysent.c	\
12			systrace_args.c
13
14GENERATED_PREFIX?=
15GENERATED?=	${COMMON_GENERATED:S/^/${GENERATED_PREFIX}/}
16SYSENT_FILE?=	syscalls.master
17SYSENT_CONF?=	syscalls.conf
18
19# Including Makefile should override SYSENT_FILE and SYSENT_CONF as needed,
20# and set GENERATED.
21SRCS+=	${SYSENT_FILE}
22SRCS+=	${SYSENT_CONF}
23
24MAKESYSCALLS_INTERP?=	${LUA}
25MAKESYSCALLS_SCRIPT?=	${SYSDIR}/tools/syscalls/main.lua
26MAKESYSCALLS=	${MAKESYSCALLS_INTERP} ${MAKESYSCALLS_SCRIPT}
27
28all:
29	@echo "make sysent only"
30
31# We .ORDER these explicitly so that we only run MAKESYSCALLS once, rather than
32# potentially once for each ${GENERATED} file.
33.ORDER: ${GENERATED}
34sysent: ${GENERATED}
35
36# We slap a .PHONY on MAKESYSCALLS_SCRIPT so that we regenerate every
37# single time rather than tracking all internal dependencies for now.
38${MAKESYSCALLS_SCRIPT}: .PHONY
39
40${GENERATED}: ${MAKESYSCALLS_SCRIPT} ${SRCS}
41	${MAKESYSCALLS} ${SYSENT_FILE} ${SYSENT_CONF}
42