I have a simple makefile that runs an R program that generates 3 csv files. I used this SO answer:https://stackoverflow.com/a/3077254/4564432
But I don't feel this is working quite right.
.PHONY: all one clean
all: one
clean:
-rm *.csv
one: csv1.csv csv2.csv csv3.csv
csv1%csv csv2%csv csv3%csv: myProgram.R
R CMD BATCH $<
When I run make
initially it works fine, runs my program, and generates my output. My understanding is that if I rerun make, without changing myProgram.R
it should know not to run anything, but I find that with the above makefile that it reruns everything anytime I run make
regardless of the time-stamp.
Any help would be appreciated.
edit: using GNU MAKE 3.79.1
Answer:
I realize that my output, the csvs, were going into a different folder so I needed to do one: myFolder/csv1.csv myFolder/csv2.csv etc.