Upgrading build system to new NetBSD revision

The tested targets are the followgin ones:
 * tools
 * distribution
 * sets
 * release

The remaining NetBSD targets have not been disabled nor tested
*at all*. Try them at your own risk, they may reboot the earth.

For all compliant Makefiles, objects and generated files are put in
MAKEOBJDIR, which means you can now keep objects between two branch
switching. Same for DESTDIR, please refer to build.sh options.

Regarding new or modifications of Makefiles a few things:
 * Read share/mk/bsd.README
 * If you add a subdirectory, add a Makefile in it, and have it called
   by the parent through the SUBDIR variable.
 * Do not add arbitrary inclusion which crosses to another branch of
   the hierarchy; If you can't do without it, put a comment on why.
   If possible, do not use inclusion at all.
 * Use as much as possible the infrastructure, it is here to make
   life easier, do not fight it.

Sets and package are now used to track files.
We have one set called "minix", composed of one package called "minix-sys"
This commit is contained in:
2012-09-12 09:37:05 +02:00
parent bdb3f57135
commit 9152e1c5a7
609 changed files with 113178 additions and 1553 deletions

4
common/Makefile Normal file
View File

@@ -0,0 +1,4 @@
SUBDIR+= include
.include <bsd.subdir.mk>

8
common/include/Makefile Normal file
View File

@@ -0,0 +1,8 @@
INCSDIR= /usr/include/minix
INCS+= termios.h
SUBDIR+= sys
.include <bsd.kinc.mk>

View File

@@ -1,6 +0,0 @@
.include <bsd.own.mk>
.PATH: ${NETBSDSRCDIR}/common/include
INCS+= termios.h

View File

@@ -1,10 +1,11 @@
.include <bsd.own.mk>
.PATH: ${NETBSDSRCDIR}/common/include/sys
INCSDIR= /usr/include/sys
INCS+= elf64.h elf_common.h elf_generic.h \
INCS+= elf64.h elf_common.h elf_generic.h \
ioc_block.h ioc_fbd.h ioc_file.h ioc_tape.h ioc_disk.h \
ioc_memory.h ioc_sound.h ioc_tty.h \
kbdio.h mtio.h svrctl.h video.h vm.h procfs.h elf_core.h exec_elf.h \
disk.h dkio.h ioccom.h mutex.h iostat.h disklabel.h disklabel_gpt.h \
bootblock.h dkbad.h extattr.h
bootblock.h dkbad.h
.include <bsd.kinc.mk>

View File

@@ -1,12 +1,13 @@
# $NetBSD: Makefile.inc,v 1.10 2008/10/26 07:22:50 mrg Exp $
# $NetBSD: Makefile.inc,v 1.12 2012/07/08 01:21:12 rmind Exp $
COMMON_DIR:=${.PARSEDIR}
.if defined(__MINIX)
COMMON_CODEDIRS=atomic gen inet md net quad stdlib string
COMMON_CODEDIRS+=hash/sha1 hash/sha2 hash/rmd160
.else
COMMON_CODEDIRS=atomic gen gmon inet md net quad stdlib string sys
COMMON_CODEDIRS+=hash/sha1 hash/sha2 hash/rmd160 hash/murmurhash
.endif
COMMON_CODEDIRS+=hash/sha1 hash/sha2 hash/rmd160
.if defined(COMMON_MACHINE_ARCH) && !empty(COMMON_MACHINE_ARCH) && \
exists(${COMMON_DIR}/arch/${COMMON_MACHINE_ARCH})
@@ -29,6 +30,11 @@ COMMON_ARCHDIR=${COMMON_DIR}/arch/${COMMON_ARCHSUBDIR}
.if exists(${COMMON_ARCHDIR}/${i}/Makefile.inc)
.include "${COMMON_ARCHDIR}/${i}/Makefile.inc"
.endif
.if !empty(CPPFLAGS:M-DLIBKERN_OPTIMISE_SPACE) && \
exists(${COMMON_ARCHDIR}/$i/small)
.PATH.S: ${COMMON_ARCHDIR}/$i/small
.endif
.if exists(${COMMON_ARCHDIR}/$i)
.PATH.c: ${COMMON_ARCHDIR}/$i
.PATH.S: ${COMMON_ARCHDIR}/$i

