I am using Makefile PHONY for CI. But I found the order of commands under the target is not run in sequential, more specifically, the command inside $() seems to run ahead of time. Is this some default behavior of Makefile?
SHELL := /bin/bash
.PHONY: test
test:
cat input-test.txt > output.txt
@[ $(shell wc -l < output-test.txt) -eq $(shell wc -l < input-test.txt) ]
rm output-test.txt
by running make test
it shows
/bin/sh: output-test.txt: No such file or directory
cat input-test.txt > output.txt
/bin/sh: line 0: [: -eq: unary operator expected
make: *** [test] Error 2