Move mkfiles from /etc/mk to /usr/share/mk
Simplifies pkgsrc porting.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
.include <bsd.own.mk>
|
||||
|
||||
SUBDIR= zoneinfo
|
||||
SUBDIR= mk zoneinfo
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
|
||||
24
share/mk/bsd.ack.mk
Normal file
24
share/mk/bsd.ack.mk
Normal file
@@ -0,0 +1,24 @@
|
||||
CPPFLAGS+= -wo
|
||||
|
||||
.SUFFIXES: .o .e .S
|
||||
|
||||
# Treated like a C file
|
||||
.e.o:
|
||||
${_MKTARGET_COMPILE}
|
||||
${COMPILE.c} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
|
||||
# .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
|
||||
# ${OBJCOPY} -x ${.TARGET}
|
||||
# .endif
|
||||
|
||||
ASMCONV=gas2ack
|
||||
AFLAGS+=-D__ASSEMBLY__ -D__minix -w -wo
|
||||
CPP.s=${CC} -E ${AFLAGS}
|
||||
ASMCONVFLAGS+=-mi386
|
||||
|
||||
# Need to convert ACK assembly files to GNU assembly before building
|
||||
.S.o:
|
||||
${_MKTARGET_COMPILE}
|
||||
${CPP.s} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.PREFIX}.gnu.s
|
||||
${ASMCONV} ${ASMCONVFLAGS} ${.PREFIX}.gnu.s ${.PREFIX}.ack.s
|
||||
${COMPILE.s} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.PREFIX}.ack.s -o ${.TARGET}
|
||||
rm -rf ${.PREFIX}.ack.s ${.PREFIX}.gnu.s
|
||||
88
share/mk/bsd.dep.mk
Normal file
88
share/mk/bsd.dep.mk
Normal file
@@ -0,0 +1,88 @@
|
||||
# $NetBSD: bsd.dep.mk,v 1.68 2008/10/25 22:27:36 apb Exp $
|
||||
|
||||
##### Basic targets
|
||||
cleandir: cleandepend
|
||||
realdepend: beforedepend .depend afterdepend
|
||||
.ORDER: beforedepend .depend afterdepend
|
||||
|
||||
beforedepend .depend afterdepend: # ensure existence
|
||||
|
||||
##### Default values
|
||||
MKDEP?= mkdep
|
||||
MKDEP_SUFFIXES?= .o
|
||||
|
||||
##### Build rules
|
||||
# some of the rules involve .h sources, so remove them from mkdep line
|
||||
|
||||
.if defined(SRCS) # {
|
||||
#_TRADITIONAL_CPP?=-traditional-cpp
|
||||
__acpp_flags= ${_TRADITIONAL_CPP}
|
||||
|
||||
__DPSRCS.all= ${SRCS:C/\.(c|m|s|S|C|cc|cpp|cxx)$/.d/} \
|
||||
${DPSRCS:C/\.(c|m|s|S|C|cc|cpp|cxx)$/.d/}
|
||||
__DPSRCS.d= ${__DPSRCS.all:O:u:M*.d}
|
||||
__DPSRCS.notd= ${__DPSRCS.all:O:u:N*.d}
|
||||
|
||||
.NOPATH: .depend ${__DPSRCS.d}
|
||||
|
||||
.if !empty(__DPSRCS.d) # {
|
||||
${__DPSRCS.d}: ${__DPSRCS.notd} ${DPSRCS}
|
||||
.endif # }
|
||||
|
||||
.depend: ${__DPSRCS.d}
|
||||
${_MKTARGET_CREATE}
|
||||
rm -f .depend
|
||||
# ${MKDEP} -d -f ${.TARGET} -s ${MKDEP_SUFFIXES:Q} ${__DPSRCS.d}
|
||||
cat ${__DPSRCS.d} > ${.TARGET}
|
||||
|
||||
.SUFFIXES: .d .s .S .c .C .cc .cpp .cxx .m
|
||||
|
||||
.c.d:
|
||||
${_MKTARGET_CREATE}
|
||||
# ${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} \
|
||||
# ${CFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
|
||||
# ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
|
||||
# mkdep -- ${MKDEPFLAGS} \
|
||||
# ${CFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
|
||||
# ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} > ${.TARGET}
|
||||
mkdep "$(CC) ${CFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
|
||||
${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} -E" ${.IMPSRC} > ${.TARGET}
|
||||
|
||||
# .m.d:
|
||||
# ${_MKTARGET_CREATE}
|
||||
# ${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} \
|
||||
# ${OBJCFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
|
||||
# ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
|
||||
|
||||
.s.d .S.d:
|
||||
${_MKTARGET_CREATE}
|
||||
# ${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} \
|
||||
# ${AFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
|
||||
# ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${__acpp_flags} ${.IMPSRC}
|
||||
mkdep "$(CC) ${AFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
|
||||
${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} -E" ${.IMPSRC} > ${.TARGET}
|
||||
|
||||
# .C.d .cc.d .cpp.d .cxx.d:
|
||||
# ${_MKTARGET_CREATE}
|
||||
# ${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} \
|
||||
# ${CXXFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
|
||||
# ${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEMXX} \
|
||||
# ${DESTDIR}/usr/include/g++} \
|
||||
# ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
|
||||
|
||||
.endif # defined(SRCS) # }
|
||||
|
||||
##### Clean rules
|
||||
cleandepend: .PHONY
|
||||
.if defined(SRCS)
|
||||
rm -f .depend ${__DPSRCS.d} ${.CURDIR}/tags ${CLEANDEPEND}
|
||||
.endif
|
||||
|
||||
##### Custom rules
|
||||
# .if !target(tags)
|
||||
# tags: ${SRCS}
|
||||
# .if defined(SRCS)
|
||||
# -cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC:N*.h} | \
|
||||
# ${TOOL_SED} "s;\${.CURDIR}/;;" > tags
|
||||
# .endif
|
||||
# .endif
|
||||
161
share/mk/bsd.files.mk
Normal file
161
share/mk/bsd.files.mk
Normal file
@@ -0,0 +1,161 @@
|
||||
# $NetBSD: bsd.files.mk,v 1.40 2008/12/05 18:51:16 cube Exp $
|
||||
|
||||
.if !defined(_MINIX_FILES_MK_)
|
||||
_MINIX_FILES_MK_=1
|
||||
|
||||
.include <bsd.init.mk>
|
||||
|
||||
.if !target(__fileinstall)
|
||||
##### Basic targets
|
||||
realinstall: filesinstall
|
||||
realall: filesbuild
|
||||
|
||||
##### Default values
|
||||
FILESDIR?= ${BINDIR}
|
||||
FILESOWN?= ${BINOWN}
|
||||
FILESGRP?= ${BINGRP}
|
||||
FILESMODE?= ${NONBINMODE}
|
||||
|
||||
##### Build rules
|
||||
filesbuild:
|
||||
.PHONY: filesbuild
|
||||
|
||||
##### Install rules
|
||||
filesinstall:: # ensure existence
|
||||
.PHONY: filesinstall
|
||||
|
||||
configfilesinstall:: .PHONY
|
||||
|
||||
__fileinstall: .USE
|
||||
${_MKTARGET_INSTALL}
|
||||
${INSTALL_FILE} \
|
||||
-o ${FILESOWN_${.ALLSRC:T}:U${FILESOWN}} \
|
||||
-g ${FILESGRP_${.ALLSRC:T}:U${FILESGRP}} \
|
||||
-m ${FILESMODE_${.ALLSRC:T}:U${FILESMODE}} \
|
||||
${SYSPKGTAG} ${.ALLSRC} ${.TARGET}
|
||||
|
||||
.endif # !target(__fileinstall)
|
||||
|
||||
|
||||
.for F in ${FILES:O:u}
|
||||
_FDIR:= ${FILESDIR_${F}:U${FILESDIR}} # dir override
|
||||
_FNAME:= ${FILESNAME_${F}:U${FILESNAME:U${F:T}}} # name override
|
||||
_F:= ${DESTDIR}${_FDIR}/${_FNAME} # installed path
|
||||
_FDOBUILD:= ${FILESBUILD_${F}:Uno}
|
||||
|
||||
.if ${MKUPDATE} == "no"
|
||||
${_F}! ${F} __fileinstall # install rule
|
||||
.if !defined(BUILD) && !make(all) && !make(${F}) && (${_FDOBUILD} == "no")
|
||||
${_F}! .MADE # no build at install
|
||||
.endif
|
||||
.else
|
||||
${_F}: ${F} __fileinstall # install rule
|
||||
.if !defined(BUILD) && !make(all) && !make(${F}) && (${_FDOBUILD} == "no")
|
||||
${_F}: .MADE # no build at install
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.if ${_FDOBUILD} != "no"
|
||||
filesbuild: ${F}
|
||||
CLEANFILES+= ${F}
|
||||
.endif
|
||||
|
||||
filesinstall:: ${_F}
|
||||
.PRECIOUS: ${_F} # keep if install fails
|
||||
.endfor
|
||||
|
||||
|
||||
#
|
||||
# CONFIGFILES
|
||||
#
|
||||
configinstall: configfilesinstall
|
||||
|
||||
.for F in ${CONFIGFILES:O:u}
|
||||
_FDIR:= ${FILESDIR_${F}:U${FILESDIR}} # dir override
|
||||
_FNAME:= ${FILESNAME_${F}:U${FILESNAME:U${F:T}}} # name override
|
||||
_F:= ${DESTDIR}${_FDIR}/${_FNAME} # installed path
|
||||
_FDOBUILD:= ${FILESBUILD_${F}:Uno}
|
||||
|
||||
.if ${MKUPDATE} == "no"
|
||||
${_F}! ${F} __fileinstall # install rule
|
||||
.if !defined(BUILD) && !make(all) && !make(${F}) && (${_FDOBUILD} == "no")
|
||||
${_F}! .MADE # no build at install
|
||||
.endif
|
||||
.else
|
||||
${_F}: ${F} __fileinstall # install rule
|
||||
.if !defined(BUILD) && !make(all) && !make(${F}) && (${_FDOBUILD} == "no")
|
||||
${_F}: .MADE # no build at install
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.if ${_FDOBUILD} != "no"
|
||||
filesbuild: ${F}
|
||||
CLEANFILES+= ${F}
|
||||
.endif
|
||||
|
||||
configfilesinstall:: ${_F}
|
||||
.PRECIOUS: ${_F} # keep if install fails
|
||||
.endfor
|
||||
|
||||
.undef _FDIR
|
||||
.undef _FNAME
|
||||
.undef _F
|
||||
|
||||
|
||||
#
|
||||
# BUILDSYMLINKS
|
||||
#
|
||||
.if defined(BUILDSYMLINKS) # {
|
||||
|
||||
.for _SL _TL in ${BUILDSYMLINKS}
|
||||
BUILDSYMLINKS.s+= ${_SL}
|
||||
BUILDSYMLINKS.t+= ${_TL}
|
||||
${_TL}: ${_SL}
|
||||
${_MKMSG} "symlink " ${.CURDIR:T}/${.TARGET}
|
||||
rm -f ${.TARGET}
|
||||
ln -s ${.ALLSRC} ${.TARGET}
|
||||
.endfor
|
||||
|
||||
realall: ${BUILDSYMLINKS.t}
|
||||
|
||||
cleandir: cleanbuildsymlinks
|
||||
cleanbuildsymlinks: .PHONY
|
||||
rm -f ${BUILDSYMLINKS.t}
|
||||
|
||||
.endif # }
|
||||
|
||||
#
|
||||
# .uue -> "" handling (i.e. decode a given binary/object)
|
||||
#
|
||||
# UUDECODE_FILES - List of files which are stored in the source tree
|
||||
# as <file>.uue and should be uudecoded.
|
||||
#
|
||||
# UUDECODE_FILES_RENAME_fn - For this file, rename its output to the provided
|
||||
# name (handled via -p and redirecting stdout)
|
||||
|
||||
.if defined(UUDECODE_FILES) # {
|
||||
.SUFFIXES: .uue
|
||||
|
||||
.uue:
|
||||
${_MKTARGET_CREATE}
|
||||
rm -f ${.TARGET} ${.TARGET}.tmp
|
||||
${TOOL_UUDECODE} -p ${.IMPSRC} > ${.TARGET}.tmp \
|
||||
&& mv ${.TARGET}.tmp ${UUDECODE_FILES_RENAME_${.TARGET}:U${.TARGET}}
|
||||
|
||||
realall: ${UUDECODE_FILES}
|
||||
|
||||
CLEANUUDECODE_FILES=${UUDECODE_FILES} ${UUDECODE_FILES:=.tmp}
|
||||
.for i in ${UUDECODE_FILES}
|
||||
CLEANUUDECODE_FILES+=${UUDECODE_FILES_RENAME_${i}}
|
||||
.endfor
|
||||
|
||||
clean: cleanuudecodefiles
|
||||
cleanuudecodefiles: .PHONY
|
||||
rm -f ${CLEANUUDECODE_FILES}
|
||||
.endif # }
|
||||
|
||||
##### Pull in related .mk logic
|
||||
.include <bsd.obj.mk>
|
||||
#.include <bsd.sys.mk>
|
||||
|
||||
.endif # !defined(_MINIX_FILES_MK_)
|
||||
1
share/mk/bsd.gcc.mk
Normal file
1
share/mk/bsd.gcc.mk
Normal file
@@ -0,0 +1 @@
|
||||
AFLAGS+=-D__ASSEMBLY__ -D_EM_WSIZE=4 -D__minix
|
||||
67
share/mk/bsd.inc.mk
Normal file
67
share/mk/bsd.inc.mk
Normal file
@@ -0,0 +1,67 @@
|
||||
# $NetBSD: bsd.inc.mk,v 1.32 2006/03/16 18:43:34 jwise Exp $
|
||||
|
||||
.include <bsd.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)
|
||||
# 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
|
||||
13
share/mk/bsd.init.mk
Normal file
13
share/mk/bsd.init.mk
Normal file
@@ -0,0 +1,13 @@
|
||||
# $NetBSD: bsd.init.mk,v 1.2 2003/07/28 02:38:33 lukem Exp $
|
||||
|
||||
# <bsd.init.mk> includes Makefile.inc and <bsd.own.mk>; this is used at the
|
||||
# top of all <bsd.*.mk> files which actually "build something".
|
||||
|
||||
.if !defined(_MINIX_INIT_MK_)
|
||||
_MINIX_INIT_MK_=1
|
||||
|
||||
.-include "${.CURDIR}/../Makefile.inc"
|
||||
.include <bsd.own.mk>
|
||||
.MAIN: all
|
||||
|
||||
.endif # !defined(_MINIX_INIT_MK_)
|
||||
93
share/mk/bsd.kinc.mk
Normal file
93
share/mk/bsd.kinc.mk
Normal 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 <bsd.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 <bsd.subdir.mk>
|
||||
.include <bsd.sys.mk>
|
||||
69
share/mk/bsd.klinks.mk
Normal file
69
share/mk/bsd.klinks.mk
Normal file
@@ -0,0 +1,69 @@
|
||||
# $NetBSD: bsd.klinks.mk,v 1.6 2009/11/27 13:50:29 pooka Exp $
|
||||
#
|
||||
|
||||
.include <bsd.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
|
||||
162
share/mk/bsd.lib.mk
Normal file
162
share/mk/bsd.lib.mk
Normal file
@@ -0,0 +1,162 @@
|
||||
# $NetBSD: bsd.lib.mk,v 1.299 2009/11/27 11:44:36 tsutsui Exp $
|
||||
# @(#)bsd.lib.mk 8.3 (Berkeley) 4/22/94
|
||||
|
||||
.include <bsd.init.mk>
|
||||
|
||||
# Pull in <bsd.sys.mk> here so we can override its .c.o rule
|
||||
.include <bsd.sys.mk>
|
||||
|
||||
LIBISPRIVATE?= no
|
||||
|
||||
##### Minix rule to make the "install" target depend on
|
||||
##### "all" and "depend" targets
|
||||
realinstall: realall
|
||||
realall: depend
|
||||
|
||||
##### Basic targets
|
||||
.PHONY: libinstall
|
||||
realinstall: libinstall
|
||||
clean: cleanlib
|
||||
|
||||
|
||||
##### LIB specific flags.
|
||||
COPTS+= ${COPTS.lib${LIB}}
|
||||
CPPFLAGS+= ${CPPFLAGS.lib${LIB}}
|
||||
CXXFLAGS+= ${CXXFLAGS.lib${LIB}}
|
||||
OBJCOPTS+= ${OBJCOPTS.lib${LIB}}
|
||||
LDADD+= ${LDADD.lib${LIB}}
|
||||
LDFLAGS+= ${LDFLAGS.lib${LIB}}
|
||||
LDSTATIC+= ${LDSTATIC.lib${LIB}}
|
||||
|
||||
##### Libraries that this may depend upon.
|
||||
.if defined(LIBDPLIBS) && ${MKPIC} != "no" # {
|
||||
.for _lib _dir in ${LIBDPLIBS}
|
||||
.if !defined(LIBDO.${_lib})
|
||||
LIBDO.${_lib}!= cd ${_dir} && ${PRINTOBJDIR}
|
||||
.MAKEOVERRIDES+=LIBDO.${_lib}
|
||||
.endif
|
||||
LDADD+= -L${LIBDO.${_lib}} -l${_lib}
|
||||
DPADD+= ${LIBDO.${_lib}}/lib${_lib}.so
|
||||
.endfor
|
||||
.endif # }
|
||||
|
||||
##### Build and install rules
|
||||
MKDEP_SUFFIXES?= .o .po .so .go .ln
|
||||
|
||||
# add additional suffixes not exported.
|
||||
# .po is used for profiling object files.
|
||||
# .so is used for PIC object files.
|
||||
.SUFFIXES: .out .a .ln .so .po .go .o .s .S .c .cc .cpp .cxx .C .m .F .f .r .y .l .cl .p .h
|
||||
|
||||
CFLAGS+= ${COPTS}
|
||||
OBJCFLAGS+= ${OBJCOPTS}
|
||||
AFLAGS+= ${COPTS}
|
||||
FFLAGS+= ${FOPTS}
|
||||
|
||||
.c.o:
|
||||
${_MKTARGET_COMPILE}
|
||||
${COMPILE.c} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
|
||||
# .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
|
||||
# ${OBJCOPY} -x ${.TARGET}
|
||||
# .endif
|
||||
|
||||
.cc.o .cpp.o .cxx.o .C.o:
|
||||
${_MKTARGET_COMPILE}
|
||||
${COMPILE.cc} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
|
||||
# .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
|
||||
# ${OBJCOPY} -x ${.TARGET}
|
||||
# .endif
|
||||
|
||||
.s.o:
|
||||
${_MKTARGET_COMPILE}
|
||||
${COMPILE.s} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
|
||||
# ${OBJCOPY} -x ${.TARGET}
|
||||
|
||||
.S.o:
|
||||
${_MKTARGET_COMPILE}
|
||||
${COMPILE.S} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
|
||||
# ${OBJCOPY} -x ${.TARGET}
|
||||
|
||||
|
||||
.if defined(LIB) # {
|
||||
_LIBS=lib${LIB}.a
|
||||
.endif
|
||||
|
||||
OBJS+=${SRCS:N*.h:N*.sh:R:S/$/.o/g}
|
||||
|
||||
STOBJS+=${OBJS}
|
||||
|
||||
LOBJS+=${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
|
||||
|
||||
.if ${LIBISPRIVATE} != "no"
|
||||
# No installation is required
|
||||
libinstall::
|
||||
.endif # ${LIBISPRIVATE} == "no" # {
|
||||
|
||||
ALLOBJS=
|
||||
|
||||
ALLOBJS+=${STOBJS}
|
||||
|
||||
_YLSRCS= ${SRCS:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS:M*.y:.y=.h}}
|
||||
|
||||
.NOPATH: ${ALLOBJS} ${_LIBS} ${_YLSRCS}
|
||||
|
||||
realall: ${SRCS} ${ALLOBJS:O} ${_LIBS}
|
||||
|
||||
MKARZERO?=no
|
||||
|
||||
#_ARFL=crs
|
||||
_ARFL=cr
|
||||
|
||||
|
||||
__archivebuild: .USE
|
||||
${_MKTARGET_BUILD}
|
||||
rm -f ${.TARGET}
|
||||
# ${AR} ${_ARFL} ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
|
||||
${AR} ${_ARFL} ${.TARGET} ${.ALLSRC:M*o}
|
||||
|
||||
__archiveinstall: .USE
|
||||
${_MKTARGET_INSTALL}
|
||||
${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
|
||||
${_INSTRANLIB} ${.ALLSRC} ${.TARGET}
|
||||
|
||||
DPSRCS+= ${_YLSRCS}
|
||||
CLEANFILES+= ${_YLSRCS}
|
||||
|
||||
${STOBJS} ${POBJS} ${GOBJS} ${SOBJS} ${LOBJS}: ${DPSRCS}
|
||||
|
||||
lib${LIB}.a:: ${STOBJS} __archivebuild
|
||||
|
||||
cleanlib: .PHONY
|
||||
rm -f a.out [Ee]rrs mklog core *.core ${CLEANFILES}
|
||||
rm -f lib${LIB}.a ${STOBJS}
|
||||
|
||||
.if !target(libinstall) # {
|
||||
|
||||
libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.a
|
||||
.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.a
|
||||
${_MKTARGET_INSTALL}
|
||||
${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
|
||||
${.ALLSRC} ${.TARGET}
|
||||
|
||||
.if !defined(BUILD) && !make(all) && !make(lib${LIB}.a)
|
||||
${DESTDIR}${LIBDIR}/lib${LIB}.a: .MADE
|
||||
.endif
|
||||
${DESTDIR}${LIBDIR}/lib${LIB}.a: lib${LIB}.a __archiveinstall
|
||||
|
||||
.endif # !target(libinstall) # }
|
||||
|
||||
##### Pull in related .mk logic
|
||||
LINKSOWN?= ${LIBOWN}
|
||||
LINKSGRP?= ${LIBGRP}
|
||||
LINKSMODE?= ${LIBMODE}
|
||||
.include <bsd.files.mk>
|
||||
.include <bsd.inc.mk>
|
||||
.include <bsd.links.mk>
|
||||
.include <bsd.dep.mk>
|
||||
|
||||
.if ${COMPILER_TYPE} == "ack"
|
||||
.include <bsd.ack.mk>
|
||||
.elif ${COMPILER_TYPE} == "gnu"
|
||||
.include <bsd.gcc.mk>
|
||||
.endif
|
||||
96
share/mk/bsd.links.mk
Normal file
96
share/mk/bsd.links.mk
Normal file
@@ -0,0 +1,96 @@
|
||||
# $NetBSD: bsd.links.mk,v 1.34 2009/04/10 16:16:12 apb Exp $
|
||||
|
||||
.include <bsd.init.mk>
|
||||
|
||||
##### Basic targets
|
||||
install: linksinstall
|
||||
|
||||
##### Default values
|
||||
LINKS?=
|
||||
SYMLINKS?=
|
||||
LINKSOWN?= ${BINOWN}
|
||||
LINKSGRP?= ${BINGRP}
|
||||
LINKSMODE?= ${NONBINMODE}
|
||||
|
||||
__linkinstall: .USE
|
||||
${_MKSHMSG_INSTALL} ${.TARGET}; \
|
||||
${_MKSHECHO} "${INSTALL_LINK} \
|
||||
-o ${LINKSOWN_${.ALLSRC:T}:U${LINKSOWN}} \
|
||||
-g ${LINKSGRP_${.ALLSRC:T}:U${LINKSGRP}} \
|
||||
-m ${LINKSMODE_${.ALLSRC:T}:U${LINKSMODE}} \
|
||||
${.ALLSRC} ${.TARGET}" && \
|
||||
${INSTALL_LINK} \
|
||||
-o ${LINKSOWN_${.ALLSRC:T}:U${LINKSOWN}} \
|
||||
-g ${LINKSGRP_${.ALLSRC:T}:U${LINKSGRP}} \
|
||||
-m ${LINKSMODE_${.ALLSRC:T}:U${LINKSMODE}} \
|
||||
${.ALLSRC} ${.TARGET}
|
||||
|
||||
##### Install rules
|
||||
.PHONY: linksinstall
|
||||
linksinstall:: realinstall
|
||||
.if !empty(SYMLINKS)
|
||||
@(set ${SYMLINKS}; \
|
||||
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
|
||||
|
||||
.for _src _dst in ${LINKS}
|
||||
_l:=${DESTDIR}${_src}
|
||||
_t:=${DESTDIR}${_dst}
|
||||
|
||||
# Handle case conflicts carefully, when _dst occurs
|
||||
# more than once after case flattening
|
||||
.if ${MKUPDATE} == "no" || ${LINKS:tl:M${_dst:tl:Q}:[\#]} > 1
|
||||
${_t}! ${_l} __linkinstall
|
||||
.else
|
||||
${_t}: ${_l} __linkinstall
|
||||
.endif
|
||||
|
||||
linksinstall:: ${_t}
|
||||
.PRECIOUS: ${_t}
|
||||
.endfor
|
||||
|
||||
configinstall: configlinksinstall
|
||||
.PHONY: configlinksinstall
|
||||
configlinksinstall:: configfilesinstall
|
||||
.if !empty(CONFIGSYMLINKS)
|
||||
@(set ${CONFIGSYMLINKS}; \
|
||||
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
|
||||
|
||||
.for _src _dst in ${CONFIGLINKS}
|
||||
_l:=${DESTDIR}${_src}
|
||||
_t:=${DESTDIR}${_dst}
|
||||
|
||||
# Handle case conflicts carefully, when _dst occurs
|
||||
# more than once after case flattening
|
||||
.if ${MKUPDATE} == "no" || ${CONFIGLINKS:tl:M${_dst:tl:Q}:[\#]} > 1
|
||||
${_t}! ${_l} __linkinstall
|
||||
.else
|
||||
${_t}: ${_l} __linkinstall
|
||||
.endif
|
||||
|
||||
configlinksinstall:: ${_t}
|
||||
.PRECIOUS: ${_t}
|
||||
.endfor
|
||||
|
||||
.include <bsd.sys.mk>
|
||||
288
share/mk/bsd.man.mk
Normal file
288
share/mk/bsd.man.mk
Normal file
@@ -0,0 +1,288 @@
|
||||
# $NetBSD: bsd.man.mk,v 1.102 2009/10/23 23:12:10 joerg Exp $
|
||||
# @(#)bsd.man.mk 8.1 (Berkeley) 6/8/93
|
||||
|
||||
.include <bsd.init.mk>
|
||||
|
||||
##### Basic targets
|
||||
.PHONY: maninstall manpages manlinks
|
||||
#.PHONY: catinstall maninstall catpages manpages catlinks manlinks
|
||||
#.PHONY: htmlinstall htmlpages htmllinks
|
||||
.if ${MKMANDOC} == "yes"
|
||||
.PHONY: lintmanpages
|
||||
.endif
|
||||
realinstall: ${MANINSTALL}
|
||||
|
||||
##### Default values
|
||||
# .if ${USETOOLS} == "yes"
|
||||
# TMACDEPDIR?= ${TOOLDIR}/share/groff/tmac
|
||||
# .else
|
||||
# TMACDEPDIR?= /usr/share/tmac
|
||||
# .endif
|
||||
|
||||
# HTMLDIR?= ${DESTDIR}${MANDIR}
|
||||
# CATDEPS?= ${TMACDEPDIR}/andoc.tmac \
|
||||
# ${TMACDEPDIR}/doc.tmac \
|
||||
# ${TMACDEPDIR}/mdoc/doc-common \
|
||||
# ${TMACDEPDIR}/mdoc/doc-ditroff \
|
||||
# ${TMACDEPDIR}/mdoc/doc-nroff \
|
||||
# ${TMACDEPDIR}/mdoc/doc-syms
|
||||
# HTMLDEPS?= ${TMACDEPDIR}/doc2html.tmac
|
||||
# MANTARGET?= cat
|
||||
|
||||
# MAN?=
|
||||
# MLINKS?=
|
||||
# _MNUMBERS= 1 2 3 4 5 6 7 8 9
|
||||
# .SUFFIXES: ${_MNUMBERS:@N@.$N@}
|
||||
|
||||
# .if ${MKMANZ} == "no"
|
||||
# MANCOMPRESS?=
|
||||
# MANSUFFIX?=
|
||||
# .else
|
||||
# MANCOMPRESS?= gzip -ncf
|
||||
# MANSUFFIX?= .gz
|
||||
# .endif
|
||||
|
||||
# make MANCOMPRESS a filter, so it can be inserted on an as-needed basis
|
||||
.if !empty(MANCOMPRESS)
|
||||
MANCOMPRESS:= | ${MANCOMPRESS}
|
||||
.endif
|
||||
|
||||
__installpage: .USE
|
||||
@cmp -s ${.ALLSRC} ${.TARGET} > /dev/null 2>&1 || \
|
||||
(${_MKSHMSG_INSTALL} ${.TARGET}; \
|
||||
${_MKSHECHO} "${INSTALL_FILE} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} \
|
||||
${.ALLSRC} ${.TARGET}" && \
|
||||
${INSTALL_FILE} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} \
|
||||
${.ALLSRC} ${.TARGET})
|
||||
|
||||
# XXX consider including bsd.links.mk and using __linkinstall instead
|
||||
__linkinstallpage: .USE
|
||||
${_MKSHMSG_INSTALL} ${.TARGET}; \
|
||||
${_MKSHECHO} "${INSTALL_LINK} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} \
|
||||
${.ALLSRC} ${.TARGET}" && \
|
||||
${INSTALL_LINK} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} \
|
||||
${.ALLSRC} ${.TARGET}
|
||||
|
||||
##### Build and install rules (source form pages)
|
||||
|
||||
.if ${MKMAN} != "no"
|
||||
maninstall: manpages manlinks
|
||||
manpages:: # ensure target exists
|
||||
MANPAGES= ${MAN:C/.$/&${MANSUFFIX}/}
|
||||
|
||||
realall: ${MANPAGES}
|
||||
.if !empty(MANSUFFIX)
|
||||
.NOPATH: ${MANPAGES}
|
||||
.SUFFIXES: ${_MNUMBERS:@N@.$N${MANSUFFIX}@}
|
||||
|
||||
${_MNUMBERS:@N@.$N.$N${MANSUFFIX}@}: # build rule
|
||||
${_MKTARGET_FORMAT}
|
||||
cat ${.IMPSRC} ${MANCOMPRESS} > ${.TARGET}.tmp && mv ${.TARGET}.tmp ${.TARGET}
|
||||
.endif # !empty(MANSUFFIX)
|
||||
|
||||
.for F in ${MANPAGES:S/${MANSUFFIX}$//:O:u}
|
||||
_F:= ${DESTDIR}${MANDIR}/man${F:T:E}${MANSUBDIR}/${F}${MANSUFFIX}
|
||||
|
||||
.if ${MKUPDATE} == "no"
|
||||
${_F}! ${F}${MANSUFFIX} __installpage # install rule
|
||||
.if !defined(BUILD) && !make(all) && !make(${F})
|
||||
${_F}! .MADE # no build at install
|
||||
.endif
|
||||
.else
|
||||
${_F}: ${F}${MANSUFFIX} __installpage # install rule
|
||||
.if !defined(BUILD) && !make(all) && !make(${F})
|
||||
${_F}: .MADE # no build at install
|
||||
.endif
|
||||
.endif
|
||||
|
||||
manpages:: ${_F}
|
||||
.PRECIOUS: ${_F} # keep if install fails
|
||||
.endfor
|
||||
|
||||
manlinks:: # link install
|
||||
|
||||
.for _src _dst in ${MLINKS}
|
||||
_l:=${DESTDIR}${MANDIR}/man${_src:T:E}${MANSUBDIR}/${_src}${MANSUFFIX}
|
||||
_t:=${DESTDIR}${MANDIR}/man${_dst:T:E}${MANSUBDIR}/${_dst}${MANSUFFIX}
|
||||
|
||||
# Handle case conflicts carefully, when _dst occurs
|
||||
# more than once after case flattening
|
||||
.if ${MKUPDATE} == "no" || ${MLINKS:tl:M${_dst:tl:Q}:[\#]} > 1
|
||||
${_t}! ${_l} __linkinstallpage
|
||||
.else
|
||||
${_t}: ${_l} __linkinstallpage
|
||||
.endif
|
||||
|
||||
manlinks:: ${_t}
|
||||
.PRECIOUS: ${_t}
|
||||
.endfor
|
||||
.endif # ${MKMAN} != "no"
|
||||
|
||||
# ##### Build and install rules (plaintext pages)
|
||||
|
||||
# .if (${MKCATPAGES} != "no") && (${MKMAN} != "no")
|
||||
# catinstall: catpages catlinks
|
||||
# catpages:: # ensure target exists
|
||||
# CATPAGES= ${MAN:C/\.([1-9])$/.cat\1${MANSUFFIX}/}
|
||||
|
||||
# realall: ${CATPAGES}
|
||||
# .NOPATH: ${CATPAGES}
|
||||
# .SUFFIXES: ${_MNUMBERS:@N@.cat$N${MANSUFFIX}@}
|
||||
# .MADE: ${CATDEPS}
|
||||
|
||||
# ${_MNUMBERS:@N@.$N.cat$N${MANSUFFIX}@}: ${CATDEPS} # build rule
|
||||
# ${_MKTARGET_FORMAT}
|
||||
# .if defined(USETBL)
|
||||
# ${TOOL_TBL} ${.IMPSRC} | ${TOOL_ROFF_ASCII} -mandoc ${MANCOMPRESS} \
|
||||
# > ${.TARGET}.tmp && mv ${.TARGET}.tmp ${.TARGET}
|
||||
# .elif ${MKMANDOC} == yes && !defined(NOMANDOC)
|
||||
# if test ""${NOMANDOC.${.IMPSRC:T}:tl:Q} != "yes"; then \
|
||||
# ${TOOL_MANDOC_ASCII} ${.IMPSRC} ${MANCOMPRESS} \
|
||||
# > ${.TARGET}.tmp && mv ${.TARGET}.tmp ${.TARGET}; \
|
||||
# else \
|
||||
# ${TOOL_ROFF_ASCII} -mandoc ${.IMPSRC} ${MANCOMPRESS} \
|
||||
# > ${.TARGET}.tmp && mv ${.TARGET}.tmp ${.TARGET}; \
|
||||
# fi
|
||||
# .else
|
||||
# ${TOOL_ROFF_ASCII} -mandoc ${.IMPSRC} ${MANCOMPRESS} \
|
||||
# > ${.TARGET}.tmp && mv ${.TARGET}.tmp ${.TARGET}
|
||||
# .endif
|
||||
|
||||
# .for F in ${CATPAGES:S/${MANSUFFIX}$//:O:u}
|
||||
# _F:= ${DESTDIR}${MANDIR}/${F:T:E}${MANSUBDIR}/${F:R}.0${MANSUFFIX}
|
||||
|
||||
# .if ${MKUPDATE} == "no"
|
||||
# ${_F}! ${F}${MANSUFFIX} __installpage # install rule
|
||||
# .if !defined(BUILD) && !make(all) && !make(${F})
|
||||
# ${_F}! .MADE # no build at install
|
||||
# .endif
|
||||
# .else
|
||||
# ${_F}: ${F}${MANSUFFIX} __installpage # install rule
|
||||
# .if !defined(BUILD) && !make(all) && !make(${F})
|
||||
# ${_F}: .MADE # no build at install
|
||||
# .endif
|
||||
# .endif
|
||||
|
||||
# catpages:: ${_F}
|
||||
# .PRECIOUS: ${_F} # keep if install fails
|
||||
# .endfor
|
||||
|
||||
# catlinks:: # link install
|
||||
|
||||
# .for _src _dst in ${MLINKS}
|
||||
# _l:=${DESTDIR}${MANDIR}/cat${_src:T:E}${MANSUBDIR}/${_src:R}.0${MANSUFFIX}
|
||||
# _t:=${DESTDIR}${MANDIR}/cat${_dst:T:E}${MANSUBDIR}/${_dst:R}.0${MANSUFFIX}
|
||||
|
||||
# # Handle case conflicts carefully, when _dst occurs
|
||||
# # more than once after case flattening
|
||||
# .if ${MKUPDATE} == "no" || ${MLINKS:tl:M${_dst:tl:Q}:[\#]} > 1
|
||||
# ${_t}! ${_l} __linkinstallpage
|
||||
# .else
|
||||
# ${_t}: ${_l} __linkinstallpage
|
||||
# .endif
|
||||
|
||||
# catlinks:: ${_t}
|
||||
# .PRECIOUS: ${_t}
|
||||
# .endfor
|
||||
# .endif # (${MKCATPAGES} != "no") && (${MKMAN} != "no")
|
||||
|
||||
# ##### Build and install rules (HTML pages)
|
||||
|
||||
# .if (${MKHTML} != "no") && (${MKMAN} != "no") # {
|
||||
# htmlinstall: htmlpages htmllinks
|
||||
# htmlpages:: # ensure target exists
|
||||
# HTMLPAGES= ${MAN:C/\.([1-9])$/.html\1/}
|
||||
|
||||
# realall: ${HTMLPAGES}
|
||||
# .NOPATH: ${HTMLPAGES}
|
||||
# .SUFFIXES: ${_MNUMBERS:@N@.html$N@}
|
||||
# .MADE: ${HTMLDEPS}
|
||||
|
||||
# ${_MNUMBERS:@N@.$N.html$N@}: ${HTMLDEPS} # build rule
|
||||
# ${_MKTARGET_FORMAT}
|
||||
# .if ${MKMANDOC} == "yes" && !defined(NOMANDOC)
|
||||
# if test ""${NOMANDOC.${.IMPSRC:T}:tl:Q} != "yes"; then \
|
||||
# ${TOOL_MANDOC_HTML} ${.IMPSRC} > ${.TARGET}.tmp && \
|
||||
# mv ${.TARGET}.tmp ${.TARGET}; \
|
||||
# else \
|
||||
# ${TOOL_ROFF_HTML} ${.IMPSRC} > ${.TARGET}.tmp && \
|
||||
# mv ${.TARGET}.tmp ${.TARGET}; \
|
||||
# fi
|
||||
# .else
|
||||
# ${TOOL_ROFF_HTML} ${.IMPSRC} > ${.TARGET}.tmp && \
|
||||
# mv ${.TARGET}.tmp ${.TARGET}
|
||||
# .endif
|
||||
|
||||
# .for F in ${HTMLPAGES:O:u}
|
||||
# # construct installed path
|
||||
# _F:= ${HTMLDIR}/${F:T:E}${MANSUBDIR}/${F:R:S-/index$-/x&-}.html
|
||||
|
||||
# .if ${MKUPDATE} == "no"
|
||||
# ${_F}! ${F} __installpage # install rule
|
||||
# .if !defined(BUILD) && !make(all) && !make(${F})
|
||||
# ${_F}! .MADE # no build at install
|
||||
# .endif
|
||||
# .else
|
||||
# ${_F}: ${F} __installpage # install rule
|
||||
# .if !defined(BUILD) && !make(all) && !make(${F})
|
||||
# ${_F}: .MADE # no build at install
|
||||
# .endif
|
||||
# .endif
|
||||
|
||||
# htmlpages:: ${_F}
|
||||
# .PRECIOUS: ${_F} # keep if install fails
|
||||
# .endfor
|
||||
|
||||
# htmllinks:: # link install
|
||||
|
||||
# .for _src _dst in ${MLINKS}
|
||||
# _l:=${HTMLDIR}/html${_src:T:E}${MANSUBDIR}/${_src:R:S-/index$-/x&-}.html
|
||||
# _t:=${HTMLDIR}/html${_dst:T:E}${MANSUBDIR}/${_dst:R:S-/index$-/x&-}.html
|
||||
|
||||
# # Handle case conflicts carefully, when _dst occurs
|
||||
# # more than once after case flattening
|
||||
# .if ${MKUPDATE} == "no" || ${MLINKS:tl:M${_dst:tl:Q}:[\#]} > 1
|
||||
# ${_t}! ${_l} __linkinstallpage
|
||||
# .else
|
||||
# ${_t}: ${_l} __linkinstallpage
|
||||
# .endif
|
||||
|
||||
# htmllinks:: ${_t}
|
||||
# .PRECIOUS: ${_t}
|
||||
# .endfor
|
||||
|
||||
# .endif # }
|
||||
|
||||
##### Clean rules
|
||||
.undef _F
|
||||
|
||||
cleandir: cleanman
|
||||
.if !empty(CLEANFILES)
|
||||
rm -f ${CLEANFILES}
|
||||
.endif
|
||||
|
||||
cleanman: .PHONY
|
||||
.if !empty(MAN) && (${MKMAN} != "no")
|
||||
.if (${MKCATPAGES} != "no")
|
||||
rm -f ${CATPAGES}
|
||||
.endif
|
||||
.if !empty(MANSUFFIX)
|
||||
rm -f ${MANPAGES} ${CATPAGES:S/${MANSUFFIX}$//}
|
||||
.endif
|
||||
.if ${MKHTML} != "no"
|
||||
rm -f ${HTMLPAGES}
|
||||
.endif
|
||||
.endif
|
||||
# (XXX ${CATPAGES:S...} cleans up old .catN files where .catN.gz now used)
|
||||
|
||||
# .if ${MKMANDOC} == "yes" && !empty(MANPAGES)
|
||||
# lintmanpages: ${MANPAGES}
|
||||
# ${TOOL_MANDOC_LINT} -Tlint -fstrict ${.ALLSRC}
|
||||
# .endif
|
||||
|
||||
##### Pull in related .mk logic
|
||||
.include <bsd.obj.mk>
|
||||
.include <bsd.files.mk>
|
||||
.include <bsd.sys.mk>
|
||||
|
||||
${TARGETS} catinstall maninstall htmlinstall: # ensure existence
|
||||
109
share/mk/bsd.obj.mk
Normal file
109
share/mk/bsd.obj.mk
Normal file
@@ -0,0 +1,109 @@
|
||||
# $NetBSD: bsd.obj.mk,v 1.48 2007/12/11 14:06:04 lukem Exp $
|
||||
|
||||
.if !defined(_MINIX_OBJ_MK_)
|
||||
_MINIX_OBJ_MK_=1
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
__curdir:= ${.CURDIR}
|
||||
|
||||
.if ${MKOBJ} == "no"
|
||||
obj:
|
||||
.else
|
||||
.if defined(MAKEOBJDIRPREFIX) || defined(MAKEOBJDIR)
|
||||
.if defined(MAKEOBJDIRPREFIX)
|
||||
__objdir:= ${MAKEOBJDIRPREFIX}${__curdir}
|
||||
.else
|
||||
__objdir:= ${MAKEOBJDIR}
|
||||
.endif
|
||||
# MAKEOBJDIR and MAKEOBJDIRPREFIX are env variables supported
|
||||
# by make(1). We simply mkdir -p the specified path.
|
||||
# If that fails - we do a mkdir to get the appropriate error message
|
||||
# before bailing out.
|
||||
obj:
|
||||
.if defined(MAKEOBJDIRPREFIX)
|
||||
@if [ ! -d ${MAKEOBJDIRPREFIX} ]; then \
|
||||
echo "MAKEOBJDIRPREFIX ${MAKEOBJDIRPREFIX} does not exist, bailing..."; \
|
||||
exit 1; \
|
||||
fi;
|
||||
.endif
|
||||
@if [ ! -d ${__objdir} ]; then \
|
||||
mkdir -p ${__objdir}; \
|
||||
if [ ! -d ${__objdir} ]; then \
|
||||
mkdir ${__objdir}; exit 1; \
|
||||
fi; \
|
||||
${_MKSHMSG} " objdir ${__objdir}"; \
|
||||
fi
|
||||
.else
|
||||
PAWD?= /bin/pwd
|
||||
|
||||
__objdir= obj${OBJMACHINE:D.${MACHINE}}
|
||||
|
||||
__usrobjdir= ${BSDOBJDIR}${USR_OBJMACHINE:D.${MACHINE}}
|
||||
__usrobjdirpf= ${USR_OBJMACHINE:D:U${OBJMACHINE:D.${MACHINE}}}
|
||||
|
||||
.if defined(BUILDID)
|
||||
__objdir:= ${__objdir}.${BUILDID}
|
||||
__usrobjdirpf:= ${__usrobjdirpf}.${BUILDID}
|
||||
__need_objdir_target=yes
|
||||
.endif
|
||||
|
||||
.if defined(OBJHOSTMACHINE) && (${MKHOSTOBJ:Uno} != "no")
|
||||
# In case .CURDIR has been twiddled by a .mk file and is now relative,
|
||||
# make it absolute again.
|
||||
.if ${__curdir:M/*} == ""
|
||||
__curdir!= cd ${__curdir} && ${PAWD}
|
||||
.endif
|
||||
|
||||
__objdir:= ${__objdir}.${HOST_OSTYPE}
|
||||
__usrobjdirpf:= ${__usrobjdirpf}.${HOST_OSTYPE}
|
||||
__need_objdir_target=yes
|
||||
.endif
|
||||
|
||||
.if defined(__need_objdir_target)
|
||||
# Get make to change its internal definition of .OBJDIR
|
||||
.OBJDIR: ${__objdir}
|
||||
.endif
|
||||
|
||||
obj:
|
||||
@cd ${__curdir}; \
|
||||
here=`${PAWD}`/; subdir=$${here#${BSDSRCDIR}/}; \
|
||||
if [ "$$here" != "$$subdir" ]; then \
|
||||
if [ ! -d ${__usrobjdir} ]; then \
|
||||
echo "BSDOBJDIR ${__usrobjdir} does not exist, bailing..."; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
subdir=$${subdir%/}; \
|
||||
dest=${__usrobjdir}/$$subdir${__usrobjdirpf}; \
|
||||
if [ -x ${TOOL_STAT} ] && \
|
||||
ttarg=`${TOOL_STAT} -qf '%Y' $${here}${__objdir}` && \
|
||||
[ "$$dest" = "$$ttarg" ]; then \
|
||||
: ; \
|
||||
else \
|
||||
${_MKSHMSG} " objdir $$dest"; \
|
||||
rm -rf ${__objdir}; \
|
||||
ln -s $$dest ${__objdir}; \
|
||||
fi; \
|
||||
if [ ! -d $$dest ]; then \
|
||||
mkdir -p $$dest; \
|
||||
else \
|
||||
true; \
|
||||
fi; \
|
||||
else \
|
||||
true ; \
|
||||
dest=$${here}${__objdir} ; \
|
||||
if [ ! -d ${__objdir} ] || [ -h ${__objdir} ]; then \
|
||||
${_MKSHMSG} " objdir $$dest"; \
|
||||
rm -f ${__objdir}; \
|
||||
mkdir $$dest; \
|
||||
fi ; \
|
||||
fi;
|
||||
.endif
|
||||
.endif
|
||||
|
||||
print-objdir:
|
||||
@echo ${.OBJDIR}
|
||||
|
||||
.include <bsd.sys.mk>
|
||||
|
||||
.endif # !defined(_MINIX_OBJ_MK_)
|
||||
958
share/mk/bsd.own.mk
Normal file
958
share/mk/bsd.own.mk
Normal file
@@ -0,0 +1,958 @@
|
||||
# $NetBSD: bsd.own.mk,v 1.603 2009/12/06 16:15:15 uebayasi Exp $
|
||||
|
||||
.if !defined(_MINIX_OWN_MK_)
|
||||
_MINIX_OWN_MK_=1
|
||||
|
||||
MAKECONF?= /etc/make.conf
|
||||
.-include "${MAKECONF}"
|
||||
|
||||
#
|
||||
# CPU model, derived from MACHINE_ARCH
|
||||
#
|
||||
MACHINE_CPU= ${MACHINE_ARCH:C/mipse[bl]/mips/:C/mips64e[bl]/mips/:C/sh3e[bl]/sh3/:S/m68000/m68k/:S/armeb/arm/}
|
||||
|
||||
#
|
||||
# Subdirectory used below ${RELEASEDIR} when building a release
|
||||
#
|
||||
RELEASEMACHINEDIR?= ${MACHINE}
|
||||
|
||||
#
|
||||
# Subdirectory or path component used for the following paths:
|
||||
# distrib/${RELEASEMACHINE}
|
||||
# distrib/notes/${RELEASEMACHINE}
|
||||
# etc/etc.${RELEASEMACHINE}
|
||||
# Used when building a release.
|
||||
#
|
||||
RELEASEMACHINE?= ${MACHINE}
|
||||
|
||||
#
|
||||
# NEED_OWN_INSTALL_TARGET is set to "no" by pkgsrc/mk/bsd.pkg.mk to
|
||||
# ensure that things defined by <bsd.own.mk> (default targets,
|
||||
# INSTALL_FILE, etc.) are not conflicting with bsd.pkg.mk.
|
||||
#
|
||||
NEED_OWN_INSTALL_TARGET?= yes
|
||||
|
||||
#
|
||||
# This lists the platforms which do not have working in-tree toolchains.
|
||||
# For the in-tree gcc 3.3.2 toolchain, this list is empty.
|
||||
# If some future port is not supported by the in-tree toolchain, this
|
||||
# should be set to "yes" for that port only.
|
||||
#
|
||||
TOOLCHAIN_MISSING?= no
|
||||
|
||||
# default to GCC4
|
||||
.if !defined(HAVE_GCC) && !defined(HAVE_PCC)
|
||||
HAVE_GCC= 4
|
||||
.endif
|
||||
|
||||
# default to GDB6
|
||||
HAVE_GDB?= 6
|
||||
|
||||
# default to binutils 2.19
|
||||
HAVE_BINUTILS?= 219
|
||||
|
||||
CPPFLAG_ISYSTEM= -isystem
|
||||
.if defined(HAVE_GCC)
|
||||
.if ${HAVE_GCC} == 3
|
||||
CPPFLAG_ISYSTEMXX= -isystem-cxx
|
||||
.else # GCC 4
|
||||
CPPFLAG_ISYSTEMXX= -cxx-isystem
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.if empty(.MAKEFLAGS:M-V*)
|
||||
.if defined(MAKEOBJDIRPREFIX) || defined(MAKEOBJDIR)
|
||||
PRINTOBJDIR= ${MAKE} -r -V .OBJDIR -f /dev/null xxx
|
||||
.else
|
||||
PRINTOBJDIR= ${MAKE} -V .OBJDIR
|
||||
.endif
|
||||
.else
|
||||
PRINTOBJDIR= echo # prevent infinite recursion
|
||||
.endif
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Determine if running in the MINIX source tree by checking for the
|
||||
# existence of boot/ and tools/ in the current or a parent directory,
|
||||
# and setting _MSRC_TOP_ to the result.
|
||||
#
|
||||
.if !defined(_MSRC_TOP_) # {
|
||||
_MSRC_TOP_!= cd ${.CURDIR}; while :; do \
|
||||
here=`pwd`; \
|
||||
[ -d boot ] && [ -d tools ] && { echo $$here; break; }; \
|
||||
case $$here in /) echo ""; break;; esac; \
|
||||
cd ..; done
|
||||
|
||||
.MAKEOVERRIDES+= _MSRC_TOP_
|
||||
|
||||
.endif # }
|
||||
|
||||
#
|
||||
# If _MSRC_TOP_ != "", we're within the MINIX source tree, so set
|
||||
# defaults for MINIXSRCDIR and _MSRC_TOP_OBJ_.
|
||||
#
|
||||
.if (${_MSRC_TOP_} != "") # {
|
||||
|
||||
MINIXSRCDIR?= ${_MSRC_TOP_}
|
||||
|
||||
.if !defined(_MSRC_TOP_OBJ_)
|
||||
_MSRC_TOP_OBJ_!= cd ${_MSRC_TOP_} && ${PRINTOBJDIR}
|
||||
.MAKEOVERRIDES+= _MSRC_TOP_OBJ_
|
||||
.endif
|
||||
|
||||
.endif # _MSRC_TOP_ != "" # }
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Determine if running in the NetBSD source tree by checking for the
|
||||
# existence of build.sh and tools/ in the current or a parent directory,
|
||||
# and setting _SRC_TOP_ to the result.
|
||||
#
|
||||
.if !defined(_SRC_TOP_) # {
|
||||
_SRC_TOP_!= cd ${.CURDIR}; while :; do \
|
||||
here=`pwd`; \
|
||||
[ -f build.sh ] && [ -d tools ] && { echo $$here; break; }; \
|
||||
case $$here in /) echo ""; break;; esac; \
|
||||
cd ..; done
|
||||
|
||||
.MAKEOVERRIDES+= _SRC_TOP_
|
||||
|
||||
.endif # }
|
||||
|
||||
#
|
||||
# If _SRC_TOP_ != "", we're within the NetBSD source tree, so set
|
||||
# defaults for NETBSDSRCDIR and _SRC_TOP_OBJ_.
|
||||
#
|
||||
.if (${_SRC_TOP_} != "") # {
|
||||
|
||||
NETBSDSRCDIR?= ${_SRC_TOP_}
|
||||
|
||||
.if !defined(_SRC_TOP_OBJ_)
|
||||
_SRC_TOP_OBJ_!= cd ${_SRC_TOP_} && ${PRINTOBJDIR}
|
||||
.MAKEOVERRIDES+= _SRC_TOP_OBJ_
|
||||
.endif
|
||||
|
||||
.endif # _SRC_TOP_ != "" # }
|
||||
|
||||
|
||||
.if (${_SRC_TOP_} != "") && \
|
||||
(${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN))
|
||||
USETOOLS?= yes
|
||||
.endif
|
||||
USETOOLS?= no
|
||||
|
||||
|
||||
.if ${MACHINE_ARCH} == "mips" || ${MACHINE_ARCH} == "mips64" || \
|
||||
${MACHINE_ARCH} == "sh3"
|
||||
.BEGIN:
|
||||
@echo "Must set MACHINE_ARCH to one of ${MACHINE_ARCH}eb or ${MACHINE_ARCH}el"
|
||||
@false
|
||||
.elif defined(REQUIRETOOLS) && \
|
||||
(${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN)) && \
|
||||
${USETOOLS} == "no"
|
||||
.BEGIN:
|
||||
@echo "USETOOLS=no, but this component requires a version-specific host toolchain"
|
||||
@false
|
||||
.endif
|
||||
|
||||
#
|
||||
# Host platform information; may be overridden
|
||||
#
|
||||
.if !defined(HOST_OSTYPE)
|
||||
_HOST_OSNAME!= uname -s
|
||||
_HOST_OSREL!= uname -r
|
||||
# For _HOST_ARCH, if uname -p fails, or prints "unknown", or prints
|
||||
# something that does not look like an identifier, then use uname -m.
|
||||
_HOST_ARCH!= uname -p 2>/dev/null
|
||||
_HOST_ARCH:= ${HOST_ARCH:tW:C/.*[^-_A-Za-z0-9].*//:S/unknown//}
|
||||
.if empty(_HOST_ARCH)
|
||||
_HOST_ARCH!= uname -m
|
||||
.endif
|
||||
HOST_OSTYPE:= ${_HOST_OSNAME}-${_HOST_OSREL:C/\([^\)]*\)//g:[*]:C/ /_/g}-${_HOST_ARCH:C/\([^\)]*\)//g:[*]:C/ /_/g}
|
||||
.MAKEOVERRIDES+= HOST_OSTYPE
|
||||
.endif # !defined(HOST_OSTYPE)
|
||||
|
||||
.if ${USETOOLS} == "yes" # {
|
||||
|
||||
#
|
||||
# Provide a default for TOOLDIR.
|
||||
#
|
||||
.if !defined(TOOLDIR)
|
||||
TOOLDIR:= ${_SRC_TOP_OBJ_}/tooldir.${HOST_OSTYPE}
|
||||
.MAKEOVERRIDES+= TOOLDIR
|
||||
.endif
|
||||
|
||||
#
|
||||
# This is the prefix used for the NetBSD-sourced tools.
|
||||
#
|
||||
_TOOL_PREFIX?= nb
|
||||
|
||||
#
|
||||
# If an external toolchain base is specified, use it.
|
||||
#
|
||||
.if defined(EXTERNAL_TOOLCHAIN) # {
|
||||
AR= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ar
|
||||
AS= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-as
|
||||
LD= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ld
|
||||
NM= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-nm
|
||||
OBJCOPY= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objcopy
|
||||
OBJDUMP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objdump
|
||||
RANLIB= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ranlib
|
||||
SIZE= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-size
|
||||
STRIP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-strip
|
||||
|
||||
CC= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
|
||||
CPP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-cpp
|
||||
CXX= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-c++
|
||||
FC= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-g77
|
||||
OBJC= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
|
||||
.else # } {
|
||||
# Define default locations for common tools.
|
||||
.if ${USETOOLS_BINUTILS:Uyes} == "yes" # {
|
||||
AR= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ar
|
||||
AS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-as
|
||||
LD= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ld
|
||||
NM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-nm
|
||||
OBJCOPY= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objcopy
|
||||
OBJDUMP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objdump
|
||||
RANLIB= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ranlib
|
||||
SIZE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-size
|
||||
STRIP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strip
|
||||
.endif # }
|
||||
|
||||
.if defined(HAVE_GCC) && ${USETOOLS_GCC:Uyes} == "yes" # {
|
||||
CC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
|
||||
CPP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-cpp
|
||||
CXX= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-c++
|
||||
FC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-g77
|
||||
OBJC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
|
||||
.endif # }
|
||||
|
||||
.if defined(HAVE_PCC) && ${USETOOLS_PCC:Uyes} == "yes"
|
||||
CC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-pcc
|
||||
CPP= ${TOOLDIR}/libexec/${MACHINE_GNU_PLATFORM}-cpp
|
||||
CXX= false
|
||||
FC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-f77
|
||||
OBJC= false
|
||||
.endif
|
||||
|
||||
.endif # EXTERNAL_TOOLCHAIN # }
|
||||
|
||||
HOST_MKDEP= ${TOOLDIR}/bin/${_TOOL_PREFIX}host-mkdep
|
||||
|
||||
DBSYM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-dbsym
|
||||
ELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff
|
||||
INSTALL= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-install
|
||||
LEX= ${TOOLDIR}/bin/${_TOOL_PREFIX}lex
|
||||
LINT= CC=${CC:Q} ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-lint
|
||||
LORDER= NM=${NM:Q} MKTEMP=${TOOL_MKTEMP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}lorder
|
||||
MKDEP= CC=${CC:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}mkdep
|
||||
PAXCTL= ${TOOLDIR}/bin/${_TOOL_PREFIX}paxctl
|
||||
TSORT= ${TOOLDIR}/bin/${_TOOL_PREFIX}tsort -q
|
||||
YACC= ${TOOLDIR}/bin/${_TOOL_PREFIX}yacc
|
||||
|
||||
TOOL_AMIGAAOUT2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-aout2bb
|
||||
TOOL_AMIGAELF2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-elf2bb
|
||||
TOOL_AMIGATXLT= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-txlt
|
||||
TOOL_ASN1_COMPILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}asn1_compile
|
||||
TOOL_ATF_COMPILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}atf-compile
|
||||
TOOL_AWK= ${TOOLDIR}/bin/${_TOOL_PREFIX}awk
|
||||
TOOL_CAP_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}cap_mkdb
|
||||
TOOL_CAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}cat
|
||||
TOOL_CKSUM= ${TOOLDIR}/bin/${_TOOL_PREFIX}cksum
|
||||
TOOL_COMPILE_ET= ${TOOLDIR}/bin/${_TOOL_PREFIX}compile_et
|
||||
TOOL_CONFIG= ${TOOLDIR}/bin/${_TOOL_PREFIX}config
|
||||
TOOL_CRUNCHGEN= MAKE=${.MAKE:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}crunchgen
|
||||
TOOL_CTAGS= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctags
|
||||
TOOL_DB= ${TOOLDIR}/bin/${_TOOL_PREFIX}db
|
||||
TOOL_DISKLABEL= ${TOOLDIR}/bin/nbdisklabel-${MAKEWRAPPERMACHINE}
|
||||
TOOL_EQN= ${TOOLDIR}/bin/${_TOOL_PREFIX}eqn
|
||||
TOOL_FDISK= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-fdisk
|
||||
TOOL_FGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}fgen
|
||||
TOOL_GENASSYM= ${TOOLDIR}/bin/${_TOOL_PREFIX}genassym
|
||||
TOOL_GENCAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}gencat
|
||||
TOOL_GMAKE= ${TOOLDIR}/bin/${_TOOL_PREFIX}gmake
|
||||
TOOL_GREP= ${TOOLDIR}/bin/${_TOOL_PREFIX}grep
|
||||
TOOL_GROFF= PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}groff
|
||||
TOOL_HEXDUMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}hexdump
|
||||
TOOL_HP300MKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hp300-mkboot
|
||||
TOOL_HP700MKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hp700-mkboot
|
||||
TOOL_INDXBIB= ${TOOLDIR}/bin/${_TOOL_PREFIX}indxbib
|
||||
TOOL_INSTALLBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}installboot
|
||||
TOOL_INSTALL_INFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}install-info
|
||||
TOOL_JOIN= ${TOOLDIR}/bin/${_TOOL_PREFIX}join
|
||||
TOOL_M4= ${TOOLDIR}/bin/${_TOOL_PREFIX}m4
|
||||
TOOL_MACPPCFIXCOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}macppc-fixcoff
|
||||
TOOL_MAKEFS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makefs
|
||||
TOOL_MAKEINFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}makeinfo
|
||||
TOOL_MAKEWHATIS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makewhatis
|
||||
TOOL_MANDOC_ASCII= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Tascii
|
||||
TOOL_MANDOC_HTML= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Thtml
|
||||
TOOL_MANDOC_LINT= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Tlint
|
||||
TOOL_MDSETIMAGE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-mdsetimage
|
||||
TOOL_MENUC= MENUDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}menuc
|
||||
TOOL_MIPSELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff
|
||||
TOOL_MKCSMAPPER= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkcsmapper
|
||||
TOOL_MKESDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkesdb
|
||||
TOOL_MKLOCALE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mklocale
|
||||
TOOL_MKMAGIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}file
|
||||
TOOL_MKTEMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}mktemp
|
||||
TOOL_MSGC= MSGDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}msgc
|
||||
TOOL_MTREE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mtree
|
||||
TOOL_PAX= ${TOOLDIR}/bin/${_TOOL_PREFIX}pax
|
||||
TOOL_PIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}pic
|
||||
TOOL_PKG_CREATE= ${TOOLDIR}/bin/${_TOOL_PREFIX}pkg_create
|
||||
TOOL_POWERPCMKBOOTIMAGE=${TOOLDIR}/bin/${_TOOL_PREFIX}powerpc-mkbootimage
|
||||
TOOL_PWD_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}pwd_mkdb
|
||||
TOOL_REFER= ${TOOLDIR}/bin/${_TOOL_PREFIX}refer
|
||||
TOOL_ROFF_ASCII= PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}nroff
|
||||
TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi
|
||||
TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html
|
||||
TOOL_ROFF_PS= ${TOOL_GROFF} -Tps
|
||||
TOOL_ROFF_RAW= ${TOOL_GROFF} -Z
|
||||
TOOL_RPCGEN= RPCGEN_CPP=${CPP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}rpcgen
|
||||
TOOL_SED= ${TOOLDIR}/bin/${_TOOL_PREFIX}sed
|
||||
TOOL_SOELIM= ${TOOLDIR}/bin/${_TOOL_PREFIX}soelim
|
||||
TOOL_SPARKCRC= ${TOOLDIR}/bin/${_TOOL_PREFIX}sparkcrc
|
||||
TOOL_STAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}stat
|
||||
TOOL_STRFILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}strfile
|
||||
TOOL_SUNLABEL= ${TOOLDIR}/bin/${_TOOL_PREFIX}sunlabel
|
||||
TOOL_TBL= ${TOOLDIR}/bin/${_TOOL_PREFIX}tbl
|
||||
TOOL_UUDECODE= ${TOOLDIR}/bin/${_TOOL_PREFIX}uudecode
|
||||
TOOL_VGRIND= ${TOOLDIR}/bin/${_TOOL_PREFIX}vgrind -f
|
||||
TOOL_ZIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}zic
|
||||
|
||||
.else # USETOOLS != yes # } {
|
||||
|
||||
TOOL_AMIGAAOUT2BB= amiga-aout2bb
|
||||
TOOL_AMIGAELF2BB= amiga-elf2bb
|
||||
TOOL_AMIGATXLT= amiga-txlt
|
||||
TOOL_ASN1_COMPILE= asn1_compile
|
||||
TOOL_ATF_COMPILE= atf-compile
|
||||
TOOL_AWK= awk
|
||||
TOOL_CAP_MKDB= cap_mkdb
|
||||
TOOL_CAT= cat
|
||||
TOOL_CKSUM= cksum
|
||||
TOOL_COMPILE_ET= compile_et
|
||||
TOOL_CONFIG= config
|
||||
TOOL_CRUNCHGEN= crunchgen
|
||||
TOOL_CTAGS= ctags
|
||||
TOOL_DB= db
|
||||
TOOL_DISKLABEL= disklabel
|
||||
TOOL_EQN= eqn
|
||||
TOOL_FDISK= fdisk
|
||||
TOOL_FGEN= fgen
|
||||
TOOL_GENASSYM= genassym
|
||||
TOOL_GENCAT= gencat
|
||||
TOOL_GMAKE= gmake
|
||||
TOOL_GREP= grep
|
||||
TOOL_GROFF= groff
|
||||
TOOL_HEXDUMP= hexdump
|
||||
TOOL_HP300MKBOOT= hp300-mkboot
|
||||
TOOL_HP700MKBOOT= hp700-mkboot
|
||||
TOOL_INDXBIB= indxbib
|
||||
TOOL_INSTALLBOOT= installboot
|
||||
TOOL_INSTALL_INFO= install-info
|
||||
TOOL_JOIN= join
|
||||
TOOL_M4= m4
|
||||
TOOL_MACPPCFIXCOFF= macppc-fixcoff
|
||||
TOOL_MAKEFS= makefs
|
||||
TOOL_MAKEINFO= makeinfo
|
||||
#TOOL_MAKEWHATIS= /usr/libexec/makewhatis
|
||||
TOOL_MAKEWHATIS= /usr/bin/makewhatis
|
||||
TOOL_MDSETIMAGE= mdsetimage
|
||||
TOOL_MENUC= menuc
|
||||
TOOL_MIPSELF2ECOFF= mips-elf2ecoff
|
||||
TOOL_MKCSMAPPER= mkcsmapper
|
||||
TOOL_MKESDB= mkesdb
|
||||
TOOL_MKLOCALE= mklocale
|
||||
TOOL_MKMAGIC= file
|
||||
TOOL_MKTEMP= mktemp
|
||||
TOOL_MSGC= msgc
|
||||
TOOL_MTREE= mtree
|
||||
TOOL_PAX= pax
|
||||
TOOL_PIC= pic
|
||||
TOOL_PKG_CREATE= pkg_create
|
||||
TOOL_POWERPCMKBOOTIMAGE= powerpc-mkbootimage
|
||||
TOOL_PWD_MKDB= pwd_mkdb
|
||||
TOOL_REFER= refer
|
||||
TOOL_ROFF_ASCII= nroff
|
||||
TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi
|
||||
TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html
|
||||
TOOL_ROFF_PS= ${TOOL_GROFF} -Tps
|
||||
TOOL_ROFF_RAW= ${TOOL_GROFF} -Z
|
||||
TOOL_RPCGEN= rpcgen
|
||||
TOOL_SED= sed
|
||||
TOOL_SOELIM= soelim
|
||||
TOOL_SPARKCRC= sparkcrc
|
||||
TOOL_STAT= stat
|
||||
TOOL_STRFILE= strfile
|
||||
TOOL_SUNLABEL= sunlabel
|
||||
TOOL_TBL= tbl
|
||||
TOOL_UUDECODE= uudecode
|
||||
TOOL_VGRIND= vgrind -f
|
||||
TOOL_ZIC= zic
|
||||
|
||||
.endif # USETOOLS != yes # }
|
||||
|
||||
#
|
||||
# Targets to check if DESTDIR or RELEASEDIR is provided
|
||||
#
|
||||
.if !target(check_DESTDIR)
|
||||
check_DESTDIR: .PHONY .NOTMAIN
|
||||
.if !defined(DESTDIR)
|
||||
@echo "setenv DESTDIR before doing that!"
|
||||
@false
|
||||
.else
|
||||
@true
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.if !target(check_RELEASEDIR)
|
||||
check_RELEASEDIR: .PHONY .NOTMAIN
|
||||
.if !defined(RELEASEDIR)
|
||||
@echo "setenv RELEASEDIR before doing that!"
|
||||
@false
|
||||
.else
|
||||
@true
|
||||
.endif
|
||||
.endif
|
||||
|
||||
|
||||
.if ${USETOOLS} == "yes" # {
|
||||
#
|
||||
# Make sure DESTDIR is set, so that builds with these tools always
|
||||
# get appropriate -nostdinc, -nostdlib, etc. handling. The default is
|
||||
# <empty string>, meaning start from /, the root directory.
|
||||
#
|
||||
DESTDIR?=
|
||||
.endif # }
|
||||
|
||||
#
|
||||
# Build a dynamically linked /bin and /sbin, with the necessary shared
|
||||
# libraries moved from /usr/lib to /lib and the shared linker moved
|
||||
# from /usr/libexec to /lib
|
||||
#
|
||||
# Note that if the BINDIR is not /bin or /sbin, then we always use the
|
||||
# non-DYNAMICROOT behavior (i.e. it is only enabled for programs in /bin
|
||||
# and /sbin). See <bsd.shlib.mk>.
|
||||
#
|
||||
MKDYNAMICROOT?= yes
|
||||
|
||||
#
|
||||
# Where the system object and source trees are kept; can be configurable
|
||||
# by the user in case they want them in ~/foosrc and ~/fooobj (for example).
|
||||
#
|
||||
BSDSRCDIR?= /usr/src
|
||||
BSDOBJDIR?= /usr/obj
|
||||
NETBSDSRCDIR?= ${BSDSRCDIR}
|
||||
|
||||
#BINGRP?= wheel
|
||||
BINGRP?= operator
|
||||
BINOWN?= root
|
||||
BINMODE?= 755
|
||||
NONBINMODE?= 644
|
||||
|
||||
#MANDIR?= /usr/share/man
|
||||
MANDIR?= /usr/man
|
||||
#MANGRP?= wheel
|
||||
MANGRP?= operator
|
||||
MANOWN?= root
|
||||
MANMODE?= ${NONBINMODE}
|
||||
#MANINSTALL?= catinstall htmlinstall maninstall
|
||||
MANINSTALL?= maninstall
|
||||
|
||||
INFODIR?= /usr/share/info
|
||||
INFOGRP?= wheel
|
||||
INFOOWN?= root
|
||||
INFOMODE?= ${NONBINMODE}
|
||||
|
||||
#LIBDIR?= /usr/lib
|
||||
.if ${COMPILER_TYPE} == "ack"
|
||||
LIBDIR?= /usr/lib/i386
|
||||
.elif ${COMPILER_TYPE} == "gnu"
|
||||
LIBDIR?= /usr/gnu/lib
|
||||
.endif
|
||||
|
||||
LINTLIBDIR?= /usr/libdata/lint
|
||||
LIBGRP?= ${BINGRP}
|
||||
LIBOWN?= ${BINOWN}
|
||||
LIBMODE?= ${NONBINMODE}
|
||||
|
||||
DOCDIR?= /usr/share/doc
|
||||
HTMLDOCDIR?= /usr/share/doc/html
|
||||
DOCGRP?= wheel
|
||||
DOCOWN?= root
|
||||
DOCMODE?= ${NONBINMODE}
|
||||
|
||||
NLSDIR?= /usr/share/nls
|
||||
NLSGRP?= wheel
|
||||
NLSOWN?= root
|
||||
NLSMODE?= ${NONBINMODE}
|
||||
|
||||
KMODULEGRP?= wheel
|
||||
KMODULEOWN?= root
|
||||
KMODULEMODE?= ${NONBINMODE}
|
||||
|
||||
LOCALEDIR?= /usr/share/locale
|
||||
LOCALEGRP?= wheel
|
||||
LOCALEOWN?= root
|
||||
LOCALEMODE?= ${NONBINMODE}
|
||||
|
||||
FIRMWAREDIR?= /libdata/firmware
|
||||
FIRMWAREGRP?= wheel
|
||||
FIRMWAREOWN?= root
|
||||
FIRMWAREMODE?= ${NONBINMODE}
|
||||
|
||||
DEBUGDIR?= /usr/libdata/debug
|
||||
DEBUGGRP?= wheel
|
||||
DEBUGOWN?= root
|
||||
DEBUGMODE?= ${NONBINMODE}
|
||||
|
||||
#
|
||||
# Data-driven table using make variables to control how
|
||||
# toolchain-dependent targets and shared libraries are built
|
||||
# for different platforms and object formats.
|
||||
#
|
||||
# OBJECT_FMT: currently either "ELF" or "a.out".
|
||||
#
|
||||
# All platforms are ELF.
|
||||
#
|
||||
OBJECT_FMT= ELF
|
||||
|
||||
#
|
||||
# If this platform's toolchain is missing, we obviously cannot build it.
|
||||
#
|
||||
.if ${TOOLCHAIN_MISSING} != "no"
|
||||
MKBINUTILS:= no
|
||||
MKGDB:= no
|
||||
MKGCC:= no
|
||||
.endif
|
||||
|
||||
#
|
||||
# If we are using an external toolchain, we can still build the target's
|
||||
# binutils, but we cannot build GCC's support libraries, since those are
|
||||
# tightly-coupled to the version of GCC being used.
|
||||
#
|
||||
.if defined(EXTERNAL_TOOLCHAIN)
|
||||
MKGCC:= no
|
||||
.endif
|
||||
|
||||
#
|
||||
# The m68000 port is incomplete.
|
||||
#
|
||||
.if ${MACHINE_ARCH} == "m68000"
|
||||
NOPIC= # defined
|
||||
MKISCSI= no
|
||||
# XXX GCC 4 outputs mcount() calling sequences that try to load values
|
||||
# from over 64KB away and this fails to assemble.
|
||||
.if defined(HAVE_GCC) && (${HAVE_GCC} == 4)
|
||||
NOPROFILE= # defined
|
||||
.endif
|
||||
.endif
|
||||
|
||||
#
|
||||
# The ia64 port is incomplete.
|
||||
#
|
||||
.if ${MACHINE_ARCH} == "ia64"
|
||||
MKLINT= no
|
||||
MKGDB= no
|
||||
.endif
|
||||
|
||||
#
|
||||
# On the MIPS, all libs are compiled with ABIcalls (and are thus PIC),
|
||||
# not just shared libraries, so don't build the _pic version.
|
||||
#
|
||||
.if ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb" || \
|
||||
${MACHINE_ARCH} == "mips64el" || ${MACHINE_ARCH} == "mips64eb"
|
||||
MKPICLIB:= no
|
||||
.endif
|
||||
|
||||
#
|
||||
# On VAX using ELF, all objects are PIC, not just shared libraries,
|
||||
# so don't build the _pic version. Unless we are using GCC3 which
|
||||
# doesn't support PIC yet.
|
||||
#
|
||||
.if ${MACHINE_ARCH} == "vax"
|
||||
MKPICLIB= no
|
||||
.endif
|
||||
|
||||
#
|
||||
# Location of the file that contains the major and minor numbers of the
|
||||
# version of a shared library. If this file exists a shared library
|
||||
# will be built by <bsd.lib.mk>.
|
||||
#
|
||||
SHLIB_VERSION_FILE?= ${.CURDIR}/shlib_version
|
||||
|
||||
#
|
||||
# GNU sources and packages sometimes see architecture names differently.
|
||||
#
|
||||
GNU_ARCH.coldfire=m68k
|
||||
GNU_ARCH.i386=i486
|
||||
GCC_CONFIG_ARCH.i386=i486
|
||||
GCC_CONFIG_TUNE.i386=nocona
|
||||
GCC_CONFIG_TUNE.x86_64=nocona
|
||||
GNU_ARCH.m68000=m68010
|
||||
GNU_ARCH.sh3eb=sh
|
||||
GNU_ARCH.sh3el=shle
|
||||
GNU_ARCH.mips64eb=mips64
|
||||
MACHINE_GNU_ARCH=${GNU_ARCH.${MACHINE_ARCH}:U${MACHINE_ARCH}}
|
||||
|
||||
#
|
||||
# In order to identify NetBSD to GNU packages, we sometimes need
|
||||
# an "elf" tag for historically a.out platforms.
|
||||
#
|
||||
.if ${OBJECT_FMT} == "ELF" && \
|
||||
(${MACHINE_GNU_ARCH} == "arm" || \
|
||||
${MACHINE_GNU_ARCH} == "armeb" || \
|
||||
${MACHINE_ARCH} == "i386" || \
|
||||
${MACHINE_CPU} == "m68k" || \
|
||||
${MACHINE_GNU_ARCH} == "sh" || \
|
||||
${MACHINE_GNU_ARCH} == "shle" || \
|
||||
${MACHINE_ARCH} == "sparc" || \
|
||||
${MACHINE_ARCH} == "vax")
|
||||
MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf
|
||||
.else
|
||||
MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsd
|
||||
.endif
|
||||
|
||||
#
|
||||
# Determine if arch uses native kernel modules with rump
|
||||
#
|
||||
.if ${MACHINE_ARCH} == "i386" || \
|
||||
${MACHINE_ARCH} == "x86_64"
|
||||
RUMPKMOD= # defined
|
||||
.endif
|
||||
|
||||
TARGETS+= all clean cleandir depend dependall includes \
|
||||
install lint obj regress tags html
|
||||
PHONY_NOTMAIN = all clean cleandir depend dependall distclean includes \
|
||||
install lint obj regress tags beforedepend afterdepend \
|
||||
beforeinstall afterinstall realinstall realdepend realall \
|
||||
html subdir-all subdir-install subdir-depend
|
||||
.PHONY: ${PHONY_NOTMAIN}
|
||||
.NOTMAIN: ${PHONY_NOTMAIN}
|
||||
|
||||
.if ${NEED_OWN_INSTALL_TARGET} != "no"
|
||||
.if !target(install)
|
||||
install: beforeinstall .WAIT subdir-install realinstall .WAIT afterinstall
|
||||
beforeinstall:
|
||||
subdir-install:
|
||||
realinstall:
|
||||
afterinstall:
|
||||
.endif
|
||||
all: realall subdir-all
|
||||
subdir-all:
|
||||
realall:
|
||||
depend: realdepend subdir-depend
|
||||
subdir-depend:
|
||||
realdepend:
|
||||
distclean: cleandir
|
||||
cleandir: clean
|
||||
|
||||
dependall: .NOTMAIN realdepend .MAKE
|
||||
@cd ${.CURDIR}; ${MAKE} realall
|
||||
.endif
|
||||
|
||||
#
|
||||
# Define MKxxx variables (which are either yes or no) for users
|
||||
# to set in /etc/mk.conf and override in the make environment.
|
||||
# These should be tested with `== "no"' or `!= "no"'.
|
||||
# The NOxxx variables should only be set by Makefiles.
|
||||
#
|
||||
# Please keep etc/Makefile and share/man/man5/mk.conf.5 in sync
|
||||
# with changes to the MK* variables here.
|
||||
#
|
||||
|
||||
#
|
||||
# Supported NO* options (if defined, MK* will be forced to "no",
|
||||
# regardless of user's mk.conf setting).
|
||||
#
|
||||
# Source makefiles should set NO*, and not MK*, and must do so before
|
||||
# including bsd.own.mk.
|
||||
#
|
||||
.for var in \
|
||||
NOCRYPTO NODOC NOHTML NOINFO NOLINKLIB NOLINT NOMAN NONLS NOOBJ NOPIC \
|
||||
NOPICINSTALL NOPROFILE NOSHARE NOSTATICLIB
|
||||
.if defined(${var})
|
||||
MK${var:S/^NO//}:= no
|
||||
.endif
|
||||
.endfor
|
||||
|
||||
#
|
||||
# Older-style variables that enabled behaviour when set.
|
||||
#
|
||||
.for var in MANZ UNPRIVED UPDATE
|
||||
.if defined(${var})
|
||||
MK${var}:= yes
|
||||
.endif
|
||||
.endfor
|
||||
|
||||
#
|
||||
# MK* options which have variable defaults.
|
||||
#
|
||||
.if ${MACHINE} == "amd64" || ${MACHINE} == "sparc64"
|
||||
MKCOMPAT?= yes
|
||||
.else
|
||||
# Don't let this build where it really isn't supported.
|
||||
MKCOMPAT:= no
|
||||
.endif
|
||||
|
||||
#
|
||||
# MK* backward compatibility.
|
||||
#
|
||||
.if defined(MKBFD)
|
||||
MKBINUTILS?= ${MKBFD}
|
||||
.endif
|
||||
|
||||
#
|
||||
# We want to build zfs only for i386 and amd64 by default for now.
|
||||
#
|
||||
.if ${MACHINE} == "amd64" || ${MACHINE} == "i386"
|
||||
MKZFS?= yes
|
||||
.endif
|
||||
|
||||
#
|
||||
# MK* options which default to "yes".
|
||||
#
|
||||
_MKVARS.yes= \
|
||||
MKATF \
|
||||
MKBINUTILS \
|
||||
MKCATPAGES MKCRYPTO MKCOMPLEX MKCVS \
|
||||
MKDOC \
|
||||
MKGCC MKGCCCMDS MKGDB \
|
||||
MKHESIOD MKHTML \
|
||||
MKIEEEFP MKINET6 MKINFO MKIPFILTER MKISCSI \
|
||||
MKKERBEROS \
|
||||
MKKMOD \
|
||||
MKLDAP MKLINKLIB MKLINT MKLVM \
|
||||
MKMAN \
|
||||
MKMDNS \
|
||||
MKNLS \
|
||||
MKOBJ \
|
||||
MKPAM \
|
||||
MKPF MKPIC MKPICINSTALL MKPICLIB MKPOSTFIX MKPROFILE \
|
||||
MKSHARE MKSKEY MKSTATICLIB \
|
||||
MKX11FONTS \
|
||||
MKYP
|
||||
.for var in ${_MKVARS.yes}
|
||||
${var}?= yes
|
||||
.endfor
|
||||
|
||||
#
|
||||
# MK* options which default to "no".
|
||||
#
|
||||
_MKVARS.no= \
|
||||
MKCRYPTO_IDEA MKCRYPTO_MDC2 MKCRYPTO_RC5 MKDEBUG MKDEBUGLIB \
|
||||
MKEXTSRC \
|
||||
MKMANDOC MKMANZ MKOBJDIRS \
|
||||
MKPCC MKPCCCMDS \
|
||||
MKSOFTFLOAT MKSTRIPIDENT \
|
||||
MKUNPRIVED MKUPDATE MKX11 MKZFS
|
||||
.for var in ${_MKVARS.no}
|
||||
${var}?=no
|
||||
.endfor
|
||||
|
||||
#
|
||||
# Force some options off if their dependencies are off.
|
||||
#
|
||||
|
||||
.if ${MKCRYPTO} == "no"
|
||||
MKKERBEROS:= no
|
||||
.endif
|
||||
|
||||
.if ${MKMAN} == "no"
|
||||
MKCATPAGES:= no
|
||||
MKHTML:= no
|
||||
.endif
|
||||
|
||||
.if ${MKLINKLIB} == "no"
|
||||
MKLINT:= no
|
||||
MKPICINSTALL:= no
|
||||
MKPROFILE:= no
|
||||
.endif
|
||||
|
||||
.if ${MKPIC} == "no"
|
||||
MKPICLIB:= no
|
||||
.endif
|
||||
|
||||
.if ${MKOBJ} == "no"
|
||||
MKOBJDIRS:= no
|
||||
.endif
|
||||
|
||||
.if ${MKSHARE} == "no"
|
||||
MKCATPAGES:= no
|
||||
MKDOC:= no
|
||||
MKINFO:= no
|
||||
MKHTML:= no
|
||||
MKMAN:= no
|
||||
MKNLS:= no
|
||||
.endif
|
||||
|
||||
#
|
||||
# install(1) parameters.
|
||||
#
|
||||
COPY?= -c
|
||||
.if ${MKUPDATE} == "no"
|
||||
PRESERVE?=
|
||||
.else
|
||||
PRESERVE?= -p
|
||||
.endif
|
||||
#XXX: Not supported by MINIX install
|
||||
#RENAME?= -r
|
||||
HRDLINK?= -l h
|
||||
SYMLINK?= -l s
|
||||
|
||||
METALOG?= ${DESTDIR}/METALOG
|
||||
METALOG.add?= ${TOOL_CAT} -l >> ${METALOG}
|
||||
.if (${_SRC_TOP_} != "") # only set INSTPRIV if inside ${NETBSDSRCDIR}
|
||||
.if ${MKUNPRIVED} != "no"
|
||||
INSTPRIV.unpriv=-U -M ${METALOG} -D ${DESTDIR} -h sha256
|
||||
.else
|
||||
INSTPRIV.unpriv=
|
||||
.endif
|
||||
INSTPRIV?= ${INSTPRIV.unpriv} -N ${NETBSDSRCDIR}/etc
|
||||
.endif
|
||||
STRIPFLAG?=
|
||||
#XXX: Strip flag for MINIX
|
||||
#STRIPFLAG?= -s
|
||||
|
||||
.if ${NEED_OWN_INSTALL_TARGET} != "no"
|
||||
INSTALL_DIR?= ${INSTALL} ${INSTPRIV} -d
|
||||
INSTALL_FILE?= ${INSTALL} ${INSTPRIV} ${COPY} ${PRESERVE} ${RENAME}
|
||||
INSTALL_LINK?= ${INSTALL} ${INSTPRIV} ${HRDLINK} ${RENAME}
|
||||
INSTALL_SYMLINK?= ${INSTALL} ${INSTPRIV} ${SYMLINK} ${RENAME}
|
||||
HOST_INSTALL_FILE?= ${INSTALL} ${COPY} ${PRESERVE} ${RENAME}
|
||||
HOST_INSTALL_DIR?= ${INSTALL} -d
|
||||
HOST_INSTALL_SYMLINK?= ${INSTALL} ${SYMLINK} ${RENAME}
|
||||
.endif
|
||||
|
||||
#
|
||||
# Set defaults for the USE_xxx variables.
|
||||
#
|
||||
|
||||
#
|
||||
# USE_* options which default to "no" and will be forced to "no" if their
|
||||
# corresponding MK* variable is set to "no".
|
||||
#
|
||||
.for var in USE_SKEY
|
||||
.if (${${var:S/USE_/MK/}} == "no")
|
||||
${var}:= no
|
||||
.else
|
||||
${var}?= no
|
||||
.endif
|
||||
.endfor
|
||||
|
||||
#
|
||||
# USE_* options which default to "yes" unless their corresponding MK*
|
||||
# variable is set to "no".
|
||||
#
|
||||
.for var in USE_HESIOD USE_INET6 USE_KERBEROS USE_LDAP USE_PAM USE_YP
|
||||
.if (${${var:S/USE_/MK/}} == "no")
|
||||
${var}:= no
|
||||
.else
|
||||
${var}?= yes
|
||||
.endif
|
||||
.endfor
|
||||
|
||||
#
|
||||
# USE_* options which default to "yes".
|
||||
#
|
||||
.for var in USE_JEMALLOC
|
||||
${var}?= yes
|
||||
.endfor
|
||||
|
||||
#
|
||||
# USE_* options which default to "no".
|
||||
#
|
||||
#.for var in
|
||||
#${var}?= no
|
||||
#.endfor
|
||||
|
||||
|
||||
#
|
||||
# MAKEDIRTARGET dir target [extra make(1) params]
|
||||
# run "cd $${dir} && ${MAKE} [params] $${target}", with a pretty message
|
||||
#
|
||||
MAKEDIRTARGET=\
|
||||
@_makedirtarget() { \
|
||||
dir="$$1"; shift; \
|
||||
target="$$1"; shift; \
|
||||
case "$${dir}" in \
|
||||
/*) this="$${dir}/"; \
|
||||
real="$${dir}" ;; \
|
||||
.) this="${_THISDIR_}"; \
|
||||
real="${.CURDIR}" ;; \
|
||||
*) this="${_THISDIR_}$${dir}/"; \
|
||||
real="${.CURDIR}/$${dir}" ;; \
|
||||
esac; \
|
||||
show=$${this:-.}; \
|
||||
echo "$${target} ===> $${show%/}$${1:+ (with: $$@)}"; \
|
||||
cd "$${real}" \
|
||||
&& ${MAKE} _THISDIR_="$${this}" "$$@" $${target}; \
|
||||
}; \
|
||||
_makedirtarget
|
||||
|
||||
#
|
||||
# MAKEVERBOSE support. Levels are:
|
||||
# 0 Minimal output ("quiet")
|
||||
# 1 Describe what is occurring
|
||||
# 2 Describe what is occurring and echo the actual command
|
||||
# 3 Ignore the effect of the "@" prefix in make commands
|
||||
# 4 Trace shell commands using the shell's -x flag
|
||||
#
|
||||
MAKEVERBOSE?= 1
|
||||
|
||||
.if ${MAKEVERBOSE} == 0
|
||||
_MKMSG?= @\#
|
||||
_MKSHMSG?= : echo
|
||||
_MKSHECHO?= : echo
|
||||
.SILENT:
|
||||
.elif ${MAKEVERBOSE} == 1
|
||||
_MKMSG?= @echo ' '
|
||||
_MKSHMSG?= echo ' '
|
||||
_MKSHECHO?= : echo
|
||||
.SILENT:
|
||||
.else # MAKEVERBOSE >= 2
|
||||
_MKMSG?= @echo '\# '
|
||||
_MKSHMSG?= echo '\# '
|
||||
_MKSHECHO?= echo
|
||||
.SILENT: __makeverbose_dummy_target__
|
||||
.endif # MAKEVERBOSE >= 2
|
||||
.if ${MAKEVERBOSE} >= 3
|
||||
.MAKEFLAGS: -dl
|
||||
.endif # ${MAKEVERBOSE} >= 3
|
||||
.if ${MAKEVERBOSE} >= 4
|
||||
.MAKEFLAGS: -dx
|
||||
.endif # ${MAKEVERBOSE} >= 4
|
||||
|
||||
_MKMSG_BUILD?= ${_MKMSG} " build "
|
||||
_MKMSG_CREATE?= ${_MKMSG} " create "
|
||||
_MKMSG_COMPILE?= ${_MKMSG} "compile "
|
||||
_MKMSG_FORMAT?= ${_MKMSG} " format "
|
||||
_MKMSG_INSTALL?= ${_MKMSG} "install "
|
||||
_MKMSG_LINK?= ${_MKMSG} " link "
|
||||
_MKMSG_LEX?= ${_MKMSG} " lex "
|
||||
_MKMSG_REMOVE?= ${_MKMSG} " remove "
|
||||
_MKMSG_YACC?= ${_MKMSG} " yacc "
|
||||
|
||||
_MKSHMSG_CREATE?= ${_MKSHMSG} " create "
|
||||
_MKSHMSG_INSTALL?= ${_MKSHMSG} "install "
|
||||
|
||||
_MKTARGET_BUILD?= ${_MKMSG_BUILD} ${.CURDIR:T}/${.TARGET}
|
||||
_MKTARGET_CREATE?= ${_MKMSG_CREATE} ${.CURDIR:T}/${.TARGET}
|
||||
_MKTARGET_COMPILE?= ${_MKMSG_COMPILE} ${.CURDIR:T}/${.TARGET}
|
||||
_MKTARGET_FORMAT?= ${_MKMSG_FORMAT} ${.CURDIR:T}/${.TARGET}
|
||||
_MKTARGET_INSTALL?= ${_MKMSG_INSTALL} ${.TARGET}
|
||||
_MKTARGET_LINK?= ${_MKMSG_LINK} ${.CURDIR:T}/${.TARGET}
|
||||
_MKTARGET_LEX?= ${_MKMSG_LEX} ${.CURDIR:T}/${.TARGET}
|
||||
_MKTARGET_REMOVE?= ${_MKMSG_REMOVE} ${.TARGET}
|
||||
_MKTARGET_YACC?= ${_MKMSG_YACC} ${.CURDIR:T}/${.TARGET}
|
||||
|
||||
.if ${MKMANDOC} == "yes"
|
||||
TARGETS+= lintmanpages
|
||||
.endif
|
||||
|
||||
.endif # !defined(_MINIX_OWN_MK_)
|
||||
384
share/mk/bsd.prog.mk
Normal file
384
share/mk/bsd.prog.mk
Normal file
@@ -0,0 +1,384 @@
|
||||
# $NetBSD: bsd.prog.mk,v 1.244 2009/12/08 15:18:42 uebayasi Exp $
|
||||
# @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94
|
||||
|
||||
.ifndef HOSTPROG
|
||||
|
||||
.include <bsd.init.mk>
|
||||
|
||||
#
|
||||
# Definitions and targets shared among all programs built by a single
|
||||
# Makefile.
|
||||
#
|
||||
|
||||
##### Minix rule to make the "install" target depend on
|
||||
##### "all" and "depend" targets
|
||||
realinstall: realall
|
||||
realall: depend
|
||||
|
||||
##### Basic targets
|
||||
realinstall: proginstall scriptsinstall
|
||||
clean: cleanprog
|
||||
|
||||
cleanobjs: .PHONY
|
||||
|
||||
cleanprog: .PHONY cleanobjs cleanextra
|
||||
rm -f a.out [Ee]rrs mklog core *.core
|
||||
|
||||
##### Default values
|
||||
.if empty(CPPFLAGS:M-nostdinc)
|
||||
CPPFLAGS+= ${DESTDIR:D-nostdinc ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include}
|
||||
.endif
|
||||
.if empty(CXXFLAGS:M-nostdinc++)
|
||||
CXXFLAGS+= ${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEMXX} ${DESTDIR}/usr/include/g++}
|
||||
.endif
|
||||
CFLAGS+= ${COPTS}
|
||||
OBJCFLAGS+= ${OBJCOPTS}
|
||||
MKDEP_SUFFIXES?= .o .ln
|
||||
|
||||
##### Installed system library definitions
|
||||
#
|
||||
# E.g.
|
||||
# LIBC?=${DESTDIR}/usr/lib/libc.a
|
||||
# LIBX11?=${DESTDIR}/usr/X11R7/lib/libX11.a
|
||||
# etc..
|
||||
|
||||
# .for _lib in \
|
||||
# archive asn1 bluetooth bsdmalloc bz2 c c_pic cdk com_err compat \
|
||||
# crypt crypto crypto_idea crypto_mdc2 crypto_rc5 \
|
||||
# curses dbm des edit event \
|
||||
# fetch form fl g2c gcc gnumalloc gssapi hdb heimntlm hx509 intl ipsec \
|
||||
# kadm5clnt kadm5srv kafs krb5 kvm l lber ldap ldap_r \
|
||||
# m magic menu objc ossaudio pam pcap pci pmc posix pthread pthread_dbg \
|
||||
# puffs radius resolv rmt roken rpcsvc rt rump rumpuser skey sl ss \
|
||||
# ssh ssl termcap usbhid util wrap y z bind9 dns lwres isccfg isccc isc \
|
||||
# \
|
||||
# rumpfs_cd9660fs rumpfs_efs rumpfs_ext2fs rumpfs_ffs rumpfs_hfs \
|
||||
# rumpfs_lfs rumpfs_msdosfs rumpfs_nfs rumpfs_ntfs rumpfs_syspuffs \
|
||||
# rumpfs_tmpfs rumpfs_udf rumpfs_ufs
|
||||
.for _lib in \
|
||||
c curses driver netdriver edit end m sys timers util bz2 l hgfs
|
||||
.ifndef LIB${_lib:tu}
|
||||
LIB${_lib:tu}= ${DESTDIR}/usr/lib/lib${_lib}.a
|
||||
.if ${COMPILER_TYPE} == "ack"
|
||||
LIB${_lib:tu}= ${DESTDIR}/usr/lib/i386/lib${_lib}.a
|
||||
.elif ${COMPILER_TYPE} == "gnu"
|
||||
LIB${_lib:tu}= ${DESTDIR}/usr/gnu/lib/lib${_lib}.a
|
||||
.endif
|
||||
.MADE: ${LIB${_lib:tu}} # Note: ${DESTDIR} will be expanded
|
||||
.endif
|
||||
.endfor
|
||||
|
||||
# These need + -> X transformations
|
||||
.ifndef LIBSTDCXX
|
||||
LIBSTDCXX= ${DESTDIR}/usr/lib/libstdc++.a
|
||||
.MADE: ${LIBSTDCXX}
|
||||
.endif
|
||||
|
||||
.ifndef LIBSUPCXX
|
||||
LIBSUPCXX= ${DESTDIR}/usr/lib/libsupc++.a
|
||||
.MADE: ${LIBSUPCXX}
|
||||
.endif
|
||||
|
||||
.for _lib in \
|
||||
dps expat fntstubs fontcache fontconfig fontenc freetype FS \
|
||||
GL GLU ICE lbxutil SM X11 Xau Xaw Xdmcp Xext Xfont Xft \
|
||||
Xi Xinerama xkbfile Xmu Xmuu Xpm Xrandr Xrender Xss Xt \
|
||||
XTrap Xtst Xv Xxf86dga Xxf86misc Xxf86vm
|
||||
.ifndef LIB${_lib:tu}
|
||||
LIB${_lib:tu}= ${DESTDIR}${X11USRLIBDIR}/lib${_lib}.a
|
||||
.MADE: ${LIB${_lib:tu}} # Note: ${DESTDIR} will be expanded
|
||||
.endif
|
||||
.endfor
|
||||
|
||||
.if defined(RESCUEDIR)
|
||||
CPPFLAGS+= -DRESCUEDIR=\"${RESCUEDIR}\"
|
||||
.endif
|
||||
|
||||
__proginstall: .USE
|
||||
${_MKTARGET_INSTALL}
|
||||
${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
|
||||
${INSTALLFLAGS} ${STRIPFLAG} ${.ALLSRC} ${.TARGET}
|
||||
|
||||
__progdebuginstall: .USE
|
||||
${_MKTARGET_INSTALL}
|
||||
${INSTALL_FILE} -o ${DEBUGOWN} -g ${DEBUGGRP} -m ${DEBUGMODE} \
|
||||
${INSTALLFLAGS} ${.ALLSRC} ${.TARGET}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Backwards compatibility with Makefiles that assume that bsd.prog.mk
|
||||
# can only build a single binary.
|
||||
#
|
||||
|
||||
_APPEND_MANS=yes
|
||||
_APPEND_SRCS=yes
|
||||
|
||||
_CCLINKFLAGS=
|
||||
.if defined(DESTDIR)
|
||||
_CCLINKFLAGS+= -B${_GCC_CRTDIR}/ -B${DESTDIR}/usr/lib/
|
||||
.endif
|
||||
|
||||
.if defined(PROG_CXX)
|
||||
PROG= ${PROG_CXX}
|
||||
_CCLINK= ${CXX} ${_CCLINKFLAGS}
|
||||
.endif
|
||||
|
||||
.if defined(PROG)
|
||||
_CCLINK?= ${CC} ${_CCLINKFLAGS}
|
||||
. if defined(MAN)
|
||||
MAN.${PROG}= ${MAN}
|
||||
_APPEND_MANS= no
|
||||
. endif
|
||||
. if !defined(OBJS)
|
||||
OBJS= ${OBJS.${PROG}}
|
||||
. endif
|
||||
. if defined(PROGNAME)
|
||||
PROGNAME.${PROG}= ${PROGNAME}
|
||||
. endif
|
||||
. if defined(SRCS)
|
||||
SRCS.${PROG}= ${SRCS}
|
||||
_APPEND_SRCS= no
|
||||
. endif
|
||||
.endif
|
||||
|
||||
# Turn the single-program PROG and PROG_CXX variables into their multi-word
|
||||
# counterparts, PROGS and PROGS_CXX.
|
||||
.if defined(PROG_CXX) && !defined(PROGS_CXX)
|
||||
PROGS_CXX= ${PROG_CXX}
|
||||
.elif defined(PROG) && !defined(PROGS)
|
||||
PROGS= ${PROG}
|
||||
.endif
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Per-program definitions and targets.
|
||||
#
|
||||
|
||||
# Definitions specific to C programs.
|
||||
.for _P in ${PROGS}
|
||||
SRCS.${_P}?= ${_P}.c
|
||||
_CCLINK.${_P}= ${CC} ${_CCLINKFLAGS}
|
||||
.endfor
|
||||
|
||||
# Definitions specific to C++ programs.
|
||||
.for _P in ${PROGS_CXX}
|
||||
SRCS.${_P}?= ${_P}.cc
|
||||
_CCLINK.${_P}= ${CXX} ${_CCLINKFLAGS}
|
||||
.endfor
|
||||
|
||||
# Language-independent definitions.
|
||||
.for _P in ${PROGS} ${PROGS_CXX} # {
|
||||
|
||||
BINDIR.${_P}?= ${BINDIR}
|
||||
PROGNAME.${_P}?= ${_P}
|
||||
|
||||
.if ${MKDEBUG} != "no" && ${OBJECT_FMT} == "ELF" && !commands(${_P})
|
||||
_PROGDEBUG.${_P}:= ${PROGNAME.${_P}}.debug
|
||||
.endif
|
||||
|
||||
##### PROG specific flags.
|
||||
|
||||
_LDADD.${_P}= ${LDADD} ${LDADD.${_P}}
|
||||
_LDFLAGS.${_P}= ${LDFLAGS} ${LDFLAGS.${_P}}
|
||||
_LDSTATIC.${_P}= ${LDSTATIC} ${LDSTATIC.${_P}}
|
||||
|
||||
##### Build and install rules
|
||||
.if !empty(_APPEND_SRCS:M[Yy][Ee][Ss])
|
||||
SRCS+= ${SRCS.${_P}} # For bsd.dep.mk
|
||||
.endif
|
||||
|
||||
_YPSRCS.${_P}= ${SRCS.${_P}:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS.${_P}:M*.y:.y=.h}}
|
||||
|
||||
DPSRCS+= ${_YPSRCS.${_P}}
|
||||
CLEANFILES+= ${_YPSRCS.${_P}}
|
||||
|
||||
.if !empty(SRCS.${_P}:N*.h:N*.sh:N*.fth)
|
||||
OBJS.${_P}+= ${SRCS.${_P}:N*.h:N*.sh:N*.fth:R:S/$/.o/g}
|
||||
LOBJS.${_P}+= ${LSRCS:.c=.ln} ${SRCS.${_P}:M*.c:.c=.ln}
|
||||
.endif
|
||||
|
||||
.if defined(OBJS.${_P}) && !empty(OBJS.${_P}) # {
|
||||
.NOPATH: ${OBJS.${_P}} ${_P} ${_YPSRCS.${_P}}
|
||||
|
||||
${OBJS.${_P}} ${LOBJS.${_P}}: ${DPSRCS}
|
||||
|
||||
${_P}: ${LIBCRT0} ${OBJS.${_P}} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
|
||||
.if !commands(${_P})
|
||||
${_MKTARGET_LINK}
|
||||
${_CCLINK.${_P}} \
|
||||
${DESTDIR:D-Wl,-nostdlib} \
|
||||
${_LDFLAGS.${_P}} ${_LDSTATIC.${_P}} -o ${.TARGET} \
|
||||
${OBJS.${_P}} ${_LDADD.${_P}} \
|
||||
${DESTDIR:D-L${_GCC_LIBGCCDIR}} \
|
||||
${_PROGLDOPTS}
|
||||
.if defined(PAXCTL_FLAGS.${_P})
|
||||
${PAXCTL} ${PAXCTL_FLAGS.${_P}} ${.TARGET}
|
||||
.endif
|
||||
.if ${MKSTRIPIDENT} != "no"
|
||||
${OBJCOPY} -R .ident ${.TARGET}
|
||||
.endif
|
||||
.endif # !commands(${_P})
|
||||
|
||||
${_P}.ro: ${OBJS.${_P}} ${DPADD}
|
||||
${_MKTARGET_LINK}
|
||||
${LD} -r -dc -o ${.TARGET} ${OBJS.${_P}}
|
||||
|
||||
.if defined(_PROGDEBUG.${_P})
|
||||
${_PROGDEBUG.${_P}}: ${_P}
|
||||
${_MKTARGET_CREATE}
|
||||
${OBJCOPY} --only-keep-debug ${_P} ${_PROGDEBUG.${_P}}
|
||||
${OBJCOPY} -R .gnu_debuglink --add-gnu-debuglink=${_PROGDEBUG.${_P}} ${_P} \
|
||||
|| rm -f ${_PROGDEBUG.${_P}}
|
||||
.endif
|
||||
|
||||
.endif # defined(OBJS.${_P}) && !empty(OBJS.${_P}) # }
|
||||
|
||||
.if !defined(MAN.${_P})
|
||||
MAN.${_P}= ${_P}.1
|
||||
.endif # !defined(MAN.${_P})
|
||||
.if !empty(_APPEND_MANS:M[Yy][Ee][Ss])
|
||||
MAN+= ${MAN.${_P}}
|
||||
.endif
|
||||
|
||||
realall: ${_P} ${_PROGDEBUG.${_P}}
|
||||
|
||||
cleanprog: cleanprog-${_P}
|
||||
cleanprog-${_P}:
|
||||
rm -f ${_P} ${_PROGDEBUG.${_P}}
|
||||
|
||||
.if defined(OBJS.${_P}) && !empty(OBJS.${_P})
|
||||
cleanobjs: cleanobjs-${_P}
|
||||
cleanobjs-${_P}:
|
||||
rm -f ${OBJS.${_P}} ${LOBJS.${_P}}
|
||||
.endif
|
||||
|
||||
_PROG_INSTALL+= proginstall-${_P}
|
||||
|
||||
.if !target(proginstall-${_P}) # {
|
||||
proginstall-${_P}:: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}} \
|
||||
${_PROGDEBUG.${_P}:D${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}}
|
||||
.PRECIOUS: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}} \
|
||||
${_PROGDEBUG.${_P}:D${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}}
|
||||
|
||||
.if ${MKUPDATE} == "no"
|
||||
${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! ${_P} __proginstall
|
||||
.if !defined(BUILD) && !make(all) && !make(${_P})
|
||||
${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! .MADE
|
||||
.endif
|
||||
.if defined(_PROGDEBUG.${_P})
|
||||
${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}! ${_PROGDEBUG.${_P}} __progdebuginstall
|
||||
.if !defined(BUILD) && !make(all) && !make(${_P})
|
||||
${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}! .MADE
|
||||
.endif
|
||||
.endif # define(_PROGDEBUG.${_P})
|
||||
.else # MKUPDATE != no
|
||||
${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: ${_P} __proginstall
|
||||
.if !defined(BUILD) && !make(all) && !make(${_P})
|
||||
${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: .MADE
|
||||
.endif
|
||||
.if defined(_PROGDEBUG.${_P})
|
||||
${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}: ${_PROGDEBUG.${_P}} __progdebuginstall
|
||||
.if !defined(BUILD) && !make(all) && !make(${_P})
|
||||
${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}: .MADE
|
||||
.endif
|
||||
.endif # defined(_PROGDEBUG.${_P})
|
||||
.endif # MKUPDATE != no
|
||||
|
||||
.endif # !target(proginstall-${_P}) # }
|
||||
|
||||
lint: lint-${_P}
|
||||
lint-${_P}: ${LOBJS.${_P}}
|
||||
.if defined(LOBJS.${_P}) && !empty(LOBJS.${_P})
|
||||
${LINT} ${LINTFLAGS} ${_LDFLAGS.${_P}:C/-L[ ]*/-L/Wg:M-L*} ${LOBJS.${_P}} ${_LDADD.${_P}}
|
||||
.endif
|
||||
|
||||
.endfor # _P in ${PROGS} ${PROGS_CXX} # }
|
||||
|
||||
.if defined(OBJS) && !empty(OBJS) && \
|
||||
(empty(PROGS) && empty(PROGS_CXX))
|
||||
cleanobjs: cleanobjs-plain
|
||||
cleanobjs-plain:
|
||||
rm -f ${OBJS} ${LOBJS}
|
||||
.endif
|
||||
|
||||
.if !target(proginstall)
|
||||
proginstall:: ${_PROG_INSTALL}
|
||||
.endif
|
||||
.PHONY: proginstall
|
||||
|
||||
|
||||
|
||||
realall: ${SCRIPTS}
|
||||
.if defined(SCRIPTS) && !target(scriptsinstall) # {
|
||||
SCRIPTSDIR?=${BINDIR}
|
||||
SCRIPTSOWN?=${BINOWN}
|
||||
SCRIPTSGRP?=${BINGRP}
|
||||
SCRIPTSMODE?=${BINMODE}
|
||||
|
||||
scriptsinstall:: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
|
||||
.PRECIOUS: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
|
||||
|
||||
__scriptinstall: .USE
|
||||
${_MKTARGET_INSTALL}
|
||||
${INSTALL_FILE} \
|
||||
-o ${SCRIPTSOWN_${.ALLSRC:T}:U${SCRIPTSOWN}} \
|
||||
-g ${SCRIPTSGRP_${.ALLSRC:T}:U${SCRIPTSGRP}} \
|
||||
-m ${SCRIPTSMODE_${.ALLSRC:T}:U${SCRIPTSMODE}} \
|
||||
${.ALLSRC} ${.TARGET}
|
||||
|
||||
.for S in ${SCRIPTS:O:u}
|
||||
.if ${MKUPDATE} == "no"
|
||||
${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}! ${S} __scriptinstall
|
||||
.if !defined(BUILD) && !make(all) && !make(${S})
|
||||
${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}! .MADE
|
||||
.endif
|
||||
.else
|
||||
${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: ${S} __scriptinstall
|
||||
.if !defined(BUILD) && !make(all) && !make(${S})
|
||||
${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: .MADE
|
||||
.endif
|
||||
.endif
|
||||
.endfor
|
||||
.endif # }
|
||||
|
||||
.if !target(scriptsinstall)
|
||||
scriptsinstall::
|
||||
.endif
|
||||
.PHONY: scriptsinstall
|
||||
|
||||
##### Pull in related .mk logic
|
||||
LINKSOWN?= ${BINOWN}
|
||||
LINKSGRP?= ${BINGRP}
|
||||
LINKSMODE?= ${BINMODE}
|
||||
.include <bsd.man.mk>
|
||||
.include <bsd.files.mk>
|
||||
.include <bsd.inc.mk>
|
||||
.include <bsd.links.mk>
|
||||
.include <bsd.sys.mk>
|
||||
.include <bsd.dep.mk>
|
||||
|
||||
.if ${COMPILER_TYPE} == "ack"
|
||||
.include <bsd.ack.mk>
|
||||
.elif ${COMPILER_TYPE} == "gnu"
|
||||
.include <bsd.gcc.mk>
|
||||
.endif
|
||||
|
||||
|
||||
cleanextra: .PHONY
|
||||
.if defined(CLEANFILES) && !empty(CLEANFILES)
|
||||
rm -f ${CLEANFILES}
|
||||
.endif
|
||||
|
||||
${TARGETS}: # ensure existence
|
||||
|
||||
###### Minix rule to set up mem allocations for boot image services
|
||||
.if defined(INSTALLFLAGS)
|
||||
all: .PHONY memalloc
|
||||
|
||||
memalloc: realall
|
||||
${INSTALL} ${INSTALLFLAGS} ${PROG}
|
||||
.endif
|
||||
|
||||
.endif # HOSTPROG
|
||||
49
share/mk/bsd.subdir.mk
Normal file
49
share/mk/bsd.subdir.mk
Normal file
@@ -0,0 +1,49 @@
|
||||
# $NetBSD: bsd.subdir.mk,v 1.50 2009/11/29 16:00:00 uebayasi Exp $
|
||||
# @(#)bsd.subdir.mk 8.1 (Berkeley) 6/8/93
|
||||
|
||||
.include <bsd.init.mk>
|
||||
|
||||
# MINIX: cleandepend works for SUBDIRs
|
||||
TARGETS+= cleandepend
|
||||
.PHONY: cleandepend
|
||||
.NOTMAIN: cleandepend
|
||||
|
||||
.if !defined(NOSUBDIR) # {
|
||||
|
||||
.for dir in ${SUBDIR}
|
||||
.if exists(${dir}.${MACHINE})
|
||||
__REALSUBDIR+=${dir}.${MACHINE}
|
||||
.else
|
||||
__REALSUBDIR+=${dir}
|
||||
.endif
|
||||
.endfor
|
||||
|
||||
__recurse: .USE
|
||||
@${MAKEDIRTARGET} ${.TARGET:C/^[^-]*-//} ${.TARGET:C/-.*$//}
|
||||
|
||||
.if make(cleandir)
|
||||
__RECURSETARG= ${TARGETS:Nclean}
|
||||
clean:
|
||||
.else
|
||||
__RECURSETARG= ${TARGETS}
|
||||
.endif
|
||||
|
||||
# for obscure reasons, we can't do a simple .if ${dir} == ".WAIT"
|
||||
# but have to assign to __TARGDIR first.
|
||||
.for targ in ${__RECURSETARG}
|
||||
.for dir in ${__REALSUBDIR}
|
||||
__TARGDIR := ${dir}
|
||||
.if ${__TARGDIR} == ".WAIT"
|
||||
SUBDIR_${targ} += .WAIT
|
||||
.elif !commands(${targ}-${dir})
|
||||
${targ}-${dir}: .PHONY .MAKE __recurse
|
||||
SUBDIR_${targ} += ${targ}-${dir}
|
||||
.endif
|
||||
.endfor
|
||||
subdir-${targ}: .PHONY ${SUBDIR_${targ}}
|
||||
${targ}: subdir-${targ}
|
||||
.endfor
|
||||
|
||||
.endif # ! NOSUBDIR # }
|
||||
|
||||
${TARGETS}: # ensure existence
|
||||
215
share/mk/bsd.sys.mk
Normal file
215
share/mk/bsd.sys.mk
Normal file
@@ -0,0 +1,215 @@
|
||||
# $NetBSD: bsd.sys.mk,v 1.186 2009/11/30 16:13:23 uebayasi Exp $
|
||||
#
|
||||
# Build definitions used for NetBSD source tree builds.
|
||||
|
||||
.if !defined(_MINIX_SYS_MK_)
|
||||
_MINIX_SYS_MK_=1
|
||||
|
||||
.if defined(WARNS)
|
||||
.if ${WARNS} > 0
|
||||
CFLAGS+= -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
|
||||
#CFLAGS+= -Wmissing-declarations -Wredundant-decls -Wnested-externs
|
||||
# Add -Wno-sign-compare. -Wsign-compare is included in -Wall as of GCC 3.3,
|
||||
# but our sources aren't up for it yet. Also, add -Wno-traditional because
|
||||
# gcc includes #elif in the warnings, which is 'this code will not compile
|
||||
# in a traditional environment' warning, as opposed to 'this code behaves
|
||||
# differently in traditional and ansi environments' which is the warning
|
||||
# we wanted, and now we don't get anymore.
|
||||
CFLAGS+= -Wno-sign-compare -Wno-traditional
|
||||
.if !defined(NOGCCERROR)
|
||||
# Set assembler warnings to be fatal
|
||||
CFLAGS+= -Wa,--fatal-warnings
|
||||
.endif
|
||||
# Set linker warnings to be fatal
|
||||
# XXX no proper way to avoid "FOO is a patented algorithm" warnings
|
||||
# XXX on linking static libs
|
||||
.if (!defined(MKPIC) || ${MKPIC} != "no") && \
|
||||
(!defined(LDSTATIC) || ${LDSTATIC} != "-static")
|
||||
LDFLAGS+= -Wl,--fatal-warnings
|
||||
.endif
|
||||
.endif
|
||||
.if ${WARNS} > 1
|
||||
CFLAGS+= -Wreturn-type -Wswitch -Wshadow
|
||||
.endif
|
||||
.if ${WARNS} > 2
|
||||
CFLAGS+= -Wcast-qual -Wwrite-strings
|
||||
CFLAGS+= -Wextra -Wno-unused-parameter
|
||||
CXXFLAGS+= -Wabi
|
||||
CXXFLAGS+= -Wold-style-cast
|
||||
CXXFLAGS+= -Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder \
|
||||
-Wno-deprecated -Wno-non-template-friend \
|
||||
-Woverloaded-virtual -Wno-pmf-conversions -Wsign-promo -Wsynth
|
||||
.endif
|
||||
.if ${WARNS} > 3 && defined(HAVE_GCC) && ${HAVE_GCC} >= 3
|
||||
CFLAGS+= -Wsign-compare
|
||||
CFLAGS+= -std=gnu99
|
||||
.endif
|
||||
.endif
|
||||
|
||||
# XXX: Temporarily disabled for MINIX
|
||||
# CPPFLAGS+= ${AUDIT:D-D__AUDIT__}
|
||||
# CFLAGS+= ${CWARNFLAGS} ${NOGCCERROR:D:U-Werror}
|
||||
# LINTFLAGS+= ${DESTDIR:D-d ${DESTDIR}/usr/include}
|
||||
|
||||
.if (${MACHINE_ARCH} == "alpha") || \
|
||||
(${MACHINE_ARCH} == "hppa") || \
|
||||
(${MACHINE_ARCH} == "ia64") || \
|
||||
(${MACHINE_ARCH} == "mipsel") || (${MACHINE_ARCH} == "mipseb") || \
|
||||
(${MACHINE_ARCH} == "mips64el") || (${MACHINE_ARCH} == "mips64eb")
|
||||
HAS_SSP= no
|
||||
.else
|
||||
HAS_SSP= yes
|
||||
.endif
|
||||
|
||||
.if defined(USE_FORT) && (${USE_FORT} != "no")
|
||||
USE_SSP?= yes
|
||||
.if !defined(KERNSRCDIR) && !defined(KERN) # not for kernels nor kern modules
|
||||
CPPFLAGS+= -D_FORTIFY_SOURCE=2
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.if defined(USE_SSP) && (${USE_SSP} != "no") && (${BINDIR:Ux} != "/usr/mdec")
|
||||
.if ${HAS_SSP} == "yes"
|
||||
COPTS+= -fstack-protector -Wstack-protector --param ssp-buffer-size=1
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.if defined(MKSOFTFLOAT) && (${MKSOFTFLOAT} != "no")
|
||||
COPTS+= -msoft-float
|
||||
FOPTS+= -msoft-float
|
||||
.endif
|
||||
|
||||
.if defined(MKIEEEFP) && (${MKIEEEFP} != "no")
|
||||
.if ${MACHINE_ARCH} == "alpha"
|
||||
CFLAGS+= -mieee
|
||||
FFLAGS+= -mieee
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.if ${MACHINE} == "sparc64" && ${MACHINE_ARCH} == "sparc"
|
||||
CFLAGS+= -Wa,-Av8plus
|
||||
.endif
|
||||
|
||||
CFLAGS+= ${CPUFLAGS}
|
||||
AFLAGS+= ${CPUFLAGS}
|
||||
|
||||
# Position Independent Executable flags
|
||||
PIE_CFLAGS?= -fPIC -DPIC
|
||||
PIE_LDFLAGS?= -Wl,-pie -shared-libgcc
|
||||
PIE_AFLAGS?= -fPIC -DPIC
|
||||
|
||||
# Helpers for cross-compiling
|
||||
HOST_CC?= cc
|
||||
HOST_CFLAGS?= -O
|
||||
HOST_CFLAGS?=
|
||||
HOST_COMPILE.c?=${HOST_CC} ${HOST_CFLAGS} ${HOST_CPPFLAGS} -c
|
||||
HOST_COMPILE.cc?= ${HOST_CXX} ${HOST_CXXFLAGS} ${HOST_CPPFLAGS} -c
|
||||
.if defined(HOSTPROG_CXX)
|
||||
HOST_LINK.c?= ${HOST_CXX} ${HOST_CXXFLAGS} ${HOST_CPPFLAGS} ${HOST_LDFLAGS}
|
||||
.else
|
||||
HOST_LINK.c?= ${HOST_CC} ${HOST_CFLAGS} ${HOST_CPPFLAGS} ${HOST_LDFLAGS}
|
||||
.endif
|
||||
|
||||
HOST_CXX?= c++
|
||||
HOST_CXXFLAGS?= -O
|
||||
HOST_CXXFLAGS?=
|
||||
|
||||
HOST_CPP?= cpp
|
||||
HOST_CPPFLAGS?=
|
||||
|
||||
HOST_LD?= ld
|
||||
HOST_LDFLAGS?=
|
||||
|
||||
HOST_AR?= ar
|
||||
HOST_RANLIB?= ranlib
|
||||
|
||||
HOST_LN?= ln
|
||||
|
||||
# HOST_SH must be an absolute path
|
||||
HOST_SH?= /bin/sh
|
||||
|
||||
ELF2ECOFF?= elf2ecoff
|
||||
MKDEP?= mkdep
|
||||
OBJCOPY?= objcopy
|
||||
OBJDUMP?= objdump
|
||||
PAXCTL?= paxctl
|
||||
STRIP?= strip
|
||||
|
||||
# TOOL_* variables are defined in bsd.own.mk
|
||||
|
||||
.SUFFIXES: .o .ln .lo .c .cc .cpp .cxx .C .m ${YHEADER:D.h}
|
||||
|
||||
# C
|
||||
.c.o:
|
||||
${_MKTARGET_COMPILE}
|
||||
${COMPILE.c} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
|
||||
|
||||
.c.ln:
|
||||
${_MKTARGET_COMPILE}
|
||||
${LINT} ${LINTFLAGS} \
|
||||
${CPPFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
|
||||
${CPPFLAGS.${.IMPSRC:T}:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
|
||||
-i ${.IMPSRC}
|
||||
|
||||
# C++
|
||||
.cc.o .cpp.o .cxx.o .C.o:
|
||||
${_MKTARGET_COMPILE}
|
||||
${COMPILE.cc} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
|
||||
|
||||
# Objective C
|
||||
# (Defined here rather than in <sys.mk> because `.m' is not just
|
||||
# used for Objective C source)
|
||||
.m.o:
|
||||
${_MKTARGET_COMPILE}
|
||||
${COMPILE.m} ${OBJCOPTS} ${OBJCOPTS.${.IMPSRC:T}} ${.IMPSRC}
|
||||
|
||||
# Host-compiled C objects
|
||||
# The intermediate step is necessary for Sun CC, which objects to calling
|
||||
# object files anything but *.o
|
||||
.c.lo:
|
||||
${_MKTARGET_COMPILE}
|
||||
${HOST_COMPILE.c} -o ${.TARGET}.o ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
|
||||
mv ${.TARGET}.o ${.TARGET}
|
||||
|
||||
# C++
|
||||
.cc.lo .cpp.lo .cxx.lo .C.lo:
|
||||
${_MKTARGET_COMPILE}
|
||||
${HOST_COMPILE.cc} -o ${.TARGET}.o ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
|
||||
mv ${.TARGET}.o ${.TARGET}
|
||||
|
||||
# Assembly
|
||||
.s.o:
|
||||
${_MKTARGET_COMPILE}
|
||||
${COMPILE.s} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
|
||||
|
||||
.S.o:
|
||||
${_MKTARGET_COMPILE}
|
||||
${COMPILE.S} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
|
||||
|
||||
# Lex
|
||||
LFLAGS+= ${LPREFIX.${.IMPSRC:T}:D-P${LPREFIX.${.IMPSRC:T}}}
|
||||
LFLAGS+= ${LPREFIX:D-P${LPREFIX}}
|
||||
|
||||
.l.c:
|
||||
${_MKTARGET_LEX}
|
||||
${LEX.l} -o${.TARGET} ${.IMPSRC}
|
||||
|
||||
# Yacc
|
||||
YFLAGS+= ${YPREFIX.${.IMPSRC:T}:D-p${YPREFIX.${.IMPSRC:T}}} ${YHEADER.${.IMPSRC:T}:D-d}
|
||||
YFLAGS+= ${YPREFIX:D-p${YPREFIX}} ${YHEADER:D-d}
|
||||
|
||||
.ifdef QUIET_YACC
|
||||
.y.c:
|
||||
${_MKTARGET_YACC}
|
||||
${YACC.y} -o ${.TARGET} ${.IMPSRC} 2> /dev/null
|
||||
.else
|
||||
.y.c:
|
||||
${_MKTARGET_YACC}
|
||||
${YACC.y} -o ${.TARGET} ${.IMPSRC}
|
||||
.endif
|
||||
|
||||
.ifdef YHEADER
|
||||
.y.h: ${.TARGET:.h=.c}
|
||||
.endif
|
||||
|
||||
.endif # !defined(_MINIX_SYS_MK_)
|
||||
233
share/mk/sys.mk
Normal file
233
share/mk/sys.mk
Normal file
@@ -0,0 +1,233 @@
|
||||
# $NetBSD: sys.mk,v 1.99 2008/09/07 15:54:52 kent Exp $
|
||||
# @(#)sys.mk 8.2 (Berkeley) 3/21/94
|
||||
|
||||
unix?= We run MINIX.
|
||||
|
||||
.SUFFIXES: .a .o .ln .s .S .c .cc .cpp .cxx .C .f .F .r .p .l .y #.sh
|
||||
|
||||
.LIBS: .a
|
||||
|
||||
AR?= ar
|
||||
ARFLAGS?= rl
|
||||
RANLIB?= ranlib
|
||||
|
||||
AS?= as
|
||||
AFLAGS?=
|
||||
COMPILE.s?= ${CC} ${AFLAGS} -c
|
||||
LINK.s?= ${CC} ${AFLAGS} ${LDFLAGS}
|
||||
#COMPILE.S?= ${CC} ${AFLAGS} ${CPPFLAGS} -c -traditional-cpp
|
||||
COMPILE.S?= ${CC} ${AFLAGS} ${CPPFLAGS} -c
|
||||
LINK.S?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
|
||||
|
||||
CC?= cc
|
||||
.if ${MACHINE_ARCH} == "alpha" || \
|
||||
${MACHINE_ARCH} == "arm" || \
|
||||
${MACHINE_ARCH} == "x86_64" || \
|
||||
${MACHINE_ARCH} == "armeb" || \
|
||||
${MACHINE_ARCH} == "hppa" || \
|
||||
${MACHINE_ARCH} == "i386" || \
|
||||
${MACHINE_ARCH} == "m68k" || \
|
||||
${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb" || \
|
||||
${MACHINE_ARCH} == "mips64el" || ${MACHINE_ARCH} == "mips64eb" || \
|
||||
${MACHINE_ARCH} == "powerpc" || \
|
||||
${MACHINE_ARCH} == "sparc" || \
|
||||
${MACHINE_ARCH} == "sparc64"
|
||||
DBG?= -O2
|
||||
.elif ${MACHINE_ARCH} == "sh3el" || ${MACHINE_ARCH} == "sh3eb"
|
||||
# -O2 is too -falign-* zealous for low-memory sh3 machines
|
||||
DBG?= -Os -freorder-blocks
|
||||
.elif ${MACHINE_ARCH} == "vax"
|
||||
DBG?= -O1 -fgcse -fstrength-reduce -fgcse-after-reload
|
||||
.elif ${MACHINE_ARCH} == "m68000"
|
||||
# see src/doc/HACKS for details
|
||||
DBG?= -O1
|
||||
.else
|
||||
DBG?= -O
|
||||
DBG?=
|
||||
.endif
|
||||
CFLAGS?= ${DBG}
|
||||
LDFLAGS?=
|
||||
COMPILE.c?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
|
||||
LINK.c?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
|
||||
|
||||
CXX?= c++
|
||||
CXXFLAGS?= ${CFLAGS:N-Wno-traditional:N-Wstrict-prototypes:N-Wmissing-prototypes:N-Wno-pointer-sign:N-ffreestanding:N-std=gnu99}
|
||||
|
||||
__ALLSRC1= ${empty(DESTDIR):?${.ALLSRC}:${.ALLSRC:S|^${DESTDIR}|^destdir|}}
|
||||
__ALLSRC2= ${empty(MAKEOBJDIR):?${__ALLSRC1}:${__ALLSRC1:S|^${MAKEOBJDIR}|^obj|}}
|
||||
__ALLSRC3= ${empty(NETBSDSRCDIR):?${__ALLSRC2}:${__ALLSRC2:S|^${NETBSDSRCDIR}|^src|}}
|
||||
|
||||
_CXXSEED?= ${BUILDSEED:D-frandom-seed=${BUILDSEED:Q}/${__ALLSRC3:O:Q}/${.TARGET:Q}}
|
||||
|
||||
COMPILE.cc?= ${CXX} ${_CXXSEED} ${CXXFLAGS} ${CPPFLAGS} -c
|
||||
LINK.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
|
||||
|
||||
OBJC?= ${CC}
|
||||
OBJCFLAGS?= ${CFLAGS}
|
||||
COMPILE.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
|
||||
LINK.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
|
||||
|
||||
CPP?= cpp
|
||||
CPPFLAGS?=
|
||||
|
||||
FC?= f77
|
||||
FFLAGS?= -O
|
||||
RFLAGS?=
|
||||
COMPILE.f?= ${FC} ${FFLAGS} -c
|
||||
LINK.f?= ${FC} ${FFLAGS} ${LDFLAGS}
|
||||
COMPILE.F?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
|
||||
LINK.F?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
|
||||
COMPILE.r?= ${FC} ${FFLAGS} ${RFLAGS} -c
|
||||
LINK.r?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
|
||||
|
||||
INSTALL?= install
|
||||
|
||||
LD?= ld
|
||||
|
||||
LEX?= lex
|
||||
LFLAGS?=
|
||||
LEX.l?= ${LEX} ${LFLAGS}
|
||||
|
||||
LINT?= lint
|
||||
LINTFLAGS?= -chapbxzFS
|
||||
|
||||
LORDER?= lorder
|
||||
|
||||
MAKE?= make
|
||||
|
||||
NM?= nm
|
||||
|
||||
PC?= pc
|
||||
PFLAGS?=
|
||||
COMPILE.p?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
|
||||
LINK.p?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
|
||||
|
||||
SHELL?= sh
|
||||
|
||||
SIZE?= size
|
||||
|
||||
TSORT?= tsort -q
|
||||
|
||||
YACC?= yacc
|
||||
YFLAGS?=
|
||||
YACC.y?= ${YACC} ${YFLAGS}
|
||||
|
||||
# C
|
||||
.c:
|
||||
${LINK.c} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
|
||||
.c.o:
|
||||
${COMPILE.c} ${.IMPSRC}
|
||||
.c.a:
|
||||
${COMPILE.c} ${.IMPSRC}
|
||||
${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
|
||||
rm -f ${.PREFIX}.o
|
||||
.c.ln:
|
||||
${LINT} ${LINTFLAGS} \
|
||||
${CPPFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
|
||||
-i ${.IMPSRC}
|
||||
|
||||
# C++
|
||||
.cc .cpp .cxx .C:
|
||||
${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
|
||||
.cc.o .cpp.o .cxx.o .C.o:
|
||||
${COMPILE.cc} ${.IMPSRC}
|
||||
.cc.a .cpp.a .cxx.a .C.a:
|
||||
${COMPILE.cc} ${.IMPSRC}
|
||||
${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
|
||||
rm -f ${.PREFIX}.o
|
||||
|
||||
# Fortran/Ratfor
|
||||
.f:
|
||||
${LINK.f} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
|
||||
.f.o:
|
||||
${COMPILE.f} ${.IMPSRC}
|
||||
.f.a:
|
||||
${COMPILE.f} ${.IMPSRC}
|
||||
${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
|
||||
rm -f ${.PREFIX}.o
|
||||
|
||||
.F:
|
||||
${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
|
||||
.F.o:
|
||||
${COMPILE.F} ${.IMPSRC}
|
||||
.F.a:
|
||||
${COMPILE.F} ${.IMPSRC}
|
||||
${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
|
||||
rm -f ${.PREFIX}.o
|
||||
|
||||
.r:
|
||||
${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
|
||||
.r.o:
|
||||
${COMPILE.r} ${.IMPSRC}
|
||||
.r.a:
|
||||
${COMPILE.r} ${.IMPSRC}
|
||||
${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
|
||||
rm -f ${.PREFIX}.o
|
||||
|
||||
# Pascal
|
||||
.p:
|
||||
${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
|
||||
.p.o:
|
||||
${COMPILE.p} ${.IMPSRC}
|
||||
.p.a:
|
||||
${COMPILE.p} ${.IMPSRC}
|
||||
${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
|
||||
rm -f ${.PREFIX}.o
|
||||
|
||||
# Assembly
|
||||
.s:
|
||||
${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
|
||||
.s.o:
|
||||
${COMPILE.s} ${.IMPSRC}
|
||||
.s.a:
|
||||
${COMPILE.s} ${.IMPSRC}
|
||||
${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
|
||||
rm -f ${.PREFIX}.o
|
||||
.S:
|
||||
${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
|
||||
.S.o:
|
||||
${COMPILE.S} ${.IMPSRC}
|
||||
.S.a:
|
||||
${COMPILE.S} ${.IMPSRC}
|
||||
${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
|
||||
rm -f ${.PREFIX}.o
|
||||
|
||||
# Lex
|
||||
.l:
|
||||
${LEX.l} ${.IMPSRC}
|
||||
${LINK.c} -o ${.TARGET} lex.yy.c ${LDLIBS} -ll
|
||||
rm -f lex.yy.c
|
||||
.l.c:
|
||||
${LEX.l} ${.IMPSRC}
|
||||
mv lex.yy.c ${.TARGET}
|
||||
.l.o:
|
||||
${LEX.l} ${.IMPSRC}
|
||||
${COMPILE.c} -o ${.TARGET} lex.yy.c
|
||||
rm -f lex.yy.c
|
||||
|
||||
# Yacc
|
||||
.y:
|
||||
${YACC.y} ${.IMPSRC}
|
||||
${LINK.c} -o ${.TARGET} y.tab.c ${LDLIBS}
|
||||
rm -f y.tab.c
|
||||
.y.c:
|
||||
${YACC.y} ${.IMPSRC}
|
||||
mv y.tab.c ${.TARGET}
|
||||
.y.o:
|
||||
${YACC.y} ${.IMPSRC}
|
||||
${COMPILE.c} -o ${.TARGET} y.tab.c
|
||||
rm -f y.tab.c
|
||||
|
||||
# Shell
|
||||
# .sh:
|
||||
# rm -f ${.TARGET}
|
||||
# cp ${.IMPSRC} ${.TARGET}
|
||||
# chmod a+x ${.TARGET}
|
||||
|
||||
# MINIX
|
||||
.if !empty(CC:Mcc)
|
||||
COMPILER_TYPE=ack
|
||||
.elif !empty(CC:Mgcc)
|
||||
COMPILER_TYPE=gnu
|
||||
AR=gar
|
||||
.endif
|
||||
Reference in New Issue
Block a user