Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
前缀@-在makefile中是什么意思?_Makefile - Fatal编程技术网

前缀@-在makefile中是什么意思?

前缀@-在makefile中是什么意思?,makefile,Makefile,在makefile中前缀@-是什么意思?使用@而不使用-有什么区别吗?例如,在以下情况下: ifndef NO_CBLAS @echo Generating cblas.h in $(DESTDIR)$(OPENBLAS_INCLUDE_DIR) @sed 's/common/openblas_config/g' cblas.h > $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/cblas.h endif ifndef NO_LAPACKE

在makefile中前缀
@-
是什么意思?使用
@
而不使用
-
有什么区别吗?例如,在以下情况下:

ifndef NO_CBLAS
    @echo Generating cblas.h in $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)
    @sed 's/common/openblas_config/g' cblas.h > $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/cblas.h
endif

ifndef NO_LAPACKE
    @echo Copying LAPACKE header files to $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
    @-install -pDm644 $(NETLIB_LAPACK_DIR)/lapacke/include/lapacke.h $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/lapacke.h
    @-install -pDm644 $(NETLIB_LAPACK_DIR)/lapacke/include/lapacke_config.h $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/lapacke_config.h
    @-install -pDm644 $(NETLIB_LAPACK_DIR)/lapacke/include/lapacke_mangling_with_flags.h $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/lapacke_mangling.h
    @-install -pDm644 $(NETLIB_LAPACK_DIR)/lapacke/include/lapacke_utils.h $(DESTDIR)$(OPENBLAS_INCLUDE_DIR)/lapacke_utils.h
endif
ifndef NO_STATIC
    @echo Copying the static library to $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
    @install -pm644 $(LIBNAME) $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
    @cd $(DESTDIR)$(OPENBLAS_LIBRARY_DIR) ; \
    ln -fs $(LIBNAME) $(LIBPREFIX).$(LIBSUFFIX)
endif
GNU make手册的第5节中有关于这两个方面的信息。特别是第5.2节和第5.5节

5.2配方回声

通常,make会在配方执行前打印每一行。我们称之为回音,因为它给人的感觉是你自己在打字

当一行以“@”开头时,该行的回音将被抑制。在将行传递到shell之前,将丢弃“@”。通常,您会将其用于命令,该命令的唯一效果是打印某些内容,例如用于指示通过makefile的进度的echo命令:

5.5配方中的错误

每次shell调用返回后,make都会查看其退出状态。如果shell成功完成(退出状态为零),则配方中的下一行将在新shell中执行;最后一行结束后,规则结束

如果出现错误(退出状态为非零),make将放弃当前规则,甚至可能放弃所有规则

有时,某个配方行的故障并不表示存在问题。例如,可以使用mkdir命令确保目录存在。如果目录已经存在,mkdir将报告一个错误,但是您可能希望make继续

若要忽略配方行中的错误,请在该行文本的开头(在初始选项卡之后)写一个“-”。在将行传递给shell执行之前,将丢弃“-”

GNU make手册的第5节包含了这两方面的信息。特别是第5.2节和第5.5节。