Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch centralize vers.c building for standalone programs.



details:   https://anonhg.NetBSD.org/src/rev/95fc515365ff
branches:  trunk
changeset: 822824:95fc515365ff
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Apr 08 19:53:19 2017 +0000

description:
centralize vers.c building for standalone programs.

diffstat:

 sys/arch/acorn26/stand/Makefile.buildboot          |  10 ++-----
 sys/arch/acorn32/stand/Makefile.buildboot          |  13 ++--------
 sys/arch/alpha/stand/Makefile.bootprogs            |  13 +--------
 sys/arch/amiga/stand/bootblock/boot/Makefile       |  23 ++++++++----------
 sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile |  27 ++++++++++-----------
 sys/arch/arc/stand/boot/Makefile                   |  16 ++----------
 sys/arch/bebox/stand/boot/Makefile                 |  12 ++++-----
 sys/arch/cobalt/stand/boot/Makefile                |  10 +------
 sys/arch/emips/stand/Makefile.booters              |  10 ++-----
 sys/arch/epoc32/stand/e32boot/exe/Makefile         |  13 +++-------
 sys/arch/evbarm/stand/boot2440/Makefile            |  14 ++++------
 sys/arch/evbarm/stand/gzboot/Makefile.gzboot       |  12 ++-------
 sys/arch/ews4800mips/stand/boot/Makefile           |  10 +------
 sys/arch/hp300/stand/Makefile.buildboot            |  14 +++--------
 sys/arch/hpcmips/stand/lcboot/Makefile             |  17 ++-----------
 sys/arch/hppa/stand/Makefile.buildboot             |   9 +-----
 sys/arch/i386/stand/Makefile.booters               |   9 +++----
 sys/arch/i386/stand/boot/Makefile.boot             |  12 +++------
 sys/arch/i386/stand/efiboot/Makefile.efiboot       |  12 ++-------
 sys/arch/ia64/stand/ia64/efi/Makefile              |  14 ++++-------
 sys/arch/ia64/stand/ia64/ski/Makefile              |  12 +++------
 sys/arch/landisk/stand/boot/Makefile.boot          |  13 +++-------
 sys/arch/luna68k/stand/boot/Makefile               |  10 +------
 sys/arch/macppc/stand/ofwboot/Makefile             |  11 +++-----
 sys/arch/mipsco/stand/Makefile.booters             |  12 +++------
 sys/arch/mmeye/stand/boot/Makefile                 |  10 +++----
 sys/arch/mvme68k/stand/Makefile.booters            |  10 +------
 sys/arch/mvmeppc/stand/Makefile.booters            |  10 +------
 sys/arch/news68k/stand/Makefile.inc                |  14 +---------
 sys/arch/newsmips/stand/Makefile.inc               |  14 +---------
 sys/arch/next68k/stand/boot/Makefile               |   9 +++----
 sys/arch/ofppc/stand/ofwboot/Makefile              |  13 +++-------
 sys/arch/pmax/stand/Makefile.booters               |  11 +++-----
 sys/arch/prep/stand/boot/Makefile                  |  12 ++++-----
 sys/arch/rs6000/stand/boot/Makefile                |  12 +++------
 sys/arch/sandpoint/stand/altboot/Makefile          |  14 ++++------
 sys/arch/sbmips/stand/Makefile.bootprogs           |  15 ++---------
 sys/arch/sgimips/stand/Makefile.booters            |  14 +---------
 sys/arch/sgimips/stand/boot64/Makefile             |  16 ++----------
 sys/arch/shark/stand/ofwboot/Makefile              |  13 +++-------
 sys/arch/sparc/stand/boot/Makefile                 |  13 ++++------
 sys/arch/sparc/stand/ofwboot/Makefile              |  12 +++------
 sys/arch/sun68k/stand/libsa/Makefile.inc           |  10 ++-----
 sys/arch/vax/boot/boot/Makefile                    |  14 ++++------
 sys/arch/x68k/stand/boot/Makefile                  |   9 +-----
 sys/arch/x68k/stand/boot_ufs/Makefile              |   9 +-----
 sys/arch/x68k/stand/boot_ustar/Makefile            |  10 ++-----
 sys/arch/x68k/stand/xxboot/Makefile.xxboot         |   8 +----
 sys/arch/zaurus/stand/zboot/Makefile               |  14 ++++-------
 49 files changed, 185 insertions(+), 429 deletions(-)

