3 .if !target(__<bsd.symver.mk>__)
8 # Generate the version map given the version definitions
10 .if !empty(VERSION_DEF) && !empty(SYMBOL_MAPS)
11 # Find the awk script that generates the version map.
12 VERSION_GEN?= version_gen.awk
13 VERSION_MAP?= Version.map
15 CLEANFILES+= ${VERSION_MAP}
17 .if ${MAKE_VERSION} >= 20230123
20 # Compute the make's -m path.
23 .for _arg in ${.MAKEFLAGS}
29 _mpath+= /usr/share/mk
32 # Look up ${VERSION_GEN} in ${_mpath}.
34 .for path in ${_mpath}
36 .if exists(${path}/${VERSION_GEN})
37 _vgen= ${path}/${VERSION_GEN}
42 .error ${VERSION_GEN} not found in the search path.
45 # Run the symbol maps through the C preprocessor before passing
46 # them to the symbol version generator.
47 ${VERSION_MAP}: ${VERSION_DEF} ${_vgen} ${SYMBOL_MAPS}
48 cat ${SYMBOL_MAPS} | ${CPP} - - \
49 | awk -v vfile=${VERSION_DEF} -f ${_vgen} > ${.TARGET}
50 .endif # !empty(VERSION_DEF) && !empty(SYMBOL_MAPS)
51 .endif # !target(__<bsd.symver.mk>__)