help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

What's the meaning of + symbol used in makefile?


From: Hongyi Zhao
Subject: What's the meaning of + symbol used in makefile?
Date: Wed, 19 Jan 2022 10:21:23 +0800

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.zhao@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

[Prev in Thread] Current Thread [Next in Thread]