I'm currently having trouble doing a command in a Makefile. Particular command that I'm trying to translate into bash is:
diff <(head -n 1 file1.out) < file2.out > file.diff
My current code just compares two files without ignoring the first line in the first file.
${OUTPUT_DIR}/%.diff: ${OUTPUT_DIR}/%.out ${EXPECTED_DIR}/%.out
@ diff $(word 1,$^) $(word 2,$^) > $@; \
if [ $$? -eq 0 ]; then \
echo "\t\t\tOK"; \
echo "------------------------------"; \
else \
echo "\t\t\tFailed"; \
cat $@; \
echo "------------------------------"; \
fi
I'm having trouble converting the terminal command to the Makefile (current problem is that it just copies the 'if' and prints it out). Some help would be nice explaining how to convert it as bash and Makefiles are hard for me to parse.