2 .if !target(__<bsd.symver.mk>__)
7 # Generate the version map given the version definitions
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
14 CLEANFILES+= ${VERSION_MAP}
16 .if ${MAKE_VERSION} >= 20230123
19 # Compute the make's -m path.
22 .for _arg in ${.MAKEFLAGS}
28 _mpath+= /usr/share/mk
31 # Look up ${VERSION_GEN} in ${_mpath}.
33 .for path in ${_mpath}
35 .if exists(${path}/${VERSION_GEN})
36 _vgen= ${path}/${VERSION_GEN}
41 .error ${VERSION_GEN} not found in the search path.
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>__)