Today, I see the following example here [1]:

=== begin ===
For those curious about why you might do this, it is useful if you
want to pretend like something was done, so that Make doesn't output
"Nothing to be done for" your target.

One example is if you have a phony target that you always execute, and
in it you have a bunch of conditionals in the command. You want to
have at least something in case those conditions come up false and
nothing gets done.

For example (from Linux's scripts/Makefile.clean):

__clean: $(subdir-ymn)
ifneq ($(strip $(__clean-files)),)
    +$(call cmd,clean)
endif
ifneq ($(strip $(__clean-dirs)),)
    +$(call cmd,cleandir)
endif
ifneq ($(strip $(clean-rule)),)
    +$(clean-rule)
endif
    @:
=== end ===

I am very confused about the usage of the + symbol used above. Any
hints will be highly appreciated.

[1] https://stackoverflow.com/a/16818821

Regards
-- 
Assoc. Prof. Hongyi Zhao <hongyi.z...@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province

Reply via email to