使用 Makefile..sed 时出错

使用 Makefile..sed 时出错

应用程序正在尝试配置

sudo make configure
(cd /opt/ioapi-3.2/ioapi   ;  sed -e 's|IOAPI_BASE|/opt/ioapi-3.2|' -e 's|LIBINSTALL||' -e 's|BININSTALL||' -e 's|IOAPI_DEFS||' -e 's|NCFLIBS|-L/opt/netcdf/lib -lnetcdff -L/opt/netcdf/lib -lnetcdf|' -e 's|MAKEINCLUDE|include /opt/ioapi-3.2/ioapi/Makeinclude|' -e 's|PVMINCLUDE|include  |' < Makefile..sed > Makefile )
/bin/sh: Makefile..sed: No such file or directory
make: *** [Makefile:211: configure] Error 1

我不明白命令的最后一部分应该做什么,以及为什么它会产生错误。

的输出make -n configure是:

(cd /home/centos/ioapi-3.2/ioapi   ;  sed -e 's|IOAPI_BASE|/home/centos/ioapi-3.2|' -e 's|LIBINSTALL||' -e 's|BININSTALL||' -e 's|IOAPI_DEFS||' -e 's|NCFLIBS|-lnetcdff -lnetcdf|' -e 's|MAKEINCLUDE|include /home/centos/ioapi-3.2/ioapi/Makeinclude|' -e 's|PVMINCLUDE|include  |' < Makefile..sed > Makefile )
(cd /home/centos/ioapi-3.2/m3tools ;  sed -e 's|IOAPI_BASE|/home/centos/ioapi-3.2|' -e 's|LIBINSTALL||' -e 's|BININSTALL||' -e 's|IOAPI_DEFS||' -e 's|NCFLIBS|-lnetcdff -lnetcdf|' -e 's|MAKEINCLUDE|include /home/centos/ioapi-3.2/ioapi/Makeinclude|' -e 's|PVMINCLUDE|include  |' < Makefile..sed > Makefile )

答案1

查看项目Makefile.template的文件ioapic-3.2在 GitHub 上,很明显,您看到的命令是使用变量sed的结果:makeSEDCMD

SEDCMD = \
-e 's|IOAPI_BASE|$(BASEDIR)|' \
-e 's|LIBINSTALL|$(LIBINST)|' \
-e 's|BININSTALL|$(BININST)|' \
-e 's|IOAPI_DEFS|$(IOAPIDEFS)|' \
-e 's|NCFLIBS|$(NCFLIBS)|' \
-e 's|MAKEINCLUDE|include $(IODIR)/Makeinclude|' \
-e 's|PVMINCLUDE|include  $(PVMINCL)|'

像这样:

configure: ${IODIR}/Makefile ${TOOLDIR}/Makefile
    (cd $(IODIR)   ;  sed $(SEDCMD) < Makefile.$(CPLMODE).sed > Makefile )
    (cd $(TOOLDIR) ;  sed $(SEDCMD) < Makefile.$(CPLMODE).sed > Makefile )

正如您所看到的,它尝试读取一个名为Makefile.$(CPLMODE).sed.该CPLMODE变量被多次提及在评论中在 Makefile 中,但从未设置为默认值。

该变量的有效值为nocplcplpncf。存储库中的文件README.txt说要自定义 Makefile,我必须假设这包括在项目的顶级目录中创建一个Makefile.template名为的副本,然后对其进行修改。Makefile

看起来您还没有对其进行所有必要的修改。

相关内容