diffs (truncated from 1733 to 300 lines):

diff -r 61fb3e607fc9 -r 95fc515365ff sys/arch/acorn26/stand/Makefile.buildboot
--- a/sys/arch/acorn26/stand/Makefile.buildboot Sat Apr 08 18:24:09 2017 +0000
+++ b/sys/arch/acorn26/stand/Makefile.buildboot Sat Apr 08 19:53:19 2017 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.buildboot,v 1.22 2017/02/22 12:44:21 maya Exp $
+#      $NetBSD: Makefile.buildboot,v 1.23 2017/04/08 19:53:19 christos Exp $
 
 S?=    ${.CURDIR}/../../../..
 
@@ -20,15 +20,11 @@
 
 RISCOSTYPE ?= ff8
 
+.include "${S}/conf/newvers_stand.mk"
+
 .include <bsd.own.mk>
 .include <bsd.klinks.mk>
 
-SRCS+=         vers.c
-CLEANFILES+=   vers.c
-.PHONY: vers.c
-vers.c: ${.CURDIR}/version
-       ${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \
-           ${.CURDIR}/version ${MACHINE} ${NEWVERSWHAT}
 
 CPUFLAGS=
 CPPFLAGS+=     -D_STANDALONE -DHIMEM=0x28000
diff -r 61fb3e607fc9 -r 95fc515365ff sys/arch/acorn32/stand/Makefile.buildboot
--- a/sys/arch/acorn32/stand/Makefile.buildboot Sat Apr 08 18:24:09 2017 +0000
+++ b/sys/arch/acorn32/stand/Makefile.buildboot Sat Apr 08 19:53:19 2017 +0000
@@ -1,11 +1,9 @@
-#      $NetBSD: Makefile.buildboot,v 1.22 2017/02/22 12:44:21 maya Exp $
+#      $NetBSD: Makefile.buildboot,v 1.23 2017/04/08 19:53:19 christos Exp $
 
 S?=    ${.CURDIR}/../../../..
 
 .PATH: ${.CURDIR}/../lib
 
-KLINK_MACHINE= acorn32
-
 SRCS=  ${PROGSOURCE}
 NOMAN=# defined
 BINDIR=/usr/mdec
@@ -31,16 +29,11 @@
 LINKFLAGS+=-N -Ttext ${RELOC}
 .endif
 
+.include "${S}/conf/newvers_stand.mk"
+
 .include <bsd.own.mk>
 .include <bsd.klinks.mk>
 
-SRCS+=         vers.c
-CLEANFILES+=   vers.c
-.PHONY: vers.c
-vers.c: ${.CURDIR}/version
-       ${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \
-           ${.CURDIR}/version ${KLINK_MACHINE} ${NEWVERSWHAT}
-
 CPPFLAGS+=     -D_STANDALONE 
 CPPFLAGS+=     -I. -I${.CURDIR}/../../.. -I${.CURDIR}/../../../..
 CPPFLAGS+=     -I${.CURDIR}/../lib
diff -r 61fb3e607fc9 -r 95fc515365ff sys/arch/alpha/stand/Makefile.bootprogs
--- a/sys/arch/alpha/stand/Makefile.bootprogs   Sat Apr 08 18:24:09 2017 +0000
+++ b/sys/arch/alpha/stand/Makefile.bootprogs   Sat Apr 08 19:53:19 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.bootprogs,v 1.35 2016/01/20 12:49:21 jklos Exp $
+# $NetBSD: Makefile.bootprogs,v 1.36 2017/04/08 19:53:19 christos Exp $
 
 NOMAN=                 # defined
 
@@ -34,17 +34,8 @@
 CWARNFLAGS+=   -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
 CFLAGS+=       -Werror ${CWARNFLAGS}
 
-# if there is a 'version' file, add rule for vers.c and add it to SRCS
-# and CLEANFILES
-.if exists(version)
-.PHONY: vers.c
-vers.c: version
-       ${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \
-           -N ${.CURDIR}/version "alpha"
+.include "${S}/conf/newvers_stand.mk"
 
-SRCS+= vers.c
-CLEANFILES+= vers.c
-.endif
 
 # For descriptions of regions available to bootstrap programs, see
 # section 3.4.1.2 (pp. III 3-14 - III 3-18) of the second edition of
diff -r 61fb3e607fc9 -r 95fc515365ff sys/arch/amiga/stand/bootblock/boot/Makefile
--- a/sys/arch/amiga/stand/bootblock/boot/Makefile      Sat Apr 08 18:24:09 2017 +0000
+++ b/sys/arch/amiga/stand/bootblock/boot/Makefile      Sat Apr 08 19:53:19 2017 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.54 2016/09/17 17:09:10 christos Exp $
+#      $NetBSD: Makefile,v 1.55 2017/04/08 19:53:19 christos Exp $
 
 .include <bsd.init.mk>
 .include <bsd.sys.mk>          # for HOST_SH
@@ -11,11 +11,11 @@
 #XX#DIR_LIBZ = ${DIR_TOP}/../common/dist/zlib
 
 DIR_TOP=       ${.CURDIR}/../../../../..
-DIR_SA =       ${DIR_TOP}/lib/libsa
+DIR_SA =       ${S}/lib/libsa
 DIR_LIBZ=
-DIR_KERN=      ${DIR_TOP}/lib/libkern
-DIR_KERN_MD=   ${DIR_TOP}/lib/libkern/arch/$(MACHINE_ARCH)
-DIR_LIBC=      ${DIR_TOP}/../common/lib/libc
+DIR_KERN=      ${S}/lib/libkern
+DIR_KERN_MD=   ${S}/lib/libkern/arch/$(MACHINE_ARCH)
+DIR_LIBC=      ${S}/../common/lib/libc
 
 .PATH:  $(DIR_SA) ${DIR_LIBZ} $(DIR_KERN) $(DIR_KERN_MD) \
        ${DIR_LIBC}/gen ${DIR_LIBC}/arch/m68k/gen \
@@ -47,7 +47,7 @@
 SOBJS += strlen.o memcmp.o memset.o strerror.o strncmp.o
 SOBJS += libstubs.o
 
-OBJS=  $(SOBJS) $(COBJS)
+OBJS+= $(SOBJS) $(COBJS)
 
 #XX#DEFS = -D_STANDALONE -DSA_EXEC_ANYOWNER -DDYNAMIC_CRC_TABLE -DNOBYFOUR -UBYFOUR 
 DEFS = -D_STANDALONE -DSA_EXEC_ANYOWNER 
@@ -68,7 +68,10 @@
 
 realall: ${FILES}
 
-CLEANFILES += boot.amiga x.out xxstart.o libboot.a vers.c
+CLEANFILES += boot.amiga x.out xxstart.o libboot.a
+
+VERSIONFLAGS+=-N
+.include "${S}/conf/newvers_stand.mk"
 
 .include <bsd.prog.mk>
 .include <bsd.klinks.mk>
@@ -126,12 +129,6 @@
        ${_MKTARGET_BUILD}
        ${AR} crs $@ $> && ${RANLIB} $@
 
-vers.o: vers.c
-vers.c:        ${.CURDIR}/version
-       ${_MKTARGET_CREATE}
-       ${HOST_SH} ${DIR_TOP}/conf/newvers_stand.sh \
-           ${${MKREPRO} == "yes" :?:-D} -N ${.CURDIR}/version "amiga"
-
 # make sure these are built:
 
 ${COBJS}: ${TXLT}
diff -r 61fb3e607fc9 -r 95fc515365ff sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile
--- a/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile        Sat Apr 08 18:24:09 2017 +0000
+++ b/sys/arch/amiga/stand/bootblock/bootxx_ffs/Makefile        Sat Apr 08 19:53:19 2017 +0000
@@ -1,12 +1,12 @@
-#      $NetBSD: Makefile,v 1.23 2016/01/15 08:27:04 mlelstv Exp $
+#      $NetBSD: Makefile,v 1.24 2017/04/08 19:53:20 christos Exp $
 
 ### what we need:
 
-DIR_TOP=       ${.CURDIR}/../../../../..
-DIR_SA =       ${DIR_TOP}/lib/libsa
-DIR_KERN=      ${DIR_TOP}/lib/libkern
-DIR_KERN_MD=   ${DIR_TOP}/lib/libkern/arch/$(MACHINE_ARCH)
-DIR_LIBC=      ${DIR_TOP}/../common/lib/libc
+S=     ${.CURDIR}/../../../../..
+DIR_SA =       ${S}/lib/libsa
+DIR_KERN=      ${S}/lib/libkern
+DIR_KERN_MD=   ${S}/lib/libkern/arch/$(MACHINE_ARCH)
+DIR_LIBC=      ${S}/../common/lib/libc
 
 .PATH:  ${.CURDIR}/../boot $(DIR_SA) $(DIR_KERN) $(DIR_KERN_MD) \
        ${DIR_LIBC}/gen ${DIR_LIBC}/arch/m68k/gen \
@@ -25,13 +25,13 @@
 
 COBJS = main.o console.o xd.o twiddle.o bzero.o gets.o
 COBJS+=  lseek.o open.o read.o close.o dev.o errno.o
-COBJS+=  ufs.o ustarfs.o panic.o vers.o files.o
+COBJS+=  ufs.o ustarfs.o panic.o files.o
 
 SOBJS = alloc.o ashrdi3.o ashldi3.o bcopy.o muldi3.o printf.o startit.o
 SOBJS += strlen.o strcmp.o fstat.o
 SOBJS += libstubs.o memcmp.o memmove.o memset.o strncmp.o
 
-OBJS=  $(SOBJS) $(COBJS)
+OBJS+= $(SOBJS) $(COBJS)
 
 DEFS = -D_STANDALONE -DSA_EXEC_ANYOWNER -D_PRIMARY_BOOT -DSERCONSOLE
 
@@ -41,14 +41,14 @@
 
 realall: ${FILES}
 
-CLEANFILES += bootxx_ffs bootxx_fd x.out f.out xxstart.o fdstart.o libboot.a vers.c
+CLEANFILES += bootxx_ffs bootxx_fd x.out f.out xxstart.o fdstart.o libboot.a
 
 .include <bsd.prog.mk>
 .include <bsd.klinks.mk>
 
 ### special  rules for bootblocks ###
 
-INCPATH = -nostdinc -I${DIR_TOP} -I${DIR_TOP}/lib/libsa -I${.CURDIR}
+INCPATH = -nostdinc -I${S} -I${S}/lib/libsa -I${.CURDIR}
 INCPATH += -I${.CURDIR}/../boot -I${.CURDIR}/../../..
 INCPATH += -I${.CURDIR}/../elf2bb -I${.OBJDIR}
 
@@ -113,10 +113,9 @@
        ${_MKTARGET_BUILD}
        ${AR} crs $@ $> && ${RANLIB} $@
 
-vers.c:        ${.CURDIR}/../boot/version
-       ${_MKTARGET_CREATE}
-       ${HOST_SH} ${DIR_TOP}/conf/newvers_stand.sh -N \
-           ${.CURDIR}/../boot/version "amiga"
+VERSIONFILE=${.CURDIR}/../boot/version
+VERSIONFLAGS=-n
+.include "${S}/conf/newvers_stand.mk"
 
 # make sure these are built:
 
diff -r 61fb3e607fc9 -r 95fc515365ff sys/arch/arc/stand/boot/Makefile
--- a/sys/arch/arc/stand/boot/Makefile  Sat Apr 08 18:24:09 2017 +0000
+++ b/sys/arch/arc/stand/boot/Makefile  Sat Apr 08 19:53:19 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.16 2016/09/08 14:36:13 christos Exp $
+# $NetBSD: Makefile,v 1.17 2017/04/08 19:53:20 christos Exp $
 
 .include <bsd.init.mk>
 
@@ -38,18 +38,6 @@
 TEXTADDR=  0x80f00000
 LD+=           -m elf32ltsmip
 
-# if there is a 'version' file, add rule for vers.c and add it to SRCS
-# and CLEANFILES
-.if exists(version)
-.PHONY: vers.c
-vers.c: ${.CURDIR}/version
-       ${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \
-           ${.CURDIR}/version ${MACHINE}
-
-SRCS+= vers.c
-CLEANFILES+= vers.c
-.endif
-
 ### find out what to use for libsa
 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes
 .include "${S}/lib/libsa/Makefile.inc"
@@ -79,5 +67,7 @@
 
 CLEANFILES+=   ${PROG}.elf ${PROG}.map
 
+.include "${S}/conf/newvers_stand.mk"
+
 .include <bsd.klinks.mk>
 .include <bsd.prog.mk>
diff -r 61fb3e607fc9 -r 95fc515365ff sys/arch/bebox/stand/boot/Makefile
--- a/sys/arch/bebox/stand/boot/Makefile        Sat Apr 08 18:24:09 2017 +0000
+++ b/sys/arch/bebox/stand/boot/Makefile        Sat Apr 08 19:53:19 2017 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.34 2014/01/12 15:26:28 tsutsui Exp $
+#      $NetBSD: Makefile,v 1.35 2017/04/08 19:53:20 christos Exp $
 
 NOMAN= # defined
 
@@ -23,7 +23,7 @@
 SRCS= srt0.s
 SRCS+= boot.c clock.c com.c conf.c cons.c cpu.c devopen.c
 SRCS+= fd.c filesystem.c inkernel.c io.c kbd.c monitor.c ns16550.c
-SRCS+= pci.c prf.c sd.c siop.c tgets.c vers.c vga.c video.c vreset.c wdc.c wd.c
+SRCS+= pci.c prf.c sd.c siop.c tgets.c vga.c video.c vreset.c wdc.c wd.c
 SRCS+= setjmp.S
 
 CFLAGS= -Wno-main -ffreestanding
@@ -57,19 +57,17 @@
 
 RELOC= 0x700000
 
-CLEANFILES+= vers.c ${PROG}.elf
+CLEANFILES+= ${PROG}.elf
 
 LIBS= ${L}/sa/libsa.a ${L}/kern/libkern.a ${L}/z/libz.a
 
-vers.c: ${.CURDIR}/../boot/version
-       ${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \
-           ${.CURDIR}/../boot/version "bebox" ${NEWVERSWHAT}
-
 ${PROG}: ${OBJS} ${LIBS}
        ${_MKTARGET_LINK}
        ${LD} -o ${PROG}.elf -N -T ${.CURDIR}/../boot/ld.script \
                -Ttext ${RELOC} ${OBJS} ${LIBS}
        ${STRIP} -o ${PROG} ${PROG}.elf
 
+.include "${S}/conf/newvers_stand.mk"
+
 .include <bsd.prog.mk>
 .include <bsd.klinks.mk>
diff -r 61fb3e607fc9 -r 95fc515365ff sys/arch/cobalt/stand/boot/Makefile
--- a/sys/arch/cobalt/stand/boot/Makefile       Sat Apr 08 18:24:09 2017 +0000
+++ b/sys/arch/cobalt/stand/boot/Makefile       Sat Apr 08 19:53:19 2017 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.31 2016/09/08 14:37:37 christos Exp $



Home | Main Index | Thread Index | Old Index