I want to create a makefile that syncs files from a server to my local PC. With this makefile I want to only copy from my server to my local computer those files that were modified. To do that I did a makefile based in boths answers from here and here. This is my code:
#!/usr/bin/make -f
FILES = *.csv
SCP = scp id@server:~/Results
LAST_SYNC = .last_sync
.PHONY: sync
sync : $(LAST_SYNC)
$(LAST_SYNC) : $(FILES)
$(SCP) $?
touch $(LAST_SYNC)
If I run make it appears the following error:
make: *** No rule to make target '*.csv', needed by '.last_sync'. Stop.
Are there any way to solve this problem?
EDIT:
I've just changed the problem with the FILES variable according to G.M.'s suggestion:
FILES := $(wildcard *.csv)
Now the following error appears:
scp id@server:~/Results results1.csv results2.csv results3.csv
results3.csv: Not a directory
make: *** [Makefile:13: .last_sync] Error 1