2

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.

1 Answer 1

4

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.