From ea5758900d7cf28df4e1592566a6d1d18c35bce3 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Thu, 21 Aug 2003 20:08:38 +0000 Subject: [PATCH] Separate system call generation out from the Makefile so kernel and module builds do not accidently try to regenerate the syscalls if the timestamps do not happen to be exactly as expected. Problem-noticed-by: qhwt@myrealbox.com --- sys/emulation/ibcs2/i386/Makefile | 26 ++--------- sys/emulation/ibcs2/i386/Makefile.misc | 35 +++++++++++++++ sys/emulation/linux/i386/Makefile | 12 ++---- sys/emulation/linux/i386/Makefile.misc | 18 ++++++++ sys/emulation/svr4/Makefile | 24 +++-------- sys/emulation/svr4/Makefile.misc | 19 ++++++++ sys/kern/Makefile | 37 +++++----------- sys/kern/Makefile.misc | 60 ++++++++++++++++++++++++++ 8 files changed, 154 insertions(+), 77 deletions(-) create mode 100644 sys/emulation/ibcs2/i386/Makefile.misc create mode 100644 sys/emulation/linux/i386/Makefile.misc create mode 100644 sys/emulation/svr4/Makefile.misc create mode 100644 sys/kern/Makefile.misc diff --git a/sys/emulation/ibcs2/i386/Makefile b/sys/emulation/ibcs2/i386/Makefile index 1a1045ddc9..f5f34f0351 100644 --- a/sys/emulation/ibcs2/i386/Makefile +++ b/sys/emulation/ibcs2/i386/Makefile @@ -1,30 +1,10 @@ -# Makefile for syscall tables # # $FreeBSD: src/sys/i386/ibcs2/Makefile,v 1.2 1999/08/28 00:43:56 peter Exp $ -# $DragonFly: src/sys/emulation/ibcs2/i386/Attic/Makefile,v 1.5 2003/08/15 06:32:48 dillon Exp $ +# $DragonFly: src/sys/emulation/ibcs2/i386/Attic/Makefile,v 1.6 2003/08/21 20:08:28 dillon Exp $ all: @echo "make sysent only (generates ibcs2_sysent.c, ibcs2_isc_sysent.c and ibcs2_xenix_sysent.c)" -sysent: ibcs2_sysent.c ibcs2_isc_sysent.c ibcs2_xenix_sysent.c +sysent: + cd ${.CURDIR} && ${MAKE} -f Makefile.misc sysent -ibcs2_sysent.c ibcs2_syscall.h ibcs2_proto.h ibcs2_union.h: ../../../kern/makesyscalls.sh \ - syscalls.master syscalls.conf - -mv -f ibcs2_sysent.c ibcs2_sysent.c.bak - -mv -f ibcs2_syscall.h ibcs2_syscall.h.bak - -mv -f ibcs2_proto.h ibcs2_proto.h.bak - -mv -f ibcs2_union.h ibcs2_union.h.bak - sh ../../../kern/makesyscalls.sh syscalls.master syscalls.conf - -ibcs2_isc_sysent.c ibcs2_isc_syscall.h : ../../../kern/makesyscalls.sh \ - syscalls.isc syscalls.isc.conf - -mv -f ibcs2_isc_sysent.c ibcs2_isc_sysent.c.bak - -mv -f ibcs2_isc_syscall.h ibcs2_isc_syscall.h.bak - sh ../../../kern/makesyscalls.sh syscalls.isc syscalls.isc.conf - -ibcs2_xenix_sysent.c ibcs2_xenix_syscall.h ibcs2_xenix.h: \ - ../../../kern/makesyscalls.sh syscalls.xenix syscalls.xenix.conf - -mv -f ibcs2_xenix_sysent.c ibcs2_xenix_sysent.c.bak - -mv -f ibcs2_xenix_syscall.h ibcs2_xenix_syscall.h.bak - -mv -f ibcs2_xenix.h ibcs2_xenix.h.bak - sh ../../../kern/makesyscalls.sh syscalls.xenix syscalls.xenix.conf diff --git a/sys/emulation/ibcs2/i386/Makefile.misc b/sys/emulation/ibcs2/i386/Makefile.misc new file mode 100644 index 0000000000..3fa0ab714a --- /dev/null +++ b/sys/emulation/ibcs2/i386/Makefile.misc @@ -0,0 +1,35 @@ +# Makefile for syscall tables +# +# $DragonFly: src/sys/emulation/ibcs2/i386/Attic/Makefile.misc,v 1.1 2003/08/21 20:08:28 dillon Exp $ + +all: + @echo "make sysent only (generates ibcs2_sysent.c, ibcs2_isc_sysent.c and ibcs2_xenix_sysent.c)" + +sysent: ${.CURDIR}/ibcs2_sysent.c ${.CURDIR}/ibcs2_isc_sysent.c \ + ${.CURDIR}/ibcs2_xenix_sysent.c + +${.CURDIR}/ibcs2_sysent.c ${.CURDIR}/ibcs2_syscall.h \ +${.CURDIR}/ibcs2_proto.h ${.CURDIR}/ibcs2_union.h: \ + ${.CURDIR}/../../../kern/makesyscalls.sh \ + ${.CURDIR}/syscalls.master ${.CURDIR}/syscalls.conf + -mv -f ${.CURDIR}/ibcs2_sysent.c ${.CURDIR}/ibcs2_sysent.c.bak + -mv -f ${.CURDIR}/ibcs2_syscall.h ${.CURDIR}/ibcs2_syscall.h.bak + -mv -f ${.CURDIR}/ibcs2_proto.h ${.CURDIR}/ibcs2_proto.h.bak + -mv -f ${.CURDIR}/ibcs2_union.h ${.CURDIR}/ibcs2_union.h.bak + cd ${.CURDIR} && sh ../../../kern/makesyscalls.sh syscalls.master syscalls.conf + +${.CURDIR}/ibcs2_isc_sysent.c ${.CURDIR}/ibcs2_isc_syscall.h : \ + ${.CURDIR}/../../../kern/makesyscalls.sh \ + ${.CURDIR}/syscalls.isc ${.CURDIR}/syscalls.isc.conf + -mv -f ${.CURDIR}/ibcs2_isc_sysent.c ${.CURDIR}/ibcs2_isc_sysent.c.bak + -mv -f ${.CURDIR}/ibcs2_isc_syscall.h ${.CURDIR}/ibcs2_isc_syscall.h.bak + cd ${.CURDIR} && sh ../../../kern/makesyscalls.sh syscalls.isc syscalls.isc.conf + +${.CURDIR}/ibcs2_xenix_sysent.c ${.CURDIR}/ibcs2_xenix_syscall.h \ +${.CURDIR}/ibcs2_xenix.h: \ + ${.CURDIR}/../../../kern/makesyscalls.sh \ + ${.CURDIR}/syscalls.xenix ${.CURDIR}/syscalls.xenix.conf + -mv -f ${.CURDIR}/ibcs2_xenix_sysent.c ${.CURDIR}/ibcs2_xenix_sysent.c.bak + -mv -f ${.CURDIR}/ibcs2_xenix_syscall.h ${.CURDIR}/ibcs2_xenix_syscall.h.bak + -mv -f ${.CURDIR}/ibcs2_xenix.h ${.CURDIR}/ibcs2_xenix.h.bak + cd ${.CURDIR} && sh ../../../kern/makesyscalls.sh syscalls.xenix syscalls.xenix.conf diff --git a/sys/emulation/linux/i386/Makefile b/sys/emulation/linux/i386/Makefile index aeb05926a3..2b010100ed 100644 --- a/sys/emulation/linux/i386/Makefile +++ b/sys/emulation/linux/i386/Makefile @@ -1,17 +1,11 @@ # Makefile for syscall tables # # $FreeBSD: src/sys/i386/linux/Makefile,v 1.4 1999/08/28 00:45:21 peter Exp $ -# $DragonFly: src/sys/emulation/linux/i386/Makefile,v 1.5 2003/08/15 06:32:54 dillon Exp $ +# $DragonFly: src/sys/emulation/linux/i386/Makefile,v 1.6 2003/08/21 20:08:30 dillon Exp $ all: @echo "make sysent only" -sysent: linux_sysent.c +sysent: + cd ${.CURDIR} && ${MAKE} -f Makefile.misc sysent -linux_sysent.c linux_syscall.h linux_proto.h linux_union.h: ../../../kern/makesyscalls.sh \ - syscalls.master syscalls.conf - -mv -f linux_sysent.c linux_sysent.c.bak - -mv -f linux_syscall.h linux_syscall.h.bak - -mv -f linux_proto.h linux_proto.h.bak - -mv -f linux_union.h linux_union.h.bak - sh ../../../kern/makesyscalls.sh syscalls.master syscalls.conf diff --git a/sys/emulation/linux/i386/Makefile.misc b/sys/emulation/linux/i386/Makefile.misc new file mode 100644 index 0000000000..2a1dd75402 --- /dev/null +++ b/sys/emulation/linux/i386/Makefile.misc @@ -0,0 +1,18 @@ +# Makefile for syscall tables +# +# $DragonFly: src/sys/emulation/linux/i386/Makefile.misc,v 1.1 2003/08/21 20:08:30 dillon Exp $ + +all: + @echo "make sysent only" + +sysent: ${.CURDIR}/linux_sysent.c + +${.CURDIR}/linux_sysent.c ${.CURDIR}/linux_syscall.h \ +${.CURDIR}/linux_proto.h ${.CURDIR}/linux_union.h: \ + ${.CURDIR}/../../../kern/makesyscalls.sh \ + ${.CURDIR}/syscalls.master ${.CURDIR}/syscalls.conf + -mv -f ${.CURDIR}/linux_sysent.c ${.CURDIR}/linux_sysent.c.bak + -mv -f ${.CURDIR}/linux_syscall.h ${.CURDIR}/linux_syscall.h.bak + -mv -f ${.CURDIR}/linux_proto.h ${.CURDIR}/linux_proto.h.bak + -mv -f ${.CURDIR}/linux_union.h ${.CURDIR}/linux_union.h.bak + cd ${.CURDIR} && sh ../../../kern/makesyscalls.sh syscalls.master syscalls.conf diff --git a/sys/emulation/svr4/Makefile b/sys/emulation/svr4/Makefile index d7a51187c2..2ea30450b3 100644 --- a/sys/emulation/svr4/Makefile +++ b/sys/emulation/svr4/Makefile @@ -1,26 +1,11 @@ # Makefile for syscall tables # # $FreeBSD: src/sys/svr4/Makefile,v 1.3 1999/09/01 00:32:18 newton Exp $ -# $DragonFly: src/sys/emulation/svr4/Attic/Makefile,v 1.5 2003/08/15 06:32:56 dillon Exp $ - -MAINTAINER= newton@freebsd.org - -# This regenerates the system calls -# -sysent: ${.CURDIR}/svr4_sysent.c - -${.CURDIR}/svr4_sysent.c ${.CURDIR}/svr4_syscall.h ${.CURDIR}/svr4_proto.h ${.CURDIR}/svr4_union.h: ${.CURDIR}/../../kern/makesyscalls.sh \ - ${.CURDIR}/syscalls.master ${.CURDIR}/syscalls.conf - -mv -f ${.CURDIR}/svr4_sysent.c ${.CURDIR}/svr4_sysent.c.bak - -mv -f ${.CURDIR}/svr4_syscall.h ${.CURDIR}/svr4_syscall.h.bak - -mv -f ${.CURDIR}/svr4_proto.h ${.CURDIR}/svr4_proto.h.bak - -mv -f ${.CURDIR}/svr4_union.h ${.CURDIR}/svr4_union.h.bak - cd ${.CURDIR} && sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf +# $DragonFly: src/sys/emulation/svr4/Attic/Makefile,v 1.6 2003/08/21 20:08:38 dillon Exp $ # This builds the module # -MAINTAINER= newton@FreeBSD.org - +# .PATH: ${.CURDIR}/../../emulation/svr4/${MACHINE_ARCH} ${.CURDIR}/../../emulation/svr4 ARCH= arch_svr4 KMOD= svr4 @@ -35,6 +20,8 @@ MAN= svr4.8 EXPORT_SYMS=_svr4_mod CLEANFILES= svr4_assym.h svr4_genassym.o +.include + svr4_assym.h: svr4_genassym.o .if exists(@) svr4_assym.h: @/kern/genassym.sh @@ -61,4 +48,5 @@ afterinstall: ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ ${.CURDIR}/svr4.sh ${DESTDIR}/usr/sbin/svr4 -.include +sysent: + cd ${.CURDIR} && ${MAKE} -f Makefile.misc sysent diff --git a/sys/emulation/svr4/Makefile.misc b/sys/emulation/svr4/Makefile.misc new file mode 100644 index 0000000000..7640092f37 --- /dev/null +++ b/sys/emulation/svr4/Makefile.misc @@ -0,0 +1,19 @@ +# Makefile for syscall tables +# +# $DragonFly: src/sys/emulation/svr4/Attic/Makefile.misc,v 1.1 2003/08/21 20:08:38 dillon Exp $ + +all: + @echo "make sysent only" + +# This regenerates the system calls +# +sysent: ${.CURDIR}/svr4_sysent.c + +${.CURDIR}/svr4_sysent.c ${.CURDIR}/svr4_syscall.h ${.CURDIR}/svr4_proto.h ${.CURDIR}/svr4_union.h: ${.CURDIR}/../../kern/makesyscalls.sh \ + ${.CURDIR}/syscalls.master ${.CURDIR}/syscalls.conf + -mv -f ${.CURDIR}/svr4_sysent.c ${.CURDIR}/svr4_sysent.c.bak + -mv -f ${.CURDIR}/svr4_syscall.h ${.CURDIR}/svr4_syscall.h.bak + -mv -f ${.CURDIR}/svr4_proto.h ${.CURDIR}/svr4_proto.h.bak + -mv -f ${.CURDIR}/svr4_union.h ${.CURDIR}/svr4_union.h.bak + cd ${.CURDIR} && sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf + diff --git a/sys/kern/Makefile b/sys/kern/Makefile index dc548ea169..8af3d3dbfb 100644 --- a/sys/kern/Makefile +++ b/sys/kern/Makefile @@ -1,25 +1,12 @@ # @(#)Makefile 8.2 (Berkeley) 3/21/94 # $FreeBSD: src/sys/kern/Makefile,v 1.6.2.1 2003/02/10 12:21:08 des Exp $ -# $DragonFly: src/sys/kern/Makefile,v 1.7 2003/08/16 02:52:00 dillon Exp $ +# $DragonFly: src/sys/kern/Makefile,v 1.8 2003/08/21 20:08:26 dillon Exp $ # Makefile for kernel tags files, init_sysent, etc. TAGARCH= i386 # luna68k news3400 pmax sparc tahoe vax SUBDIR= libmchain -sysent: init_sysent.c - -init_sysent.c syscalls.c ../sys/syscall.h ../sys/syscall-hide.h \ -../sys/syscall.mk ../sys/sysproto.h ../sys/sysunion.h: makesyscalls.sh syscalls.master - -mv -f init_sysent.c init_sysent.c.bak - -mv -f syscalls.c syscalls.c.bak - -mv -f ../sys/syscall.h ../sys/syscall.h.bak - -mv -f ../sys/syscall-hide.h ../sys/syscall-hide.h.bak - -mv -f ../sys/syscall.mk ../sys/syscall.mk.bak - -mv -f ../sys/sysproto.h ../sys/sysproto.h.bak - -mv -f ../sys/sysunion.h ../sys/sysunion.h.bak - sh makesyscalls.sh syscalls.master - # Kernel tags: # Tags files are built in the top-level directory for each architecture, # with a makefile listing the architecture-dependent files, etc. The list @@ -44,18 +31,14 @@ DGEN= conf \ net netinet netns sys \ vm -# XXX interferes with bsd.subdir.mk -#tags:: -# -for i in ${TAGARCH}; do \ -# (cd ../$$i && make ${MFLAGS} tags); done -# -#links:: -# rm -f ${SYSTAGS} -# -ln -s ${SYSDIR}/${MACHINE_ARCH}/tags ${SYSTAGS} -# -for i in ${DGEN}; do \ -# (cd ../$$i && { rm -f tags; ln -s ${SYSTAGS} tags; }) done -# -for i in ${TAGARCH}; do \ -# (cd ../$$i && make ${MFLAGS} SYSTAGS=${SYSTAGS} links); done - .include +sysent: + cd ${.CURDIR} && ${MAKE} -f Makefile.misc sysent + +do_tags: + cd ${.CURDIR} && ${MAKE} -f Makefile.misc tags + +do_links: + cd ${.CURDIR} && ${MAKE} -f Makefile.misc links + diff --git a/sys/kern/Makefile.misc b/sys/kern/Makefile.misc new file mode 100644 index 0000000000..dcad3a689c --- /dev/null +++ b/sys/kern/Makefile.misc @@ -0,0 +1,60 @@ +# $DragonFly: src/sys/kern/Makefile.misc,v 1.1 2003/08/21 20:08:26 dillon Exp $ +# +# Makefile for kernel tags files, init_sysent, etc. + +TAGARCH= i386 # luna68k news3400 pmax sparc tahoe vax + +all: + @echo "make sysent, tags, or links target only" + +sysent: ${.CURDIR}/init_sysent.c + +${.CURDIR}/init_sysent.c ${.CURDIR}/syscalls.c \ +${.CURDIR}/../sys/syscall.h ${.CURDIR}/../sys/syscall-hide.h \ +${.CURDIR}/../sys/syscall.mk ${.CURDIR}/../sys/sysproto.h \ +${.CURDIR}/../sys/sysunion.h: ${.CURDIR}/makesyscalls.sh ${.CURDIR}/syscalls.master + -mv -f ${.CURDIR}/init_sysent.c ${.CURDIR}/init_sysent.c.bak + -mv -f ${.CURDIR}/syscalls.c ${.CURDIR}/syscalls.c.bak + -mv -f ${.CURDIR}/../sys/syscall.h ${.CURDIR}/../sys/syscall.h.bak + -mv -f ${.CURDIR}/../sys/syscall-hide.h ${.CURDIR}/../sys/syscall-hide.h.bak + -mv -f ${.CURDIR}/../sys/syscall.mk ${.CURDIR}/../sys/syscall.mk.bak + -mv -f ${.CURDIR}/../sys/sysproto.h ${.CURDIR}/../sys/sysproto.h.bak + -mv -f ${.CURDIR}/../sys/sysunion.h ${.CURDIR}/../sys/sysunion.h.bak + cd ${.CURDIR} && sh makesyscalls.sh syscalls.master + +# Kernel tags: +# Tags files are built in the top-level directory for each architecture, +# with a makefile listing the architecture-dependent files, etc. The list +# of common files is in ./Make.tags.inc. Links to the correct tags file +# are placed in each source directory. We need to have links to tags files +# from the generic directories that are relative to the machine type, even +# via remote mounts; therefore we use symlinks to $SYSTAGS, which points at +# ${SYSDIR}/${MACHINE_ARCH}/tags. + +SYSTAGS=/var/db/sys_tags +SYSDIR=${.CURDIR:H} +MFLAGS=SYS=${SYSDIR} + +# Directories in which to place tags links (other than machine-dependent) +DGEN= conf \ + dev \ + kern libkern \ + vfs vfs/deadfs vfs/fdesc vfs/fifofs \ + vfs/nullfs vfs/portal vfs/procfs \ + vfs/specfs vfs/umapfs vfs/union \ + vfs/ufs vfs/mfs vfs/nfs \ + net netinet netns sys \ + vm + +#tags:: +# -cd ${.CURDIR} && for i in ${TAGARCH}; do \ +# (cd ../$$i && make ${MFLAGS} tags); done +# +#links:: +# rm -f ${.CURDIR}/${SYSTAGS} +# -ln -s ${SYSDIR}/${MACHINE_ARCH}/tags ${.CURDIR}/${SYSTAGS} +# -cd ${.CURDIR} && for i in ${DGEN}; do \ +# (cd ../$$i && { rm -f tags; ln -s ${SYSTAGS} tags; }) done +# -cd ${.CURDIR} && for i in ${TAGARCH}; do \ +# (cd ../$$i && make ${MFLAGS} SYSTAGS=${SYSTAGS} links); done + -- 2.39.1