Thank you Josh, but it's the way I did as last chance: I created a goal for each possible combination.
From the answers, I must imagine that there's no simple way to do what I was looking to do with make, using with "flags" on the command line in such a way to avoid the writing of all the n! combinations of the n parameters...
I was trying something as this:
Code:
param1: FLAGS += -DFLAG1
param1: MAKECMDGOALS := $(MAKECMDGOALS: param1 = )
param1: .scanCommands
param1: .done
param2: FLAGS += -DFLAG2
param1: MAKECMDGOALS := $(MAKECMDGOALS: param2 = )
param2: .scanCommands
param2: .done
....
.scanCommands:
ifneq (,$(findstring param1,$(MAKECMDGOALS)))
.scanCommands: FLAGS += -DFLAG1
.scanCommands: MAKECMDGOALS := $(MAKECMDGOALS: param1 = )
endif
ifneq (,$(findstring param2,$(MAKECMDGOALS)))
.scanCommands: FLAGS += -DFLAG2
.scanCommands: MAKECMDGOALS := $(MAKECMDGOALS: param2 = )
endif
....
.done:
$(CC) $(FLAGS) source.c
but unfortunately MAKE doesn't accept this:
Code:
ifneq (,$(findstring param1,$(MAKECMDGOALS)))
.scanCommands: FLAGS += -DFLAG1
.scanCommands: MAKECMDGOALS := $(MAKECMDGOALS: param1 = )
endif
or, better, accept it but not in the way I was expected: it executes the goal in the 'if' branch always...
BrownB