From owner-svn-src-head@freebsd.org Sat Jan 18 20:37:47 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DBFF8226028; Sat, 18 Jan 2020 20:37:47 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 480V9l5TX6z4Psx; Sat, 18 Jan 2020 20:37:47 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7393279DF; Sat, 18 Jan 2020 20:37:47 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00IKbldc066357; Sat, 18 Jan 2020 20:37:47 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00IKbjqs066347; Sat, 18 Jan 2020 20:37:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001182037.00IKbjqs066347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 18 Jan 2020 20:37:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356868 - in head/sys: amd64/linux amd64/linux32 arm/linux arm64/linux compat/cloudabi32 compat/cloudabi64 compat/freebsd32 conf i386/linux kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 arm/linux arm64/linux compat/cloudabi32 compat/cloudabi64 compat/freebsd32 conf i386/linux kern X-SVN-Commit-Revision: 356868 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jan 2020 20:37:47 -0000 Author: kevans Date: Sat Jan 18 20:37:45 2020 New Revision: 356868 URL: https://svnweb.freebsd.org/changeset/base/356868 Log: sysent targets: further cleanup and deduplication r355473 vastly improved the readability and cleanliness of these Makefiles. Every single one of them follows the same pattern and duplicates the exact same logic. Now that we have GENERATED/SRCS, split SRCS up into the two parameters we'll use for ${MAKESYSCALLS} rather than assuming a specific ordering of SRCS and include a common sysent.mk to handle the rest. This makes it less tedious to make sweeping changes. Some default values are provided for GENERATED/SYSENT_*; almost all of these just use a 'syscalls.master' and 'syscalls.conf' in cwd, and they all use effectively the same filenames with an arbitrary prefix. Most ABIs will be able to get away with just setting GENERATED_PREFIX and including ^/sys/conf/sysent.mk, while others only need light additions. kern/Makefile is the notable exception, as it doesn't take a SYSENT_CONF and the generated files are spread out between ^/sys/kern and ^/sys/sys, but it otherwise fits the pattern enough to use the common version. Reviewed by: brooks, imp Nice!: emaste Differential Revision: https://reviews.freebsd.org/D23197 Added: head/sys/conf/sysent.mk - copied, changed from r356867, head/sys/kern/Makefile Modified: head/sys/amd64/linux/Makefile head/sys/amd64/linux32/Makefile head/sys/arm/linux/Makefile head/sys/arm64/linux/Makefile head/sys/compat/cloudabi32/Makefile head/sys/compat/cloudabi64/Makefile head/sys/compat/freebsd32/Makefile head/sys/i386/linux/Makefile head/sys/kern/Makefile Modified: head/sys/amd64/linux/Makefile ============================================================================== --- head/sys/amd64/linux/Makefile Sat Jan 18 20:19:07 2020 (r356867) +++ head/sys/amd64/linux/Makefile Sat Jan 18 20:37:45 2020 (r356868) @@ -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" Modified: head/sys/amd64/linux32/Makefile ============================================================================== --- head/sys/amd64/linux32/Makefile Sat Jan 18 20:19:07 2020 (r356867) +++ head/sys/amd64/linux32/Makefile Sat Jan 18 20:37:45 2020 (r356868) @@ -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" Modified: head/sys/arm/linux/Makefile ============================================================================== --- head/sys/arm/linux/Makefile Sat Jan 18 20:19:07 2020 (r356867) +++ head/sys/arm/linux/Makefile Sat Jan 18 20:37:45 2020 (r356868) @@ -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" Modified: head/sys/arm64/linux/Makefile ============================================================================== --- head/sys/arm64/linux/Makefile Sat Jan 18 20:19:07 2020 (r356867) +++ head/sys/arm64/linux/Makefile Sat Jan 18 20:37:45 2020 (r356868) @@ -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" Modified: head/sys/compat/cloudabi32/Makefile ============================================================================== --- head/sys/compat/cloudabi32/Makefile Sat Jan 18 20:19:07 2020 (r356867) +++ head/sys/compat/cloudabi32/Makefile Sat Jan 18 20:37:45 2020 (r356868) @@ -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" Modified: head/sys/compat/cloudabi64/Makefile ============================================================================== --- head/sys/compat/cloudabi64/Makefile Sat Jan 18 20:19:07 2020 (r356867) +++ head/sys/compat/cloudabi64/Makefile Sat Jan 18 20:37:45 2020 (r356868) @@ -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" Modified: head/sys/compat/freebsd32/Makefile ============================================================================== --- head/sys/compat/freebsd32/Makefile Sat Jan 18 20:19:07 2020 (r356867) +++ head/sys/compat/freebsd32/Makefile Sat Jan 18 20:37:45 2020 (r356868) @@ -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" Copied and modified: head/sys/conf/sysent.mk (from r356867, head/sys/kern/Makefile) ============================================================================== --- head/sys/kern/Makefile Sat Jan 18 20:19:07 2020 (r356867, copy source) +++ head/sys/conf/sysent.mk Sat Jan 18 20:37:45 2020 (r356868) @@ -1,23 +1,28 @@ -# @(#)Makefile 8.2 (Berkeley) 3/21/94 # $FreeBSD$ -# -# Makefile for init_sysent # Don't use an OBJDIR .OBJDIR: ${.CURDIR} +.include .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 +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" @@ -27,4 +32,4 @@ all: sysent: ${GENERATED} ${GENERATED}: ${MAKESYSCALLS} ${SRCS} - ${LUA} ${MAKESYSCALLS} syscalls.master + ${LUA} ${MAKESYSCALLS} ${SYSENT_FILE} ${SYSENT_CONF} Modified: head/sys/i386/linux/Makefile ============================================================================== --- head/sys/i386/linux/Makefile Sat Jan 18 20:19:07 2020 (r356867) +++ head/sys/i386/linux/Makefile Sat Jan 18 20:37:45 2020 (r356868) @@ -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" Modified: head/sys/kern/Makefile ============================================================================== --- head/sys/kern/Makefile Sat Jan 18 20:19:07 2020 (r356867) +++ head/sys/kern/Makefile Sat Jan 18 20:37:45 2020 (r356868) @@ -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"