View File

@@ -1,19 +1,40 @@
# $NetBSD: Makefile.inc,v 1.8 2009/01/04 17:54:29 pooka Exp $
# $NetBSD: Makefile.inc,v 1.9 2012/08/16 16:49:10 matt Exp $
ARMV6= ${CPUFLAGS:M-march=armv7*} ${CPUFLAGS:M-mcpu=cortex*}
ARMV6+= ${CPUFLAGS:M-march=armv6*} ${CPUFLAGS:M-mcpu=arm11*}
ARMV6+= ${CFLAGS:M-march=armv7*:} ${CFLAGS:M-mcpu=cortex*}
ARMV6+= ${CFLAGS:M-march=armv6*:} ${CFLAGS:M-mcpu=arm11*}
ARMV6+= ${CPPFLAGS:M-march=armv7*:} ${CPPFLAGS:M-mcpu=cortex*}
ARMV6+= ${CPPFLAGS:M-march=armv6*:} ${CPPFLAGS:M-mcpu=arm11*}
.if defined(LIB) && (${LIB} == "kern" || ${LIB} == "c" || ${LIB} == "pthread" \
|| ${LIB} == "rump" || (defined(__MINIX) && ${LIB} == "sys"))
SRCS+= atomic_add_32_cas.c atomic_add_32_nv_cas.c atomic_and_32_cas.c \
atomic_and_32_nv_cas.c atomic_dec_32_cas.c atomic_dec_32_nv_cas.c \
atomic_inc_32_cas.c atomic_inc_32_nv_cas.c atomic_or_32_cas.c \
atomic_or_32_nv_cas.c atomic_swap_32_cas.c membar_ops_nop.c
.if empty(ARMV6)
SRCS.atomic+= atomic_add_32_cas.c atomic_add_32_nv_cas.c \
atomic_and_32_cas.c atomic_and_32_nv_cas.c \
atomic_dec_32_cas.c atomic_dec_32_nv_cas.c \
atomic_inc_32_cas.c atomic_inc_32_nv_cas.c \
atomic_or_32_cas.c atomic_or_32_nv_cas.c \
atomic_swap_32_cas.c membar_ops_nop.c
.else
SRCS.atomic+= atomic_add_32.S atomic_and_32.S atomic_cas_32.S \
atomic_dec_32.S atomic_inc_32.S atomic_or_32.S \
atomic_swap.S membar_ops.S
.endif
.endif
.if defined(LIB) && (${LIB} == "c" || ${LIB} == "pthread")
SRCS+= atomic_init_testset.c
SRCS+= atomic_cas_up.S
.if empty(ARMV6)
SRCS.atomic+= atomic_init_testset.c
SRCS.atomic+= atomic_cas_up.S
CPPFLAGS+= -D__HAVE_ASM_ATOMIC_CAS_UP
.else
SRCS.atomic+= atomic_init_cas.c
.endif
.endif
SRCS+= ${SRCS.atomic}

View File

@@ -1,4 +1,4 @@
# $NetBSD: Makefile.inc,v 1.8 2008/06/30 20:14:09 matt Exp $
# $NetBSD: Makefile.inc,v 1.9 2012/07/27 09:10:59 pooka Exp $
.PATH: ${.PARSEDIR}
@@ -6,4 +6,6 @@ SRCS+= prop_array.c prop_array_util.c prop_bool.c prop_data.c \
prop_dictionary.c prop_dictionary_util.c prop_ingest.c \
prop_kern.c prop_number.c prop_object.c prop_stack.c prop_string.c
#SRCS+= prop_rb.c
.ifdef (PROPLIB_WANT_RB)
SRCS+= prop_rb.c
.endif