meta.stage.mk (5f1e34d9) meta.stage.mk (6a91b982)
1# $Id: meta.stage.mk,v 1.30 2013/04/19 16:32:57 sjg Exp $
1# $Id: meta.stage.mk,v 1.32 2014/10/18 05:48:02 sjg Exp $
2#
3# @(#) Copyright (c) 2011, Simon J. Gerraty
4#
5# This file is provided in the hope that it will
6# be of use. There is absolutely NO WARRANTY.
7# Permission to copy, redistribute or otherwise
8# use this file is hereby granted provided that
9# the above copyright notice and this notice are

--- 31 unchanged lines hidden (view full) ---

41.export _STAGED_DIRS
42# add each dir we stage to to _STAGED_DIRS
43# and make sure we have absolute paths so that bmake
44# will match against .MAKE.META.BAILIWICK
45STAGE_DIR_FILTER = tA:@d@$${_STAGED_DIRS::+=$$d}$$d@
46# convert _STAGED_DIRS into suitable filters
47GENDIRDEPS_FILTER += Nnot-empty-is-important \
48 ${_STAGED_DIRS:O:u:M${OBJTOP}*:S,${OBJTOP}/,N,} \
2#
3# @(#) Copyright (c) 2011, Simon J. Gerraty
4#
5# This file is provided in the hope that it will
6# be of use. There is absolutely NO WARRANTY.
7# Permission to copy, redistribute or otherwise
8# use this file is hereby granted provided that
9# the above copyright notice and this notice are

--- 31 unchanged lines hidden (view full) ---

41.export _STAGED_DIRS
42# add each dir we stage to to _STAGED_DIRS
43# and make sure we have absolute paths so that bmake
44# will match against .MAKE.META.BAILIWICK
45STAGE_DIR_FILTER = tA:@d@$${_STAGED_DIRS::+=$$d}$$d@
46# convert _STAGED_DIRS into suitable filters
47GENDIRDEPS_FILTER += Nnot-empty-is-important \
48 ${_STAGED_DIRS:O:u:M${OBJTOP}*:S,${OBJTOP}/,N,} \
49 ${_STAGED_DIRS:O:u:N${OBJTOP}*:S,${_objroot},,:C,^([^/]+)/(.*),N\2.\1,:S,${HOST_TARGET},.host,}
49 ${_STAGED_DIRS:O:u:M${_objroot}*:N${OBJTOP}*:S,${_objroot},,:C,^([^/]+)/(.*),N\2.\1,:S,${HOST_TARGET},.host,}
50
51LN_CP_SCRIPT = LnCp() { \
52 rm -f $$2 2> /dev/null; \
53 ln $$1 $$2 2> /dev/null || \
54 cp -p $$1 $$2; }
55
56# it is an error for more than one src dir to try and stage
57# the same file

--- 50 unchanged lines hidden (view full) ---

108 LnCp $$s $$t || exit 1; \
109 [ -z "$$mode" ] || chmod $$mode $$t; \
110 done; :; }
111
112# this is simple, a list of the "staged" files depends on this,
113_STAGE_BASENAME_USE: .USE ${.TARGET:T}
114 @${STAGE_FILE_SCRIPT}; StageFiles ${.TARGET:H:${STAGE_DIR_FILTER}} ${.TARGET:T}
115
50
51LN_CP_SCRIPT = LnCp() { \
52 rm -f $$2 2> /dev/null; \
53 ln $$1 $$2 2> /dev/null || \
54 cp -p $$1 $$2; }
55
56# it is an error for more than one src dir to try and stage
57# the same file

--- 50 unchanged lines hidden (view full) ---

108 LnCp $$s $$t || exit 1; \
109 [ -z "$$mode" ] || chmod $$mode $$t; \
110 done; :; }
111
112# this is simple, a list of the "staged" files depends on this,
113_STAGE_BASENAME_USE: .USE ${.TARGET:T}
114 @${STAGE_FILE_SCRIPT}; StageFiles ${.TARGET:H:${STAGE_DIR_FILTER}} ${.TARGET:T}
115
116_STAGE_AS_BASENAME_USE: .USE ${.TARGET:T}
117 @${STAGE_AS_SCRIPT}; StageAs ${.TARGET:H:${STAGE_DIR_FILTER}} ${.TARGET:T} ${STAGE_AS_${.TARGET:T}:U${.TARGET:T}}
118
116.if !empty(STAGE_INCSDIR)
117STAGE_TARGETS += stage_incs
118STAGE_INCS ?= ${.ALLSRC:N.dirdep}
119
120stage_incs: .dirdep
121 @${STAGE_FILE_SCRIPT}; StageFiles ${STAGE_INCSDIR:${STAGE_DIR_FILTER}} ${STAGE_INCS}
122 @touch $@
123.endif

--- 111 unchanged lines hidden (view full) ---

235
236# if ${INSTALL} gets run during 'all' assume it is for staging?
237.if ${.TARGETS:Nall} == "" && defined(STAGE_INSTALL)
238INSTALL := ${STAGE_INSTALL}
239.if target(beforeinstall)
240beforeinstall: .dirdep
241.endif
242.endif
119.if !empty(STAGE_INCSDIR)
120STAGE_TARGETS += stage_incs
121STAGE_INCS ?= ${.ALLSRC:N.dirdep}
122
123stage_incs: .dirdep
124 @${STAGE_FILE_SCRIPT}; StageFiles ${STAGE_INCSDIR:${STAGE_DIR_FILTER}} ${STAGE_INCS}
125 @touch $@
126.endif

--- 111 unchanged lines hidden (view full) ---

238
239# if ${INSTALL} gets run during 'all' assume it is for staging?
240.if ${.TARGETS:Nall} == "" && defined(STAGE_INSTALL)
241INSTALL := ${STAGE_INSTALL}
242.if target(beforeinstall)
243beforeinstall: .dirdep
244.endif
245.endif
246.NOPATH: ${STAGE_FILES}
243
244.endif
247
248.endif