I am building a makefile that runs a series of tests and adds the results to a file. In the makefile I have this set up as:
runtests:
rm -f results.txt
cardtest1 > results.txt
cardtest2 >> results.txt
cardtest3 >> results.txt
cardtest4 >> results.txt
unittest1 >> results.txt
unittest2 >> results.txt
unittest3 >> results.txt
unittest4 >> results.txt
Now I am able to run all of the above commands in this or any other order (provided the results.txt file exists for the appends) without problem. However, no matter what test is run after rm -f results.txt when it is in the makefile, it will always generate an error.
flip1 ~/src/dominion-base 161% make all
rm -f results.txt
cardtest1 > results1.txt
make: *** [runtests] Error 1
I have been tinkering with it for an hour (originally had all as >> but realized that an append apparently does not create a file that doesn't exist), and I am really unsure of what exactly is wrong with my makefile.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…