Include directory reorg and makefile updates.

-Convert the include directory over to using bsdmake
 syntax
-Update/add mkfiles
-Modify install(1) so that it can create symlinks
-Update makefiles to use new install(1) options
-Rename /usr/include/ibm to /usr/include/i386
-Create /usr/include/machine symlink to arch header files
-Move vm_i386.h to its new home in the /usr/include/i386
-Update source files to #include the header files at their
 new homes.
-Add new gnu-includes target for building GCC headers
This commit is contained in:
Arun Thomas
2010-03-08 11:04:59 +00:00
parent ecf1a36d48
commit 2a8fabf4ad
90 changed files with 485 additions and 152 deletions

57
etc/mk/minix.inc.mk Normal file
View File

@@ -0,0 +1,57 @@
# $NetBSD: bsd.inc.mk,v 1.32 2006/03/16 18:43:34 jwise Exp $
.include <minix.init.mk>
##### Basic targets
includes: ${INCS} incinstall inclinkinstall
##### Default values
INCSYMLINKS?=
##### Install rules
incinstall:: # ensure existence
.PHONY: incinstall
# -c is forced on here, in order to preserve modtimes for "make depend"
__incinstall: .USE
@cmp -s ${.ALLSRC} ${.TARGET} > /dev/null 2>&1 || \
(${_MKSHMSG_INSTALL} ${.TARGET}; \
${_MKSHECHO} "${INSTALL_FILE} -c -o ${BINOWN} -g ${BINGRP} \
-m ${NONBINMODE} ${.ALLSRC} ${.TARGET}" && \
${INSTALL_FILE} -c -o ${BINOWN} -g ${BINGRP} \
-m ${NONBINMODE} ${.ALLSRC} ${.TARGET})
.for F in ${INCS:O:u}
_FDIR:= ${INCSDIR_${F:C,/,_,g}:U${INCSDIR}} # dir override
_FNAME:= ${INCSNAME_${F:C,/,_,g}:U${INCSNAME:U${F}}} # name override
_F:= ${DESTDIR}${_FDIR}/${_FNAME} # installed path
.if ${MKUPDATE} == "no"
${_F}! ${F} __incinstall # install rule
.else
${_F}: ${F} __incinstall # install rule
.endif
incinstall:: ${_F}
.PRECIOUS: ${_F} # keep if install fails
.endfor
.undef _FDIR
.undef _FNAME
.undef _F
inclinkinstall: .PHONY
.if !empty(INCSYMLINKS)
@(set ${INCSYMLINKS}; \
while test $$# -ge 2; do \
l=$$1; shift; \
t=${DESTDIR}$$1; shift; \
if ttarg=`${TOOL_STAT} -qf '%Y' $$t` && \
[ "$$l" = "$$ttarg" ]; then \
continue ; \
fi ; \
${_MKSHMSG_INSTALL} $$t; \
${_MKSHECHO} ${INSTALL_SYMLINK} $$l $$t; \
${INSTALL_SYMLINK} $$l $$t; \
done; )
.endif

93
etc/mk/minix.kinc.mk Normal file
View File

@@ -0,0 +1,93 @@
# $NetBSD: bsd.kinc.mk,v 1.36 2006/03/16 18:43:34 jwise Exp $
# Variables:
#
# INCSDIR Directory to install includes into (and/or make, and/or
# symlink, depending on what's going on).
#
# INCS Headers to install.
#
# DEPINCS Headers to install which are built dynamically.
#
# SUBDIR Subdirectories to enter
#
# INCSYMLINKS Symlinks to make (unconditionally), a la bsd.links.mk.
# Note that the original bits will be 'rm -rf'd rather than
# just 'rm -f'd, to make the right thing happen with include
# directories.
#
.include <minix.init.mk>
##### Basic targets
.PRECIOUS: ${DESTDIR}${INCSDIR}
includes: ${DESTDIR}${INCSDIR} .WAIT ${INCS} incinstall
##### Install rules
incinstall:: # ensure existence
.PHONY: incinstall
# make sure the directory is OK, and install includes.
${DESTDIR}${INCSDIR}: .EXEC
@if [ ! -d ${.TARGET} ] || [ -h ${.TARGET} ] ; then \
${_MKSHMSG_CREATE} ${.TARGET}; \
/bin/rm -rf ${.TARGET}; \
${_MKSHECHO} ${INSTALL_DIR} -o ${BINOWN} -g ${BINGRP} -m 755 \
${.TARGET}; \
${INSTALL_DIR} -o ${BINOWN} -g ${BINGRP} -m 755 \
${.TARGET}; \
fi
# -c is forced on here, in order to preserve modtimes for "make depend"
__incinstall: .USE
@cmp -s ${.ALLSRC} ${.TARGET} > /dev/null 2>&1 || \
(${_MKSHMSG_INSTALL} ${.TARGET}; \
${_MKSHECHO} "${INSTALL_FILE} -c -o ${BINOWN} -g ${BINGRP} \
-m ${NONBINMODE} ${.ALLSRC} ${.TARGET}" && \
${INSTALL_FILE} -c -o ${BINOWN} -g ${BINGRP} \
-m ${NONBINMODE} ${.ALLSRC} ${.TARGET})
.for F in ${INCS:O:u} ${DEPINCS:O:u}
_F:= ${DESTDIR}${INCSDIR}/${F} # installed path
.if ${MKUPDATE} == "no"
${_F}! ${F} __incinstall # install rule
.else
${_F}: ${F} __incinstall # install rule
.endif
incinstall:: ${_F}
.PRECIOUS: ${_F} # keep if install fails
.endfor
.undef _F
.if defined(INCSYMLINKS) && !empty(INCSYMLINKS)
incinstall::
# XXX: Minix can't handle stat -qf
# @(set ${INCSYMLINKS}; \
# while test $$# -ge 2; do \
# l=$$1; shift; \
# t=${DESTDIR}$$1; shift; \
# if ttarg=`${TOOL_STAT} -qf '%Y' $$t` && \
# [ "$$l" = "$$ttarg" ]; then \
# continue ; \
# fi ; \
# ${_MKSHMSG_INSTALL} $$t; \
# ${_MKSHECHO} ${INSTALL_SYMLINK} $$l $$t; \
# ${INSTALL_SYMLINK} $$l $$t; \
# done; )
@(set ${INCSYMLINKS}; \
while test $$# -ge 2; do \
l=$$1; shift; \
t=${DESTDIR}$$1; shift; \
${_MKSHMSG_INSTALL} $$t; \
${_MKSHECHO} ${INSTALL_SYMLINK} $$l $$t; \
${INSTALL_SYMLINK} $$l $$t; \
done; )
.endif
##### Pull in related .mk logic
.include <minix.subdir.mk>
.include <minix.sys.mk>

