What does the @ prefix mean in a makefile?

What does the @ prefix mean in the makefile? Any difference from using @ without -? For example, in the following case:

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 
+1
source share
1 answer

Section 5 Writing Recipes in the GNU Rules Make Manual contains information on all of these things in it. In particular, sections 5.2 and 5.5.

5.2 Repeat recipe

Typically print each line of the recipe before executing it. We call this an echo because it gives the appearance that you are typing the lines yourself.

When a line starts with '@, the echo of that line is suppressed. "@" Discarded before the string is passed to the shell. Typically, you would use this for a command whose only effect is to print something, for example, the echo command to indicate progress through a make file:

and

5.5 Recipe Errors

After each shell call returns, make looks at the exit status. If the shell is successfully completed (exit status is zero), the next line in the recipe is executed in the new shell; after the last line is completed, the rule will be completed.

If there is an error (the exit status is not equal to zero), make refuses the current rule and, possibly, all the rules.

Sometimes a failure of a particular recipe line does not indicate a problem. For example, you can use the mkdir command to ensure that the directory exists. If the directory already exists, mkdir will report an error, but you probably want make to continue independently.

To ignore errors in the recipe line, write '- at the beginning of the text of the lines (after the initial tab). "-" is discarded before the string is passed to the shell for execution.

+3
source

Source: https://habr.com/ru/post/1495748/


All Articles