diff options
Diffstat (limited to 'contrib/bmake/mk')
-rw-r--r-- | contrib/bmake/mk/ChangeLog | 11 | ||||
-rw-r--r-- | contrib/bmake/mk/gendirdeps.mk | 15 | ||||
-rw-r--r-- | contrib/bmake/mk/install-mk | 4 | ||||
-rw-r--r-- | contrib/bmake/mk/libs.mk | 57 | ||||
-rw-r--r-- | contrib/bmake/mk/progs.mk | 18 |
5 files changed, 86 insertions, 19 deletions
diff --git a/contrib/bmake/mk/ChangeLog b/contrib/bmake/mk/ChangeLog index db1e289f92b1..b5471975a010 100644 --- a/contrib/bmake/mk/ChangeLog +++ b/contrib/bmake/mk/ChangeLog @@ -1,3 +1,14 @@ +2013-09-04 Simon J. Gerraty <sjg@bad.crufty.net> + + * gendirdeps.mk (_objtops): fix typo also + while processing M2D_OBJROOTS to gather qualdir_list + qualify $ql with loop iterator to ensure correct results. + +2013-08-01 Simon J. Gerraty <sjg@bad.crufty.net> + + * install-mk (MK_VERSION): 20130801 + * libs.mk: update to match progs.mk + 2013-07-26 Simon J. Gerraty <sjg@bad.crufty.net> * install-mk (MK_VERSION): 20130726 diff --git a/contrib/bmake/mk/gendirdeps.mk b/contrib/bmake/mk/gendirdeps.mk index 9be367369f57..20e2b152a3fa 100644 --- a/contrib/bmake/mk/gendirdeps.mk +++ b/contrib/bmake/mk/gendirdeps.mk @@ -1,4 +1,4 @@ -# $Id: gendirdeps.mk,v 1.22 2013/05/11 05:16:26 sjg Exp $ +# $Id: gendirdeps.mk,v 1.23 2013/09/04 17:49:20 sjg Exp $ # Copyright (c) 2010-2013, Juniper Networks, Inc. # All rights reserved. @@ -162,7 +162,7 @@ dir_list != cd ${_OBJDIR} && \ .warning Skipping ${_DEPENDFILE:S,${SRCTOP}/,,} # we are not going to update anything .else - +dpadd_dir_list= .if !empty(DPADD) _nonlibs := ${DPADD:T:Nlib*:N*include} .if !empty(_nonlibs) @@ -174,6 +174,7 @@ ddep_list += $f.dirdep ddep_list += ${f:H}.dirdep .else dir_list += ${f:H:tA} +dpadd_dir_list += ${f:H:tA} .endif .endfor .if !empty(ddep_list) @@ -197,7 +198,7 @@ dir_list += ${ddeps} # so we add # ${"${dir_list:M*bsd/sys/${MACHINE_ARCH}/include}":?bsd/include:} # to GENDIRDEPS_DIR_LIST_XTRAS -_objtops = ${OBJTOP} ${_OBJTOP} ${_obtop} +_objtops = ${OBJTOP} ${_OBJTOP} ${_objtop} _objtops := ${_objtops:O:u} dirdep_list = \ ${_objtops:@o@${dir_list:M$o*/*:C,$o[^/]*/,,}@} \ @@ -212,8 +213,11 @@ M2D_OBJROOTS := ${M2D_OBJROOTS:O:u:[-1..1]} skip_ql= ${SRCTOP}* ${_objtops:@o@$o*@} .for o in ${M2D_OBJROOTS:${skip_ql:${M_ListToSkip}}} # we need := so only skip_ql to this point applies -ql := ${dir_list:${skip_ql:${M_ListToSkip}}:M$o*/*/*:C,$o([^/]+)/(.*),\2.\1,:S,.${HOST_TARGET},.host,} -qualdir_list += ${ql} +ql.$o := ${dir_list:${skip_ql:${M_ListToSkip}}:M$o*/*/*:C,$o([^/]+)/(.*),\2.\1,:S,.${HOST_TARGET},.host,} +qualdir_list += ${ql.$o} +.if ${DEBUG_GENDIRDEPS:Uno:@x@${RELDIR:M$x}@} != "" +.info ${RELDIR}: o=$o ${ql.$o qualdir_list:L:@v@$v=${$v}@} +.endif skip_ql+= $o* .endfor @@ -241,6 +245,7 @@ DIRDEPS := ${DIRDEPS:${GENDIRDEPS_FILTER:UNno:ts:}:O:u} .if ${DEBUG_GENDIRDEPS:Uno:@x@${RELDIR:M$x}@} != "" .info ${RELDIR}: M2D_OBJROOTS=${M2D_OBJROOTS} .info ${RELDIR}: dir_list='${dir_list}' +.info ${RELDIR}: dpadd_dir_list='${dpadd_dir_list}' .info ${RELDIR}: dirdep_list='${dirdep_list}' .info ${RELDIR}: qualdir_list='${qualdir_list}' .info ${RELDIR}: SKIP_GENDIRDEPS='${SKIP_GENDIRDEPS}' diff --git a/contrib/bmake/mk/install-mk b/contrib/bmake/mk/install-mk index 59b1b0151fee..0640906a2438 100644 --- a/contrib/bmake/mk/install-mk +++ b/contrib/bmake/mk/install-mk @@ -55,7 +55,7 @@ # Simon J. Gerraty <sjg@crufty.net> # RCSid: -# $Id: install-mk,v 1.92 2013/07/27 05:37:37 sjg Exp $ +# $Id: install-mk,v 1.93 2013/08/02 18:28:47 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -70,7 +70,7 @@ # sjg@crufty.net # -MK_VERSION=20130726 +MK_VERSION=20130801 OWNER= GROUP= MODE=444 diff --git a/contrib/bmake/mk/libs.mk b/contrib/bmake/mk/libs.mk index 05b450689b11..7f974bfa86b9 100644 --- a/contrib/bmake/mk/libs.mk +++ b/contrib/bmake/mk/libs.mk @@ -1,4 +1,4 @@ -# $Id: libs.mk,v 1.2 2007/04/30 17:39:27 sjg Exp $ +# $Id: libs.mk,v 1.3 2013/08/02 18:28:48 sjg Exp $ # # @(#) Copyright (c) 2006, Simon J. Gerraty # @@ -17,7 +17,15 @@ .if defined(LIBS) +# In meta mode, we can capture dependenices for _one_ of the progs. +# if makefile doesn't nominate one, we use the first. +.ifndef UPDATE_DEPENDFILE_LIB +UPDATE_DEPENDFILE_LIB = ${LIBS:[1]} +.export UPDATE_DEPENDFILE_LIB +.endif + .ifndef LIB +# They may have asked us to build just one .for t in ${LIBS:R:T:S,^lib,,} .if make(lib$t) LIB?= $t @@ -28,14 +36,41 @@ lib$t: all .if defined(LIB) # just one of many -.for v in DPADD SRCS CFLAGS ${LIB_VARS} -$v += ${${v}_lib${LIB}} +LIB_VARS += \ + LIBDIR \ + CFLAGS \ + COPTS \ + CPPFLAGS \ + CXXFLAGS \ + DPADD \ + DPLIBS \ + LDADD \ + LDFLAGS \ + MAN \ + SRCS + +.for v in ${LIB_VARS:O:u} +.if defined(${v}.${LIB}) || defined(${v}_${LIB}) +$v += ${${v}_${LIB}:U${${v}.${LIB}}} +.endif .endfor + +# for meta mode, there can be only one! +.if ${LIB} == ${UPDATE_DEPENDFILE_LIB:Uno} +UPDATE_DEPENDFILE ?= yes +.endif +UPDATE_DEPENDFILE ?= NO + # ensure that we don't clobber each other's dependencies DEPENDFILE?= .depend.${LIB} # lib.mk will do the rest .else all: ${LIBS:S,^lib,,:@t@lib$t.a@} .MAKE + +# We cannot capture dependencies for meta mode here +UPDATE_DEPENDFILE = NO +# nor can we safely run in parallel. +.NOTPARALLEL: .endif .endif @@ -43,12 +78,16 @@ all: ${LIBS:S,^lib,,:@t@lib$t.a@} .MAKE .include <${.PARSEFILE:S,libs,lib,}> .ifndef LIB -.for t in ${LIBS:R:T:S,^lib,,} -lib$t.a: ${SRCS} ${DPADD} ${SRCS_lib$t} ${DPADD_lib$t} - (cd ${.CURDIR} && ${.MAKE} -f ${MAKEFILE} LIB=$t) +# tell libs.mk we might want to install things +LIBS_TARGETS+= cleandepend cleandir cleanobj depend install -clean: $t.clean -$t.clean: - (cd ${.CURDIR} && ${.MAKE} -f ${MAKEFILE} LIB=$t ${@:E}) +.for b in ${LIBS:R:T:S,^lib,,} +lib$b.a: ${SRCS} ${DPADD} ${SRCS_lib$b} ${DPADD_lib$b} + (cd ${.CURDIR} && ${.MAKE} -f ${MAKEFILE} LIB=$b) + +.for t in ${LIBS_TARGETS:O:u} +$b.$t: .PHONY .MAKE + (cd ${.CURDIR} && ${.MAKE} -f ${MAKEFILE} LIB=$b ${@:E}) +.endfor .endfor .endif diff --git a/contrib/bmake/mk/progs.mk b/contrib/bmake/mk/progs.mk index f74f64012849..7ccebbffb44c 100644 --- a/contrib/bmake/mk/progs.mk +++ b/contrib/bmake/mk/progs.mk @@ -1,4 +1,4 @@ -# $Id: progs.mk,v 1.12 2013/04/22 18:10:04 sjg Exp $ +# $Id: progs.mk,v 1.13 2013/08/02 18:28:48 sjg Exp $ # # @(#) Copyright (c) 2006, Simon J. Gerraty # @@ -35,9 +35,21 @@ PROG ?= $t .if defined(PROG) # just one of many -PROG_VARS += BINDIR CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS LDADD MAN SRCS +PROG_VARS += \ + BINDIR \ + CFLAGS \ + COPTS \ + CPPFLAGS \ + CXXFLAGS \ + DPADD \ + DPLIBS \ + LDADD \ + LDFLAGS \ + MAN \ + SRCS + .for v in ${PROG_VARS:O:u} -.if defined(${v}.${PROG}) +.if defined(${v}.${PROG}) || defined(${v}_${PROG}) $v += ${${v}_${PROG}:U${${v}.${PROG}}} .endif .endfor |