Miao
Miao

Reputation: 85

shell touch command dose not work inside Makefile

Inside Makefile:

generate:
    touch file{1..10}

run it with make

and I get a single file name file{1..10} and not 10 different files. The touch commands works properly on the shell.

Why?

Upvotes: 1

Views: 954

Answers (1)

Matt
Matt

Reputation: 15186

Make invokes shell as specified in the variable called SHELL. The default value for *nix systems is SHELL=/bin/sh.

Set SHELL=/bin/bash (or whatever) to make it working.

Note: unlike other make's variables, SHELL's value is never imported from an environment (if running under POSIX OS; this is not true for native Windows builds).

Upvotes: 2

Related Questions