3

After building something with make I want to move all the files that end in .cache.{js,woff} to a sub folder.

(cd $(PFROOT)/PVWR2/gwt/pdfwebviewer/; \ mkdir -p cache_files; \ mv *.cache.{js,woff} sub_folder) 

The problem is, when running make it seems to interpret *.cache.{js,woff} as a file name and not something dynamic and of course there is no file that has the explicit name *.cache.{js,woff}. When I just navigate to the folder and move it manually from the shell with above command it works without a hitch.

I understand it has to do with globbing but I don't know how to fix this.

1 Answer 1

7

{...} is bash-specific syntax for brace expansion, but make uses /bin/sh by default instead of bash.

From info make, section 5.3.2:

The program used as the shell is taken from the variable SHELL. If this variable is not set in your makefile, the program /bin/sh is used as the shell.

If you want to use bash to parse shell constructs in your Makefile, you can add the following to the top:

SHELL := /bin/bash 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.