Below makefile, ${PATH}/CMD0.log is generated by CMD0.
check_file is command sequence to check warnings from CMD0.log. First it will check if CMD0.log exists.
When run make clean; make
, it shows CMD0.log doesn't exist.
Since the log is generated by CMD0, not sure why check_file is executed before CMD0.
...
define check_file =
if test -f ${PATH}/CMD0.log; then
$(eval WARNING = $(shell grep "WARNING.*" ${PATH}/file.log))
fi
endef
...
${OUTPUTS0}: ${INPUTS0}
@echo ""
@echo "[INFO] STEP0";
@date '+%Y_%m%d_%H%M'
... CMD0 -log CMD0.log ...
@$(check_file)
Screen print
-> make clean ; make
grep: ./log/CMD0.log: No such file or directory
[INFO] STEP0
2021_0303_0025
make -d | tee make.log
screen print
Finished prerequisites of target file `target'.
Must remake target `target'.
grep: ./log/CMD0.log: No such file or directory
Invoking recipe from makefile:137 to update target `target'.
Putting child 0x26490c0 (target) PID 18792 on the chain.
Live child 0x26490c0 (target) PID 18792
Reaping winning child 0x26490c0 PID 18792
Live child 0x26490c0 (target) PID 18793
[INFO] STEP0
Reaping winning child 0x26490c0 PID 18793
Live child 0x26490c0 (target) PID 18810
2021_0303_0957
make
and thenmake install
for simple deployments, and what happens if somthing went wrong, or you are updating an existing install?-d
parm to make and see if make is doing what you expect it to. And try running justmake -d clean
first, see if that is behaving, then trymake -d
and review.make clean
, it's a clean build, not updating existing run.-d
, still can't figure out what's wrong.CMD0 -log CMD0.log
is supposed to create the log. Removing the command will all the more not make it appear where you want it. My point is maybe you're looking in the wrong place (./log/CMD0.log
) when yougrep
.