代码的大致意思是:

设置变量 TOPDIR 为当前目录。

设置 LC_ALL、LANG、TZ 等环境变量,并导出。

检查 TOPDIR 中是否包含空格,如果包含则报错。

设置变量 DISTRO_PKG_CONFIG 为 pkg-config 的路径,并导出 PATH。

如果 OPENWRT_BUILD 不等于 1,则设置 MAKEFLAGS、OPENWRT_BUILD、GREP_OPTIONS、CDPATH 等变量,并包含 debug.mk、depends.mk、toplevel.mk。

否则,包含 rules.mk、depends.mk、subdir.mk、target/Makefile、package/Makefile、tools/Makefile、toolchain/Makefile。

定义一些规则和目标,如 printdb、prepare、clean、targetclean、dirclean、toolchain_rebuild_check、cacheclean、prereq、json_overview_image_info、checksum、buildversion、feedsversion、diffconfig、buildinfo、world 等。

最后,将 clean、dirclean、prereq、prepare、world 等加入 .PHONY,表示这些都是伪目标

翻译下面代码TOPDIR=$CURDIRLC_ALL=CLANG=CTZ=UTCexport TOPDIR LC_ALL LANG TZempty=space= $empty $empty$if $findstring $space$TOPDIR$error ERROR The path to the OpenWrt directory must not include any spaceswor

原文地址: http://www.cveoy.top/t/topic/cqUW 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录