svn commit: r189505 - projects/jbuild/bld
John Birrell
jb at FreeBSD.org
Sat Mar 7 19:14:09 PST 2009
Author: jb
Date: Sun Mar 8 03:14:08 2009
New Revision: 189505
URL: http://svn.freebsd.org/changeset/base/189505
Log:
Add the jbuild system makefiles. These are a WIP
Added:
projects/jbuild/bld/
projects/jbuild/bld/bsd.buildfiles.mk
projects/jbuild/bld/bsd.cpu.mk
projects/jbuild/bld/bsd.dirdep.mk
projects/jbuild/bld/bsd.doc.mk
projects/jbuild/bld/bsd.endian.mk
projects/jbuild/bld/bsd.files.mk
projects/jbuild/bld/bsd.genfiles.mk
projects/jbuild/bld/bsd.headers.mk
projects/jbuild/bld/bsd.hostlib.mk
projects/jbuild/bld/bsd.hostprog.mk
projects/jbuild/bld/bsd.incs.mk
projects/jbuild/bld/bsd.info.mk
projects/jbuild/bld/bsd.init.mk
projects/jbuild/bld/bsd.kernconf.mk
projects/jbuild/bld/bsd.kernel.mk
projects/jbuild/bld/bsd.kmod.mk
projects/jbuild/bld/bsd.lib.mk
projects/jbuild/bld/bsd.man.mk
projects/jbuild/bld/bsd.objs.mk
projects/jbuild/bld/bsd.pkg.mk
projects/jbuild/bld/bsd.prog.mk
projects/jbuild/bld/bsd.relfiles.mk
projects/jbuild/bld/bsd.scripts.mk
projects/jbuild/bld/bsd.snmpmod.mk
projects/jbuild/bld/bsd.subdir.mk
projects/jbuild/bld/bsd.symver.mk
projects/jbuild/bld/sys.mk
Added: projects/jbuild/bld/bsd.buildfiles.mk
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/jbuild/bld/bsd.buildfiles.mk Sun Mar 8 03:14:08 2009 (r189505)
@@ -0,0 +1,8 @@
+# $FreeBSD$
+
+.if ${__MKLVL__} != 1
+all: genfiles
+.endif
+
+.include <bsd.dirdep.mk>
+.include <bsd.genfiles.mk>
Added: projects/jbuild/bld/bsd.cpu.mk
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/jbuild/bld/bsd.cpu.mk Sun Mar 8 03:14:08 2009 (r189505)
@@ -0,0 +1,194 @@
+# $FreeBSD: src/share/mk/bsd.cpu.mk,v 1.48 2005/05/24 21:24:40 cognet Exp $
+
+# Set default CPU compile flags and baseline CPUTYPE for each arch. The
+# compile flags must support the minimum CPU type for each architecture but
+# may tune support for more advanced processors.
+
+.if !defined(CPUTYPE) || empty(CPUTYPE)
+_CPUCFLAGS =
+. if ${MACHINE_ARCH} == "i386"
+MACHINE_CPU = i486
+. elif ${MACHINE_ARCH} == "alpha"
+_CPUCFLAGS = -mcpu=ev4 -mtune=ev5
+MACHINE_CPU = ev4
+. elif ${MACHINE_ARCH} == "amd64"
+MACHINE_CPU = amd64 sse2 sse
+. elif ${MACHINE_ARCH} == "ia64"
+MACHINE_CPU = itanium
+. elif ${MACHINE_ARCH} == "sparc64"
+. elif ${MACHINE_ARCH} == "arm"
+MACHINE_CPU = arm
+. elif ${MACHINE_ARCH} == "mips"
+MACHINE_CPU = mips
+. endif
+.else
+
+# Handle aliases (not documented in make.conf to avoid user confusion
+# between e.g. i586 and pentium)
+
+. if ${MACHINE_ARCH} == "i386"
+. if ${CPUTYPE} == "nocona"
+CPUTYPE = prescott
+. elif ${CPUTYPE} == "p4"
+CPUTYPE = pentium4
+. elif ${CPUTYPE} == "p4m"
+CPUTYPE = pentium4m
+. elif ${CPUTYPE} == "p3"
+CPUTYPE = pentium3
+. elif ${CPUTYPE} == "p3m"
+CPUTYPE = pentium3m
+. elif ${CPUTYPE} == "p-m"
+CPUTYPE = pentium-m
+. elif ${CPUTYPE} == "p2"
+CPUTYPE = pentium2
+. elif ${CPUTYPE} == "i686"
+CPUTYPE = pentiumpro
+. elif ${CPUTYPE} == "i586/mmx"
+CPUTYPE = pentium-mmx
+. elif ${CPUTYPE} == "i586"
+CPUTYPE = pentium
+. elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || \
+ ${CPUTYPE} == "k8"
+CPUTYPE = athlon-mp
+. elif ${CPUTYPE} == "k7"
+CPUTYPE = athlon
+. endif
+. elif ${MACHINE_ARCH} == "amd64"
+. if ${CPUTYPE} == "prescott"
+CPUTYPE = nocona
+. endif
+. endif
+
+###############################################################################
+# Logic to set up correct gcc optimization flag. This must be included
+# after /etc/make.conf so it can react to the local value of CPUTYPE
+# defined therein. Consult:
+# http://gcc.gnu.org/onlinedocs/gcc/DEC-Alpha-Options.html
+# http://gcc.gnu.org/onlinedocs/gcc/IA-64-Options.html
+# http://gcc.gnu.org/onlinedocs/gcc/RS-6000-and-PowerPC-Options.html
+# http://gcc.gnu.org/onlinedocs/gcc/SPARC-Options.html
+# http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86-64-Options.html
+
+. if ${MACHINE_ARCH} == "i386"
+. if ${CPUTYPE} == "crusoe"
+_CPUCFLAGS = -march=i686 -falign-functions=0 -falign-jumps=0 -falign-loops=0
+. elif ${CPUTYPE} == "k5"
+_CPUCFLAGS = -march=pentium
+. else
+_CPUCFLAGS = -march=${CPUTYPE}
+. endif # GCC on 'i386'
+. if ${CPUTYPE} == "crusoe"
+_ICC_CPUCFLAGS = -tpp6 -xiM
+. elif ${CPUTYPE} == "athlon-mp" || ${CPUTYPE} == "athlon-xp" || \
+ ${CPUTYPE} == "athlon-4"
+_ICC_CPUCFLAGS = -tpp6 -xiMK
+. elif ${CPUTYPE} == "athlon-tbird" || ${CPUTYPE} == "athlon"
+_ICC_CPUCFLAGS = -tpp6 -xiM
+. elif ${CPUTYPE} == "k6-3" || ${CPUTYPE} == "k6-2" || ${CPUTYPE} == "k6"
+_ICC_CPUCFLAGS = -tpp6 -xi
+. elif ${CPUTYPE} == "k5"
+_ICC_CPUCFLAGS = -tpp5
+. elif ${CPUTYPE} == "pentium4" || ${CPUTYPE} == "pentium4m"
+_ICC_CPUCFLAGS = -tpp7 -xiMKW
+. elif ${CPUTYPE} == "pentium3" || ${CPUTYPE} == "pentium3m" || \
+ ${CPUTYPE} == "pentium-m"
+_ICC_CPUCFLAGS = -tpp6 -xiMK
+. elif ${CPUTYPE} == "pentium2" || ${CPUTYPE} == "pentiumpro"
+_ICC_CPUCFLAGS = -tpp6 -xiM
+. elif ${CPUTYPE} == "pentium-mmx"
+_ICC_CPUCFLAGS = -tpp5 -xM
+. elif ${CPUTYPE} == "pentium"
+_ICC_CPUCFLAGS = -tpp5
+. else
+_ICC_CPUCFLAGS =
+. endif # ICC on 'i386'
+. elif ${MACHINE_ARCH} == "alpha"
+_CPUCFLAGS = -mcpu=${CPUTYPE}
+. elif ${MACHINE_ARCH} == "amd64"
+_CPUCFLAGS = -march=${CPUTYPE}
+. elif ${MACHINE_ARCH} == "arm"
+. if ${CPUTYPE} == "xscale"
+#XXX: gcc doesn't seem to like -mcpu=xscale, and dies while rebuilding itself
+#_CPUCFLAGS = -mcpu=xscale
+_CPUCFLAGS = -march=armv5te -D__XSCALE__
+. else
+_CPUCFLAGS = -mcpu=${CPUTYPE}
+. endif
+. endif
+
+# Set up the list of CPU features based on the CPU type. This is an
+# unordered list to make it easy for client makefiles to test for the
+# presence of a CPU feature.
+
+. if ${MACHINE_ARCH} == "i386"
+. if ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64"
+MACHINE_CPU = athlon-xp athlon k7 3dnow sse2 sse mmx k6 k5 i586 i486 i386
+. elif ${CPUTYPE} == "athlon-mp" || ${CPUTYPE} == "athlon-xp" || \
+ ${CPUTYPE} == "athlon-4"
+MACHINE_CPU = athlon-xp athlon k7 3dnow sse mmx k6 k5 i586 i486 i386
+. elif ${CPUTYPE} == "athlon" || ${CPUTYPE} == "athlon-tbird"
+MACHINE_CPU = athlon k7 3dnow mmx k6 k5 i586 i486 i386
+. elif ${CPUTYPE} == "k6-3" || ${CPUTYPE} == "k6-2"
+MACHINE_CPU = 3dnow mmx k6 k5 i586 i486 i386
+. elif ${CPUTYPE} == "k6"
+MACHINE_CPU = mmx k6 k5 i586 i486 i386
+. elif ${CPUTYPE} == "k5"
+MACHINE_CPU = k5 i586 i486 i386
+. elif ${CPUTYPE} == "pentium4" || ${CPUTYPE} == "pentium4m" || ${CPUTYPE} == "pentium-m"
+MACHINE_CPU = sse2 sse i686 mmx i586 i486 i386
+. elif ${CPUTYPE} == "pentium3" || ${CPUTYPE} == "pentium3m"
+MACHINE_CPU = sse i686 mmx i586 i486 i386
+. elif ${CPUTYPE} == "pentium2"
+MACHINE_CPU = i686 mmx i586 i486 i386
+. elif ${CPUTYPE} == "pentiumpro"
+MACHINE_CPU = i686 i586 i486 i386
+. elif ${CPUTYPE} == "pentium-mmx"
+MACHINE_CPU = mmx i586 i486 i386
+. elif ${CPUTYPE} == "pentium"
+MACHINE_CPU = i586 i486 i386
+. elif ${CPUTYPE} == "i486"
+MACHINE_CPU = i486 i386
+. elif ${CPUTYPE} == "i386"
+MACHINE_CPU = i386
+. endif
+. elif ${MACHINE_ARCH} == "alpha"
+. if ${CPUTYPE} == "ev6"
+MACHINE_CPU = ev6 ev56 pca56 ev5 ev45 ev4
+. elif ${CPUTYPE} == "pca56"
+MACHINE_CPU = pca56 ev56 ev5 ev45 ev4
+. elif ${CPUTYPE} == "ev56"
+MACHINE_CPU = ev56 ev5 ev45 ev4
+. elif ${CPUTYPE} == "ev5"
+MACHINE_CPU = ev5 ev45 ev4
+. elif ${CPUTYPE} == "ev45"
+MACHINE_CPU = ev45 ev4
+. elif ${CPUTYPE} == "ev4"
+MACHINE_CPU = ev4
+. endif
+. elif ${MACHINE_ARCH} == "amd64"
+. if ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || ${CPUTYPE} == "k8"
+MACHINE_CPU = k8 3dnow
+. elif ${CPUTYPE} == "nocona"
+MACHINE_CPU = sse3
+. endif
+MACHINE_CPU += amd64 sse2 sse mmx
+. elif ${MACHINE_ARCH} == "ia64"
+. if ${CPUTYPE} == "itanium"
+MACHINE_CPU = itanium
+. endif
+. endif
+.endif
+
+.if ${MACHINE_ARCH} == "alpha"
+_CPUCFLAGS += -mieee
+.endif
+
+# NB: COPTFLAGS is handled in /usr/src/sys/conf/kern.pre.mk
+
+.if !defined(NO_CPU_CFLAGS)
+. if ${CC} == "icc"
+CFLAGS += ${_ICC_CPUCFLAGS}
+. else
+CFLAGS += ${_CPUCFLAGS}
+. endif
+.endif
Added: projects/jbuild/bld/bsd.dirdep.mk
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/jbuild/bld/bsd.dirdep.mk Sun Mar 8 03:14:08 2009 (r189505)
@@ -0,0 +1,379 @@
+#
+# $FreeBSD$
+#
+
+# This list of include makefiles is passed to jdirdep for it to use when
+# deciding where in a Buildfile to write the DIRDEP= and SRCDIRDEP= lines.
+INCMK= \
+ bsd.buildlib.mk \
+ bsd.buildtools.mk \
+ bsd.headers.mk \
+ bsd.kernconf.mk \
+ bsd.kernel.mk \
+ bsd.lib.mk \
+ bsd.objs.mk \
+ bsd.package.mk \
+ bsd.prog.mk \
+ bsd.scripts.mk
+
+JDIRDEP ?= jdirdep
+
+ENV_JDIRDEP= CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} SRCTOP=${.SRCTOP} SUPMAC=${MACHINE_LIST:Q}
+.for t in ${MACHINE_LIST}
+ENV_JDIRDEP+= MACHINE_ARCH_${t:S/-/_/g}=${MACHINE_ARCH.${t}}
+.endfor
+ENV_JDIRDEP+= INCMK=${INCMK:Q}
+
+_ONE_MACHINE = no
+
+.if defined(HOSTPROG)
+_ONE_MACHINE= yes
+ONE_MACHINE = host
+.endif
+
+.if defined(COMMONDIR)
+_ONE_MACHINE= yes
+ONE_MACHINE = common
+.endif
+
+.if defined(TARGET_MACHINE)
+_ONE_MACHINE= yes
+ONE_MACHINE = ${TARGET_MACHINE}
+.endif
+
+# Generate Buildfile.dirdep for the current directory.
+# Note: This writes to the source tree!
+.if make(gendirdep)
+
+.if ${.SRCREL} == stage
+DIRDEP =
+.elif !defined(DIRDEP)
+DIRDEP = stage
+.endif
+
+PARINC=
+.if exists(${.CURDIR}/../Buildfile.inc)
+PARINC= ${.CURDIR}/../Buildfile.inc
+.endif
+
+_DIRDEP=
+_XDIRDEP=
+.for d in ${DIRDEP}
+_d=${d:M*MACHINE_ARCH*}
+.if !empty(_d)
+_XDIRDEP+= ${d}
+.else
+_DIRDEP+= ${d}
+.endif
+.endfor
+
+.for t in ${MACHINE_LIST}
+DIRDEP.${t}?=
+.endfor
+
+BUILDFILE_DIRDEP= ${.CURDIR}/Buildfile.dirdep
+
+gendirdep : .PHONY
+ rm -f ${BUILDFILE_DIRDEP}
+ echo "# This file is automatically generated. DO NOT EDIT!" >> ${BUILDFILE_DIRDEP}
+ echo ".if !defined(NODIRDEP)" >> ${BUILDFILE_DIRDEP}
+.for t in ${MACHINE_LIST}
+.if !empty(DIRDEP.${t})
+ { echo "# DIRDEP.${t}= ${DIRDEP.${t}}"; \
+ for _d in ${DIRDEP.${t}}; \
+ do \
+ echo ".if empty(D_INC_DONE:M$${_d})"; \
+ echo "D_INC_DONE+= $${_d}"; \
+ echo -n "D_INC_DONE:= $$"; \
+ echo "{D_INC_DONE}"; \
+ echo -n ".if exists($$"; \
+ echo "{.SRCTOP}/$${_d}/Buildfile.dirdep)"; \
+ echo -n ".include \"$$"; \
+ echo "{.SRCTOP}/$${_d}/Buildfile.dirdep\""; \
+ echo ".endif"; \
+ echo ".endif"; \
+ echo ""; \
+ done; \
+ } >> ${BUILDFILE_DIRDEP}
+.endif
+.endfor
+ { echo "# DIRDEP= ${DIRDEP}"; \
+ } >> ${BUILDFILE_DIRDEP}
+.if defined(DIRDEP) && !empty(DIRDEP)
+ { for _d in ${_DIRDEP}; \
+ do \
+ echo ".if empty(D_INC_DONE:M$${_d})"; \
+ echo "D_INC_DONE+= $${_d}"; \
+ echo -n "D_INC_DONE:= $$"; \
+ echo "{D_INC_DONE}"; \
+ echo -n ".if exists($$"; \
+ echo "{.SRCTOP}/$${_d}/Buildfile.dirdep)"; \
+ echo -n ".include \"$$"; \
+ echo "{.SRCTOP}/$${_d}/Buildfile.dirdep\""; \
+ echo ".endif"; \
+ echo ".endif"; \
+ echo ""; \
+ done; \
+ for _d in ${_XDIRDEP}; \
+ do \
+ echo -n ".for t in $$"; \
+ echo "{MACHINE_LIST}"; \
+ echo "_d=$$_d"; \
+ echo -n ".if empty(D_INC_DONE:M$$"; \
+ echo -n "{_d:S,MACHINE_ARCH,$$"; \
+ echo -n "{MACHINE_ARCH.$$"; \
+ echo "{t}},g})"; \
+ echo -n "D_INC_DONE+= $$"; \
+ echo -n "{_d:S,MACHINE_ARCH,$$"; \
+ echo -n "{MACHINE_ARCH.$$"; \
+ echo "{t}},g}"; \
+ echo -n "D_INC_DONE:= $$"; \
+ echo "{D_INC_DONE}"; \
+ echo -n ".if exists($$"; \
+ echo -n "{.SRCTOP}/$$"; \
+ echo -n "{_d:S,MACHINE_ARCH,$$"; \
+ echo -n "{MACHINE_ARCH.$$"; \
+ echo "{t}},g}/Buildfile.dirdep)"; \
+ echo -n ".include \"$$"; \
+ echo -n "{.SRCTOP}/$$"; \
+ echo -n "{_d:S,MACHINE_ARCH,$$"; \
+ echo -n "{MACHINE_ARCH.$$"; \
+ echo "{t}},g}/Buildfile.dirdep\""; \
+ echo ".endif"; \
+ echo ".endif"; \
+ echo ""; \
+ echo ".endfor"; \
+ done; \
+ } >> ${BUILDFILE_DIRDEP}
+.endif
+ echo ".endif" >> ${BUILDFILE_DIRDEP}
+ { echo ""; \
+ echo -n ".for t in $$"; \
+ echo "{MACHINE_LIST}"; \
+ echo -n "D_TGTS_$$"; \
+ echo "{t}="; \
+ echo ".endfor"; \
+ echo ""; \
+ } >> ${BUILDFILE_DIRDEP}
+ echo ".if !defined(NODIRDEP)" >> ${BUILDFILE_DIRDEP}
+.for t in ${MACHINE_LIST}
+.if !empty(DIRDEP.${t})
+ { for _d in ${DIRDEP.${t}}; \
+ do \
+ echo -n ".if exists($$"; \
+ echo "{.SRCTOP}/$${_d}/Buildfile.dirdep)"; \
+ echo -n "D_TGTS_${t}+="; \
+ echo -n " $$"; \
+ echo "{.OBJROOT}/${t}/$${_d}/all"; \
+ echo -n "D_TGTS_${t}:= $$"; \
+ echo "{D_TGTS_${t}}"; \
+ echo ".endif"; \
+ echo ""; \
+ done; \
+ } >> ${BUILDFILE_DIRDEP}
+.endif
+.endfor
+.if defined(ONLY_MACHINE)
+ echo "_MACHINE_LIST:= ${ONLY_MACHINE}" >> ${BUILDFILE_DIRDEP}
+.else
+ { echo -n "_MACHINE_LIST:= $$"; \
+ echo "{MACHINE_LIST}";
+ } >> ${BUILDFILE_DIRDEP}
+.endif
+.if defined(DIRDEP) && !empty(DIRDEP)
+ { for _d in ${_DIRDEP}; \
+ do \
+ echo -n ".if exists($$"; \
+ echo "{.SRCTOP}/$${_d}/Buildfile.dirdep)"; \
+ echo -n ".for _t in $$"; \
+ echo "{_MACHINE_LIST}"; \
+ echo -n "D_TGTS_$$"; \
+ echo -n "{_t}+="; \
+ echo -n " $$"; \
+ echo -n "{.OBJROOT}/$$"; \
+ echo "{_t}/$${_d}/all"; \
+ echo -n "D_TGTS_$$"; \
+ echo -n "{_t}:= $$"; \
+ echo -n "{D_TGTS_$$"; \
+ echo "{_t}}"; \
+ echo ".endfor"; \
+ echo ".endif"; \
+ echo ""; \
+ done; \
+ for _d in ${_XDIRDEP}; \
+ do \
+ echo -n ".for t in $$"; \
+ echo "{_MACHINE_LIST}"; \
+ echo "_d=$$_d"; \
+ echo -n ".if exists($$"; \
+ echo -n "{.SRCTOP}/$$"; \
+ echo -n "{_d:S,MACHINE_ARCH,$$"; \
+ echo -n "{MACHINE_ARCH.$$"; \
+ echo "{t}},g}/Buildfile.dirdep)"; \
+ echo -n "D_TGTS_$$"; \
+ echo -n "{t}+="; \
+ echo -n " $$"; \
+ echo -n "{.OBJROOT}/$$"; \
+ echo -n "{t}/$$"; \
+ echo -n "{_d:S,MACHINE_ARCH,$$"; \
+ echo -n "{MACHINE_ARCH.$$"; \
+ echo "{t}},g}/all"; \
+ echo -n "D_TGTS_$$"; \
+ echo -n "{t}:= $$"; \
+ echo -n "{D_TGTS_$$"; \
+ echo "{t}}"; \
+ echo ".endif"; \
+ echo ""; \
+ echo ".endfor"; \
+ done; \
+ echo ""; \
+ } >> ${BUILDFILE_DIRDEP}
+.endif
+ echo ".endif" >> ${BUILDFILE_DIRDEP}
+ { \
+ if [ ${_ONE_MACHINE} = yes ]; \
+ then \
+ echo -n ".for t in $$"; \
+ echo "{MACHINE_LIST:N${ONE_MACHINE}}"; \
+ echo -n "$$"; \
+ echo -n "{.OBJROOT}/$$"; \
+ echo -n "{t}/${.SRCREL}/all : $$"; \
+ echo "{.OBJROOT}/${ONE_MACHINE}/${.SRCREL}/all .PHONY"; \
+ echo ".endfor"; \
+ echo -n "$$"; \
+ echo -n "{.OBJROOT}/${ONE_MACHINE}/${.SRCREL}/all : $$"; \
+ echo "{D_TGTS_${ONE_MACHINE}} .PHONY"; \
+ echo -n " echo Checking $$"; \
+ echo "{.OBJROOT}/${ONE_MACHINE}/${.SRCREL}"; \
+ echo -n " cd $$"; \
+ echo -n "{.SRCTOP}/${.SRCREL} && MACHINE=${ONE_MACHINE} $$"; \
+ echo -n "{MAKE} $$"; \
+ echo "{.MAKEFLAGS:NMACHINE=*:N-DALLMACHINES} all"; \
+ else \
+ echo -n ".for t in $$"; \
+ echo "{MACHINE_LIST}"; \
+ echo -n "$$"; \
+ echo -n "{.OBJROOT}/$$"; \
+ echo -n "{t}/${.SRCREL}/all : $$"; \
+ echo -n "{D_TGTS_$$"; \
+ echo "{t}} .PHONY"; \
+ echo -n " echo Checking $$"; \
+ echo -n "{.OBJROOT}/$$"; \
+ echo "{t}/${.SRCREL}"; \
+ echo -n " cd $$"; \
+ echo -n "{.SRCTOP}/${.SRCREL} && MACHINE=$$"; \
+ echo -n "{t} $$"; \
+ echo -n "{MAKE} $$"; \
+ echo "{.MAKEFLAGS:NMACHINE=*:N-DALLMACHINES} all"; \
+ echo ".endfor"; \
+ fi; \
+ } >> ${BUILDFILE_DIRDEP}
+
+# Figure out what DIRDEP= should be
+.elif make(getdirdep)
+
+getdirdep : .PHONY
+ echo "Reading the meta data files to determine the directory dependencies..."
+ ${ENV_JDIRDEP} ${JDIRDEP}
+
+# Generate a graph of directory dependencies
+.elif make(graphdirdep)
+
+graphdirdep : .PHONY
+ ${ENV_JDIRDEP} ${JDIRDEP} -g
+ unflatten -l 4 -f 4 ${.OBJDIR}/dirdep.gv | dot -Tps2 -o ${.OBJDIR}/dirdep.ps
+ ps2pdf ${.OBJDIR}/dirdep.ps ${.OBJDIR}/dirdep.pdf
+
+# Do a recursive update of DIRDEP= in the Buildfiles
+.elif make(regendirdep)
+
+regendirdep : .PHONY
+ echo "Updating Buildfile.dirdep ..."
+ ${ENV_JDIRDEP} ${JDIRDEP} -rf
+
+# Do a recursive parse of meta data to check for source usage
+.elif make(rsrcdirdep)
+
+rsrcdirdep : .PHONY
+ echo "Parsing meta data for source usage..."
+ ${ENV_JDIRDEP} ${JDIRDEP} -rs
+
+# Do a parse of meta data to check for source usage
+.elif make(srcdirdep)
+
+srcdirdep : .PHONY
+ echo "Parsing meta data for source usage..."
+ ${ENV_JDIRDEP} ${JDIRDEP} -s
+
+# Do a recursive update of DIRDEP= in the Buildfiles
+.elif make(rupdatedirdep)
+
+rupdatedirdep : .PHONY
+ echo "Updating DIRDEP in Buildfile..."
+ ${ENV_JDIRDEP} ${JDIRDEP} -rsu
+
+# Update of DIRDEP= in the current Buildfile
+.elif make(updatedirdep)
+
+updatedirdep : .PHONY
+ echo "Updating DIRDEP in Buildfiles..."
+ ${ENV_JDIRDEP} ${JDIRDEP} -su
+
+.else
+
+# D_INC_DONE is used to keep track of which dependencies have been included
+# to avoid including more than once. See the generation code above.
+D_INC_DONE=
+
+# Only include dependencies in the top-level build
+.if ${__MKLVL__} == 1
+# Generate the initial Buildfile.dirdep if there isn't one yet.
+.if !exists(${.CURDIR}/Buildfile.dirdep)
+__X!= cd ${.CURDIR} && ${MAKE} gendirdep
+.endif
+# Include the dependencies for the things that this directory depends on.
+# This will recursively include all other dependencies until we have a
+# complete set starting with this directory.
+.include "${.CURDIR}/Buildfile.dirdep"
+
+.if target(all)
+.error "The top level 'all' target is defined only in bsd.dirdep.mk!"
+.else
+# This is the main target for _all_ top level builds. It is used only to
+# do builds on a directory by directory basis, including this directory.
+all : dirdep .PHONY
+
+D_TGTS=
+
+.if ${_ONE_MACHINE} == yes
+D_TGTS+= ${.OBJROOT}/${ONE_MACHINE}/${.SRCREL}/all
+.else
+.if defined(ONLY_MACHINE)
+_MACHINES=
+.for m in ${ONLY_MACHINE}
+.if !empty(MACHINES:M${m})
+_MACHINES+= ${m}
+_MACHINES:= ${_MACHINES}
+.endif
+.endfor
+MACHINES:= ${_MACHINES}
+.endif
+
+.for t in ${MACHINES}
+D_TGTS+= ${D_TGTS_${t}}
+D_TGTS+= ${.OBJROOT}/${t}/${.SRCREL}/all
+.endfor
+.endif
+
+dirdep : ${D_TGTS} .PHONY
+.endif
+
+.else
+.if !target(all)
+# We do everything by dependencies.
+all : .PHONY
+.endif
+.endif
+
+.endif
+
Added: projects/jbuild/bld/bsd.doc.mk
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/jbuild/bld/bsd.doc.mk Sun Mar 8 03:14:08 2009 (r189505)
@@ -0,0 +1,186 @@
+# from: @(#)bsd.doc.mk 5.3 (Berkeley) 1/2/91
+# $FreeBSD: src/share/mk/bsd.doc.mk,v 1.59 2004/12/21 09:33:42 ru Exp $
+#
+# The include file <bsd.doc.mk> handles installing BSD troff documents.
+#
+#
+# +++ variables +++
+#
+# DCOMPRESS_CMD Program to compress troff documents. Output is to stdout.
+# [${COMPRESS_CMD}]
+#
+# DESTDIR Change the tree where the documents get installed. [not set]
+#
+# DOC Document name. [paper]
+#
+# EXTRA Extra files (not SRCS) that make up the document. [not set]
+#
+# LPR Printer command. [lpr]
+#
+# MACROS Macro packages used to build the document. [not set]
+#
+# NO_DOCCOMPRESS If you do not want formatted troff documents to be
+# compressed when they are installed. [not set]
+#
+# PRINTERDEVICE Indicates which output formats will be generated
+# (ascii, ps, html). [ascii]
+#
+# SRCDIR Directory where source files live. [${.CURDIR}]
+#
+# SRCS List of source files. [not set]
+#
+# TRFLAGS Additional flags to groff(1). [not set]
+#
+# USE_EQN If set, preprocess with eqn(1). [not set]
+#
+# USE_PIC If set, preprocess with pic(1). [not set]
+#
+# USE_REFER If set, preprocess with refer(1). [not set]
+#
+# USE_SOELIM If set, preprocess with soelim(1). [not set]
+#
+# USE_TBL If set, preprocess with tbl(1). [not set]
+#
+# VOLUME Volume the document belongs to. [not set]
+
+PRINTERDEVICE?= ascii
+
+BIB?= bib
+GREMLIN?= grn
+GRIND?= vgrind -f
+INDXBIB?= indxbib
+PIC?= pic
+REFER?= refer
+.for _dev in ${PRINTERDEVICE:Mascii}
+ROFF.ascii?= groff -Tascii ${TRFLAGS} -mtty-char ${MACROS} -o${PAGES}
+.endfor
+.for _dev in ${PRINTERDEVICE:Nascii}
+ROFF.${_dev}?= groff -T${_dev} ${TRFLAGS} ${MACROS} -o${PAGES}
+.endfor
+SOELIM?= soelim
+TBL?= tbl
+
+DOC?= paper
+LPR?= lpr
+
+.if defined(USE_EQN)
+TRFLAGS+= -e
+.endif
+.if defined(USE_PIC)
+TRFLAGS+= -p
+.endif
+.if defined(USE_REFER)
+TRFLAGS+= -R
+.endif
+.if defined(USE_SOELIM)
+TRFLAGS+= -I${SRCDIR}
+.endif
+.if defined(USE_TBL)
+TRFLAGS+= -t
+.endif
+
+DCOMPRESS_EXT?= ${COMPRESS_EXT}
+DCOMPRESS_CMD?= ${COMPRESS_CMD}
+.for _dev in ${PRINTERDEVICE:Mhtml}
+DFILE.html= ${DOC}.html
+.endfor
+.for _dev in ${PRINTERDEVICE:Nhtml}
+.if defined(NO_DOCCOMPRESS)
+DFILE.${_dev}= ${DOC}.${_dev}
+.else
+DFILE.${_dev}= ${DOC}.${_dev}${DCOMPRESS_EXT}
+.endif
+.endfor
+
+PAGES?= 1-
+
+UNROFF?= unroff
+HTML_SPLIT?= yes
+UNROFFFLAGS?= -fhtml
+.if ${HTML_SPLIT} == "yes"
+UNROFFFLAGS+= split=1
+.endif
+
+# Compatibility mode flag for groff. Use this when formatting documents with
+# Berkeley me macros (orig_me(7)).
+COMPAT?= -C
+
+.PATH: ${.CURDIR} ${SRCDIR}
+
+.for _dev in ${PRINTERDEVICE}
+all: ${DFILE.${_dev}}
+.endfor
+
+.if !target(print)
+.for _dev in ${PRINTERDEVICE}
+print: ${DFILE.${_dev}}
+.endfor
+print:
+.for _dev in ${PRINTERDEVICE}
+.if defined(NO_DOCCOMPRESS)
+ ${LPR} ${DFILE.${_dev}}
+.else
+ ${DCOMPRESS_CMD} -d ${DFILE.${_dev}} | ${LPR}
+.endif
+.endfor
+.endif
+
+realinstall:
+.for _dev in ${PRINTERDEVICE:Mhtml}
+ cd ${SRCDIR}; \
+ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
+ ${DOC}*.html ${DESTDIR}${BINDIR}/${VOLUME}
+.endfor
+.for _dev in ${PRINTERDEVICE:Nhtml}
+ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
+ ${DFILE.${_dev}} ${DESTDIR}${BINDIR}/${VOLUME}
+.endfor
+
+spell: ${SRCS}
+ (cd ${.CURDIR}; spell ${SRCS} ) | sort | \
+ comm -23 - ${.CURDIR}/spell.ok > ${DOC}.spell
+
+BINDIR?= /usr/share/doc
+BINMODE= 444
+
+SRCDIR?= ${.CURDIR}
+
+.if defined(EXTRA) && !empty(EXTRA)
+_stamp.extra: ${EXTRA}
+ touch ${.TARGET}
+.endif
+
+.for _dev in ${PRINTERDEVICE:Nhtml}
+.if !target(${DFILE.${_dev}})
+.if target(_stamp.extra)
+${DFILE.${_dev}}: _stamp.extra
+.endif
+${DFILE.${_dev}}: ${SRCS}
+.if defined(NO_DOCCOMPRESS)
+ ${ROFF.${_dev}} ${.ALLSRC:N_stamp.extra} > ${.TARGET}
+.else
+ ${ROFF.${_dev}} ${.ALLSRC:N_stamp.extra} | ${DCOMPRESS_CMD} > ${.TARGET}
+.endif
+.endif
+.endfor
+
+.for _dev in ${PRINTERDEVICE:Mhtml}
+.if !target(${DFILE.html})
+.if target(_stamp.extra)
+${DFILE.html}: _stamp.extra
+.endif
+${DFILE.html}: ${SRCS}
+.if defined(MACROS) && !empty(MACROS)
+ cd ${SRCDIR}; ${UNROFF} ${MACROS} ${UNROFFFLAGS} \
+ document=${DOC} ${SRCS}
+.else # unroff(1) requires a macro package as an argument
+ cd ${SRCDIR}; ${UNROFF} -ms ${UNROFFFLAGS} \
+ document=${DOC} ${SRCS}
+.else
+.endif
+.endif
+.endfor
+
+DISTRIBUTION?= doc
+
+.include <bsd.obj.mk>
Added: projects/jbuild/bld/bsd.endian.mk
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/jbuild/bld/bsd.endian.mk Sun Mar 8 03:14:08 2009 (r189505)
@@ -0,0 +1,14 @@
+# $FreeBSD: src/share/mk/bsd.endian.mk,v 1.5 2008/04/28 14:54:17 gonzo Exp $
+
+.if ${MACHINE_ARCH} == "amd64" || \
+ ${MACHINE_ARCH} == "i386" || \
+ ${MACHINE_ARCH} == "ia64" || \
+ (${MACHINE_ARCH} == "arm" && !defined(TARGET_BIG_ENDIAN)) || \
+ (${MACHINE_ARCH} == "mips" && !defined(TARGET_BIG_ENDIAN))
+TARGET_ENDIANNESS= 1234
+.elif ${MACHINE_ARCH} == "powerpc" || \
+ ${MACHINE_ARCH} == "sparc64" || \
+ ${MACHINE_ARCH} == "arm" || \
+ ${MACHINE_ARCH} == "mips"
+TARGET_ENDIANNESS= 4321
+.endif
Added: projects/jbuild/bld/bsd.files.mk
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/jbuild/bld/bsd.files.mk Sun Mar 8 03:14:08 2009 (r189505)
@@ -0,0 +1,65 @@
+# $FreeBSD: src/share/mk/bsd.files.mk,v 1.4 2005/04/11 07:13:29 harti Exp $
+
+FILESGROUPS?= FILES
+
+.if !target(buildfiles)
+.for group in ${FILESGROUPS}
+buildfiles: ${${group}}
+.endfor
+.endif
+
+all: buildfiles
+
+.if !target(installfiles)
+.for group in ${FILESGROUPS}
+.if defined(${group}) && !empty(${group})
+
+${group}OWN?= ${SHAREOWN}
+${group}GRP?= ${SHAREGRP}
+${group}MODE?= ${SHAREMODE}
+${group}DIR?= ${BINDIR}
+
+_${group}FILES=
+.for file in ${${group}}
+.if defined(${group}OWN_${file:T}) || defined(${group}GRP_${file:T}) || \
+ defined(${group}MODE_${file:T}) || defined(${group}DIR_${file:T}) || \
+ defined(${group}NAME_${file:T})
+${group}OWN_${file:T}?= ${${group}OWN}
+${group}GRP_${file:T}?= ${${group}GRP}
+${group}MODE_${file:T}?= ${${group}MODE}
+${group}DIR_${file:T}?= ${${group}DIR}
+.if defined(${group}NAME)
+${group}NAME_${file:T}?= ${${group}NAME}
+.else
+${group}NAME_${file:T}?= ${file:T}
+.endif
+installfiles: _${group}INS_${file:T}
+_${group}INS_${file:T}: ${file}
+ ${INSTALL} -o ${${group}OWN_${.ALLSRC:T}} \
+ -g ${${group}GRP_${.ALLSRC:T}} -m ${${group}MODE_${.ALLSRC:T}} \
+ ${.ALLSRC} \
+ ${DESTDIR}${${group}DIR_${.ALLSRC:T}}/${${group}NAME_${.ALLSRC:T}}
+.else
+_${group}FILES+= ${file}
+.endif
+.endfor
+.if !empty(_${group}FILES)
+installfiles: _${group}INS
+_${group}INS: ${_${group}FILES}
+.if defined(${group}NAME)
+ ${INSTALL} -o ${${group}OWN} -g ${${group}GRP} \
+ -m ${${group}MODE} ${.ALLSRC} \
+ ${DESTDIR}${${group}DIR}/${${group}NAME}
+.else
+ ${INSTALL} -o ${${group}OWN} -g ${${group}GRP} \
+ -m ${${group}MODE} ${.ALLSRC} ${DESTDIR}${${group}DIR}
+.endif
+.endif
+
+.endif # defined(${group}) && !empty(${group})
+.endfor
+
+.endif # !target(installfiles)
+
+realinstall: installfiles
+.ORDER: beforeinstall installfiles
Added: projects/jbuild/bld/bsd.genfiles.mk
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/jbuild/bld/bsd.genfiles.mk Sun Mar 8 03:14:08 2009 (r189505)
@@ -0,0 +1,68 @@
+# $FreeBSD$
+#
+# Built files
+#
+# Any headers in the source file list are built
+BUILTFILES+= ${SRCS:M*.h}
+
+# Any generated source files are built
+GENSRCS?=
+GENHDRS?=
+BUILTFILES+= ${GENSRCS} ${GENHDRS}
+
+# The directory dependencies must be complete before the generated
+# sources and headers are built.
+.for _S in ${GENSRCS} ${GENHDRS}
+.ORDER: dirdep ${_S}
+.endfor
+
+# Any yacc files in the source file list are built into a C file and
+# a corresponding header
+.for _S in ${SRCS:M*.y} ${GENSRCS:M*.y}
+BUILTFILES+= ${_S:R}.h ${_S:R}.c
+.endfor
+
+# Rules to build the C file and header from yacc source
+.for _S in ${SRCS:M*.y} ${GENSRCS:M*.y}
+${_S:R}.h: ${_S}
+ ${YACC} ${YFLAGS} -d -b ${_S:R} ${.ALLSRC}
+ mv ${_S:R}.tab.h ${_S:R}.h
+ mv ${_S:R}.tab.c ${_S:R}.c
+${_S:R}.c: ${_S:R}.h
+.ORDER: dirdep ${_S:R}.h ${_S:R}.c
+.endfor
+
+# Any lex files in the source file list are built into a C file
+.for _S in ${SRCS:M*.l} ${GENSRCS:M*.l}
+BUILTFILES+= ${_S:R}.c
+.endfor
+
+# Rules to build the C file from lex source
+.for _S in ${SRCS:M*.l} ${GENSRCS:M*.l}
+${_S:R}.c: ${_S}
+ ${LEX} ${LFLAGS} -o${.TARGET} ${.ALLSRC}
+.ORDER: dirdep ${_S:R}.c
+.endfor
+
+# Any m4 files in the source file list are built into a C file
+.for _S in ${SRCS:M*.m4}
+BUILTFILES+= ${_S:R}.c
+.endfor
+
+.for _S in ${SRCS:M*.m4}
+.ORDER: dirdep ${_S:R}.c
+.endfor
+
+# Any error table files in the source file list are built into a C file and
+# a corresponding header
+.for _S in ${SRCS:M*.et}
+BUILTFILES+= ${_S:R}.h ${_S:R}.c
+.endfor
+
+# Rules to build the C file and header from error table source
+.for _S in ${SRCS:M*.et}
+${_S:R}.c ${_S:R}.h: ${_S}
+ compile_et ${.ALLSRC}
+.endfor
+
+genfiles: ${BUILTFILES}
Added: projects/jbuild/bld/bsd.headers.mk
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/jbuild/bld/bsd.headers.mk Sun Mar 8 03:14:08 2009 (r189505)
@@ -0,0 +1,65 @@
+
+.if defined(HOSTPROG) && ${MACHINE} != ${HOST_MACHINE}
+
+# This is a host program and we're not building the host so all we want to
+# do is update our dependencies which will include the host program.
+.if ${__MKLVL__} != 1
+all : .PHONY
+.endif
+
+.include <bsd.dirdep.mk>
+
+.else
+.if defined(NOT_MACHINE_ARCH) && !empty(NOT_MACHINE_ARCH:M${MACHINE_ARCH})
+DONT_DO_IT=
+.endif
+
+.if defined(NOT_MACHINE) && !empty(NOT_MACHINE:M${MACHINE})
+DONT_DO_IT=
+.endif
+
+.if defined(ONLY_MACHINE) && empty(ONLY_MACHINE:M${MACHINE})
+DONT_DO_IT=
+.endif
+
+.if defined(COMMONDIR) && ${MACHINE} != common
+DONT_DO_IT=
+.endif
+
+.if defined(HOSTPROG) && ${MACHINE} != host
+DONT_DO_IT=
+.endif
+
+.if defined(TARGET_MACHINE) && ${MACHINE} != ${TARGET_MACHINE}
+DONT_DO_IT=
+.endif
+
+.if defined(DONT_DO_IT)
+
+.if ${__MKLVL__} != 1
+all: .PHONY
+.endif
+
+.else
+.if ${__MKLVL__} != 1
+all : genfiles allincs relfiles
+.ORDER : genfiles allincs relfiles
+.endif
+.endif
+
+.if make(checkheaders)
+_HEADERS != ls ${.CURDIR}/*.h
+.for i in ${_HEADERS:T}
+.if empty(INCS:M${i})
+X!= echo "${i} is not in INCS" >&2; echo
+.endif
+.endfor
+
+checkheaders: .PHONY
+.endif
+
+.include <bsd.dirdep.mk>
+.include <bsd.genfiles.mk>
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-projects
mailing list