criu/scripts/nmk/scripts/msg.mk
Kir Kolyshkin 25a1acd8cc nmk/script: rm bad code
I discovered that the scripts/ suffix is added to __nmk_dir despite
the fact it already contains it, ending in obviously wrong filenames
like scripts/nmk/scripts/scripts/msg.mk. As those files are non-existent,
make tried to recreate every .mk file, spawninga child to execute 'true'
command, like this (part of "make -dr" output):

> Considering target file '../scripts/nmk/scripts/scripts/include.mk'.
>  File '../scripts/nmk/scripts/scripts/include.mk' does not exist.
>  Finished prerequisites of target file
> '../scripts/nmk/scripts/scripts/include.mk'.
> Must remake target '../scripts/nmk/scripts/scripts/include.mk'.
> Putting child 0x564ec1768740 (../scripts/nmk/scripts/scripts/include.mk)
> PID 21633 on the chain.
> Live child 0x564ec1768740 (../scripts/nmk/scripts/scripts/include.mk)
> PID 21633
> Reaping winning child 0x564ec1768740 PID 21633
> Removing child 0x564ec1768740 PID 21633 from chain.

The fix was to remove the extra scripts/, but once I did it, I found
out problem #2: these targets, being defined in contents that is often
included in the beginning of Makefiles, hijacks the default make
target (the first one in the Makefile), breaking the usual and
expected make behavior, and forcing to use .DEFAULT_GOAL.

Finally, I don't know why these targets are there, i.e. what purpose
do they serve. Maybe it was done to exclude any implicit rules to
re-make those files, but there are no such rules as far as I can see.

So, in order to address problem #2, I have removed these targets.
I don't see any harm in doing that; let me know if it breaks anything.

Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-10-05 13:11:26 +03:00

71 lines
976 B
Makefile

ifndef ____nmk_defined__msg
#
# Silent make rules.
ifeq ($(strip $(V)),)
E := @echo
Q := @
else
E := @\#
Q :=
endif
export E Q
#
# Message helpers.
define msg-gen
$(E) " GEN " $(1)
endef
define msg-clean
$(E) " CLEAN " $(1)
endef
define msg-cc
$(E) " CC " $(1)
endef
define msg-dep
$(E) " DEP " $(1)
endef
define msg-link
$(E) " LINK " $(1)
endef
define msg-ar
$(E) " AR " $(1)
endef
define msg-build
$(E) " BUILD " $(1)
endef
define msg-host-cc
$(E) " HOSTCC " $(1)
endef
define msg-host-dep
$(E) " HOSTDEP " $(1)
endef
define msg-host-link
$(E) " HOSTLINK" $(1)
endef
define newline
endef
# map funciton:
# $1 - func to call
# $2 - list over which map the $1 func
# result is divided with newlines
map = $(foreach x,$2,$(call $1,$x)$(newline))
#
# Footer.
____nmk_defined__msg = y
endif #____nmk_defined__msg