简体   繁体   中英

Makefile: what does $@~ mean?

I am working on an old makefile that contains the following snippet to generate a shared library:

lib$(LIBNAME).so.$(SOLIBREV): $(OBJS)
    $(RM) $@~
    @SONAME=`echo $@ | sed 's/\.[^\.]*$$//'`; set -x; \
    $(CC) -o ./$@~ -shared -Wl,-soname,$$SONAME $(OBJS) $(SOEXTRALIBS) -lc;
    $(MV) $@~ $@
    $(MV) $@ lib$(LIBNAME).so

Now I need to modify that. I know that $@ specifies the target but what meaning does the tilde in "$@~" have?

By the way SOLIBREV stands for so-library-revision.

It doesn't mean anything special. It's just $@ followed by a literal ~ . A ~ suffix on filenames is often used for temporary files, so this recipe is using a temporary file named after the target but with the extra ~ suffix.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM