user1291416
user1291416

Reputation: 71

MinGW / GNU Make - "multiple target patterns"

I'm using MinGW 3.18 under Windows XP SP2, GNU make 3.82.

I'm trying to incorporate a value returned by a script in a path and receive an error.

This works:

PROD_DIR=$(ROOT_DIR)/PROD
version=1.1.1

PROD_SOURCE_files = \
    file1 \
    file2

PROD_TARGET_files = $(patsubst %,$(PROD_DIR)/$(version)/%,$(PROD_SOURCE_files))

This doesn't:

PROD_DIR=$(ROOT_DIR)/PROD
version=`get_version.sh`

PROD_SOURCE_files = \
    file1 \
    file2

PROD_TARGET_files = $(patsubst %,$(PROD_DIR)/$(version)/%,$(PROD_SOURCE_files))

Makefile:1359: *** multiple target patterns.  Stop.

(line 1359 is the definition of PROD_TARGET_files)

I've double-checked $(version), it has the same value in both cases, with apparently no leading/trailing blanks or newlines:

@echo [$(version)]
[1.1.1]

Upvotes: 2

Views: 1822

Answers (1)

Oliver Charlesworth
Oliver Charlesworth

Reputation: 272507

Backticks (`) are a Bash thing, not a Make thing.

If you want to call out to an external shell, you should use the shell function:

version=$(shell get_version.sh)

Upvotes: 3

Related Questions