sysent.mk 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # Don't use an OBJDIR
  2. .OBJDIR: ${.CURDIR}
  3. .include <bsd.sysdir.mk>
  4. .include <src.lua.mk>
  5. COMMON_GENERATED= proto.h \
  6. syscall.h \
  7. syscalls.c \
  8. sysent.c \
  9. systrace_args.c
  10. GENERATED_PREFIX?=
  11. GENERATED?= ${COMMON_GENERATED:S/^/${GENERATED_PREFIX}/}
  12. SYSENT_FILE?= syscalls.master
  13. SYSENT_CONF?= syscalls.conf
  14. # Including Makefile should override SYSENT_FILE and SYSENT_CONF as needed,
  15. # and set GENERATED.
  16. SRCS+= ${SYSENT_FILE}
  17. SRCS+= ${SYSENT_CONF}
  18. # Ensure that the target gets updated if the capabilities file is modified,
  19. # even though it is not an explicit input to makesyscalls.lua. For some
  20. # targets, like Linux system calls, this is unnecessary, but a spurious rebuild
  21. # is both rare and harmless.
  22. SRCS+= ${CAPABILITIES_CONF}
  23. MAKESYSCALLS_INTERP?= ${LUA}
  24. MAKESYSCALLS_SCRIPT?= ${SYSDIR}/tools/makesyscalls.lua
  25. MAKESYSCALLS= ${MAKESYSCALLS_INTERP} ${MAKESYSCALLS_SCRIPT}
  26. all:
  27. @echo "make sysent only"
  28. # We .ORDER these explicitly so that we only run MAKESYSCALLS once, rather than
  29. # potentially once for each ${GENERATED} file.
  30. .ORDER: ${GENERATED}
  31. sysent: ${GENERATED}
  32. # We slap a .PHONY on makesyscalls.lua so that we regenerate every single time,
  33. # for now, which can be less painful across rebases or other things that may
  34. # have odd effects on mtimes.
  35. ${MAKESYSCALLS_SCRIPT}: .PHONY
  36. ${GENERATED}: ${MAKESYSCALLS_SCRIPT} ${SRCS}
  37. ${MAKESYSCALLS} ${SYSENT_FILE} ${SYSENT_CONF}