jeudi 7 avril 2016

Makefile - conditional statements

I have a program which I want to compile depending a macro definition which I want to pass by argument to make. So I want to execute:

make PLATFORM='myplatform'

The pseudo-code is:

If macro PLATFORM is defined and is equal to 'A' or 'B' then compile the program declaring PLATFORM else print an error.

My problem is related to the condition 'A' or 'B', because the following code:

ifeq ($(PLATFORM),'A') || ($(PLATFORM),'B')

doesn't work.. Is there a way for such a condition using Makefile ?

Aucun commentaire:

Enregistrer un commentaire