69
etc/mk/minix.klinks.mk Normal file
View File

@@ -0,0 +1,69 @@
# $NetBSD: bsd.klinks.mk,v 1.6 2009/11/27 13:50:29 pooka Exp $
#
.include <minix.own.mk>
##### Default values
.if !defined(S)
.if defined(NETBSDSRCDIR)
S= ${NETBSDSRCDIR}/sys
.elif defined(BSDSRCDIR)
S= ${BSDSRCDIR}/sys
.else
S= /sys
.endif
.endif
CLEANFILES+= machine ${MACHINE_CPU}
.if ${MACHINE} == "sun2" || ${MACHINE} == "sun3"
CLEANFILES+= sun68k
.elif ${MACHINE} == "sparc64"
CLEANFILES+= sparc
.elif ${MACHINE} == "i386"
CLEANFILES+= x86
.elif ${MACHINE} == "amd64"
CLEANFILES+= x86
.endif
.if defined(XEN_BUILD) || ${MACHINE} == "xen"
CLEANFILES+= xen xen-ma/machine # xen-ma
CPPFLAGS+= -I${.OBJDIR}/xen-ma
.if ${MACHINE_CPU} == "i386"
CLEANFILES+= x86
.endif
.endif
# XXX. This should be done a better way. It's @'d to reduce visual spew.
# XXX .BEGIN is used to make sure the links are done before anything else.
.if !make(obj) && !make(clean) && !make(cleandir)
.BEGIN:
@rm -f machine && \
ln -s $S/arch/${MACHINE}/include machine
@rm -f ${MACHINE_CPU} && \
ln -s $S/arch/${MACHINE_CPU}/include ${MACHINE_CPU}
# XXX. it gets worse..
.if ${MACHINE} == "sun2" || ${MACHINE} == "sun3"
@rm -f sun68k && \
ln -s $S/arch/sun68k/include sun68k
.endif
.if ${MACHINE} == "sparc64"
@rm -f sparc && \
ln -s $S/arch/sparc/include sparc
.endif
.if ${MACHINE} == "amd64"
@rm -f x86 && \
ln -s $S/arch/x86/include x86
@rm -f i386 && \
ln -s $S/arch/i386/include i386
.endif
.if ${MACHINE_CPU} == "i386"
@rm -f x86 && \
ln -s $S/arch/x86/include x86
.endif
.if defined(XEN_BUILD) || ${MACHINE} == "xen"
@rm -f xen && \
ln -s $S/arch/xen/include xen
@rm -rf xen-ma && mkdir xen-ma && \
ln -s ../${XEN_BUILD:U${MACHINE_ARCH}} xen-ma/machine
.endif
.endif

View File

@@ -769,9 +769,7 @@ PRESERVE?= -p
.endif
#XXX: Not supported by MINIX install
#RENAME?= -r
#XXX: MINIX install only supports hard link
#HRDLINK?= -l h
HRDLINK?= -l
HRDLINK?= -l h
SYMLINK?= -l s
METALOG?= ${DESTDIR}/METALOG

View File

@@ -358,7 +358,7 @@ LINKSGRP?= ${BINGRP}
LINKSMODE?= ${BINMODE}
.include <minix.man.mk>
.include <minix.files.mk>
# .include <minix.inc.mk>
.include <minix.inc.mk>
.include <minix.links.mk>
.include <minix.sys.mk>
.include <minix.dep.mk>

View File

@@ -20,6 +20,12 @@
755 root operator /usr/etc
755 root operator /home
755 bin operator /usr/include
755 bin operator /usr/include/arpa
755 bin operator /usr/include/minix
755 bin operator /usr/include/net
755 bin operator /usr/include/net/gen
755 bin operator /usr/include/netinet
755 bin operator /usr/include/sys
755 root operator /usr/lib
755 root operator /usr/lib/advent
755 root operator /usr/lib/cawf