Make

使用 Makefile..sed 時出錯

  • July 9, 2021

一個應用程序正在嘗試配置

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 )

查看GitHub 上的項目Makefile.template文件,很明顯您看到的命令是使用變數的結果:ioapic-3.2``sed``make``SEDCMD

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. 該變數在 Makefile的註釋CPLMODE中多次提及,但從未設置為預設值。

此變數的有效值似乎是nocplcplpncf。儲存庫中的README.txt文件說要自定義 Makefile,我必須假設這包括在項目的頂級目錄中製作 call 的副本,Makefile.template然後Makefile對其進行修改。

您似乎還沒有對它進行所有必要的修改。

引用自:https://unix.stackexchange.com/questions/655737