He,
I want to read the contents of a file (which contains relative file paths) to a variable and prefix every line in the file with a path. Then copy all those files to a directory.
Like this:
$(httpd_DIR)/my.tar: $(mypath)/html.txt
rm -rf web
mkdir -p web
VV = $(addprefix $(httpd_DIR)/, $(shell cat $(mypath)/html.txt) )
cp -R $$VV $(httpd_DIR)/web
$(TAR) -C $(httpd_DIR) -cvf $(httpd_DIR)/web.tar web
The $(mypath)/html.txt file contains a list of relative file paths like this:
dir1/file1.html
dir2/file2.html
dir3/file3.html
For some reason I get the followin error:
/bin/bash: VV: command not found
I'm not trying to execute VV, so why is het giving me this error?
Note that if I uncomment the cp command, I still get the same error...
I'm using GNU make on a linux PC.