]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/mk/local.sys.env.mk
Optionally bind ktls threads to NUMA domains
[FreeBSD/FreeBSD.git] / share / mk / local.sys.env.mk
1 # $FreeBSD$
2
3 # This makefile is for customizations that should be done early
4
5 .if !defined(_TARGETS)
6 # some things we do only once
7 _TARGETS:= ${.TARGETS}
8 .export _TARGETS
9 .endif
10
11 # some handy macros
12 _this = ${.PARSEDIR:tA}/${.PARSEFILE}
13 # some useful modifiers
14
15 # A useful trick for testing multiple :M's against something
16 # :L says to use the variable's name as its value - ie. literal
17 # got = ${clean* destroy:${M_ListToMatch:S,V,.TARGETS,}}
18 M_ListToMatch = L:@m@$${V:M$$m}@
19 # match against our initial targets (see above)
20 M_L_TARGETS = ${M_ListToMatch:S,V,_TARGETS,}
21
22 # turn a list into a set of :N modifiers
23 # NskipFoo = ${Foo:${M_ListToSkip}}
24 M_ListToSkip= O:u:ts::S,:,:N,g:S,^,N,
25
26 # type should be a builtin in any sh since about 1980,
27 # AUTOCONF := ${autoconf:L:${M_whence}}
28 M_type = @x@(type $$x 2> /dev/null); echo;@:sh:[0]:N* found*:[@]:C,[()],,g
29 M_whence = ${M_type}:M/*:[1]
30
31 # convert a path to a valid shell variable
32 M_P2V = tu:C,[./-],_,g
33
34 # these are handy
35 # we can use this for a cheap timestamp at the start of a target's script,
36 # but not at the end - since make will expand both at the same time.
37 TIME_STAMP_FMT = @ %s [%Y-%m-%d %T]
38 TIME_STAMP = ${TIME_STAMP_FMT:localtime}
39 # this will produce the same output but as of when date(1) is run.
40 TIME_STAMP_DATE = `date '+${TIME_STAMP_FMT}'`
41 TIME_STAMP_END?= ${TIME_STAMP_DATE}
42
43 # Simplify auto.obj.mk mkdir -p handling and avoid unneeded/redundant
44 # error spam and show a proper error.
45 Mkdirs= Mkdirs() { mkdir -p $$* || :; }
46
47 .if !empty(.MAKEFLAGS:M-s)
48 ECHO_TRACE?=    true
49 .endif
50
51 .include "src.sys.env.mk"