]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/mk/bsd.symver.mk
sqlite3: Vendor import of sqlite3 3.43.1
[FreeBSD/FreeBSD.git] / share / mk / bsd.symver.mk
1
2 .if !target(__<bsd.symver.mk>__)
3 __<bsd.symver.mk>__:
4
5 .include <bsd.init.mk>
6
7 # Generate the version map given the version definitions
8 # and symbol maps.
9 .if !empty(VERSION_DEF) && !empty(SYMBOL_MAPS)
10 # Find the awk script that generates the version map.
11 VERSION_GEN?=   version_gen.awk
12 VERSION_MAP?=   Version.map
13
14 CLEANFILES+=    ${VERSION_MAP}
15
16 .if ${MAKE_VERSION} >= 20230123
17 _mpath= ${.SYSPATH}
18 .else
19 # Compute the make's -m path.
20 _mpath=
21 _oarg=
22 .for _arg in ${.MAKEFLAGS}
23 .if ${_oarg} == "-m"
24 _mpath+= ${_arg}
25 .endif
26 _oarg=  ${_arg}
27 .endfor
28 _mpath+= /usr/share/mk
29 .endif
30
31 # Look up ${VERSION_GEN} in ${_mpath}.
32 _vgen=
33 .for path in ${_mpath}
34 .if empty(_vgen)
35 .if exists(${path}/${VERSION_GEN})
36 _vgen=  ${path}/${VERSION_GEN}
37 .endif
38 .endif
39 .endfor
40 .if empty(_vgen)
41 .error ${VERSION_GEN} not found in the search path.
42 .endif
43
44 # Run the symbol maps through the C preprocessor before passing
45 # them to the symbol version generator.
46 ${VERSION_MAP}: ${VERSION_DEF} ${_vgen} ${SYMBOL_MAPS}
47         cat ${SYMBOL_MAPS} | ${CPP} - - \
48             | awk -v vfile=${VERSION_DEF} -f ${_vgen} > ${.TARGET}
49 .endif  # !empty(VERSION_DEF) && !empty(SYMBOL_MAPS)
50 .endif  # !target(__<bsd.symver.mk>__)