diff options
Diffstat (limited to 'mk/mkc_imp.platform.sys.mk')
-rw-r--r-- | mk/mkc_imp.platform.sys.mk | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/mk/mkc_imp.platform.sys.mk b/mk/mkc_imp.platform.sys.mk index 85bb7d9..d172af6 100644 --- a/mk/mkc_imp.platform.sys.mk +++ b/mk/mkc_imp.platform.sys.mk @@ -103,14 +103,24 @@ _full_type != env ${mkc.cc_type.environ} mkc_check_compiler ${"${c}" == ${c:tu}_TYPE := ${_full_type:[1]} ${c:tu}_VERSION := ${_full_type:[2]} . undef _full_type -_mkfile=mkc_imp.${c}_${${c:tu}_TYPE}-${${c:tu}_VERSION}.mk -. if exists(${HOME}/.mk-c/${_mkfile}) -.warning "Directory ~/.mk-c is deprecated since 2020-12-11, please rename it to ~/.mkcmake" -. include "${HOME}/.mk-c/${_mkfile}" +_mkfile:=mkc_imp.${c}_${${c:tu}_TYPE}-${${c:tu}_VERSION}.mk +. if exists(${_MKFILESDIR}/${_mkfile}) + _full_mkfile:=${_MKFILESDIR}/${_mkfile} +. elif exists(${HOME}/.mk-c/${_mkfile}) +. warning "Directory ~/.mk-c is deprecated since 2020-12-11, please rename it to ~/.mkcmake" + _full_mkfile:=${HOME}/.mk-c/${_mkfile} . elif exists(${HOME}/.mkcmake/${_mkfile}) -. include "${HOME}/.mkcmake/${_mkfile}" -. elif exists(${_MKFILESDIR}/${_mkfile}) -. include "${_MKFILESDIR}/${_mkfile}" + _full_mkfile:=${HOME}/.mkcmake/${_mkfile} +. endif +. if defined(_full_mkfile) + _ != test ${_full_mkfile} -ot ${.PARSEDIR}/${.PARSEFILE}; echo $$? +. if ${_} == 0 && !defined(MK_C_PROJECT) && !defined(compiler_settings) +. error '${_full_mkfile} is older than ${.PARSEDIR}/${.PARSEFILE}, please update it using "mkc_compiler_settings" utility' +. endif +. undef _ +. if !defined(compiler_settings) +. include "${_full_mkfile}" +. endif . elif !defined(MK_C_PROJECT) && empty(compiler_settings) . if ${MKCOMPILERSETTINGS:Uno:tl} == "yes" _ != env CC= CXX= ${c:tu}=${${c:tu}} mkc_compiler_settings @@ -119,6 +129,8 @@ _ != env CC= CXX= ${c:tu}=${${c:tu}} mkc_compiler_settings . error 'Settings for ${${c:tu}_TYPE}-${${c:tu}_VERSION} is not available, run "mkc_compiler_settings" utility' . endif . endif # exists(...) + +. undef _full_mkfile . undef _mkfile . endfor # .for c in ${src_type} .endif # cleandir|distclean|... @@ -311,13 +323,13 @@ CLEANFILES += ${EXPORT_SYMBOLS}.tmp lib${LIB}${SHLIB_EXTFULL}: ${EXPORT_SYMBOLS}.tmp ${EXPORT_SYMBOLS}.tmp: ${EXPORT_SYMBOLS} awk 'BEGIN {print "{ global:"} \ - {print $$0 ";"} \ + {sub(/#.*/, ""); if (NF>0) { $$1=$$1; print $$0 ";"} } \ END {print "local: *; };"}' ${.ALLSRC} > ${.TARGET} .elif ${LD_TYPE} == "darwinld" CLEANFILES += ${EXPORT_SYMBOLS}.tmp lib${LIB}${SHLIB_EXTFULL}: ${EXPORT_SYMBOLS}.tmp ${EXPORT_SYMBOLS}.tmp: ${EXPORT_SYMBOLS} - awk '{print "_" $$0}' ${.ALLSRC} > ${.TARGET} + awk '{sub(/#.*/, ""); if (NF>0) { $$1=$$1; print "_" $$0}}' ${.ALLSRC} > ${.TARGET} .endif # sunld or darwinld LDFLAGS.expsym.gnuld = --version-script ${EXPORT_SYMBOLS}.tmp |