help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Testing integers in a Makefile?


From: Gilles DELIFER
Subject: Testing integers in a Makefile?
Date: Tue, 8 Mar 2005 18:01:26 +0100

Hi all,

Sorry to post this but I've spent a long time looking for information to
solve my problem and still haven't found anything...

What I'd like to do is add some definitions to my DEFS variable depending on
the value of _HARDWARE_REVISION (which is an integer).

My Makefile looks like this:
DEFS=-D_HARDWARE_REVISION=005 -D_...
...
COMPILE=$(TOOLDIR)/arm-elf-gcc -c -O2 -mcpu=arm7tdmi $(DEFS) -o
"$(OUTDIR)/$(*F).o" "$<" -Wall

I'd like to write something like:
$(if ($(_HARDWARE_REVISION) > 005),DEFS+=-D_ADD_THIS,DEFS+=-D_ADD_THAT)
but I cannot find the right syntax for doing this...

There are lot of functions for handling strings in a Makefile but can we do
something about integers?
I am using Cygwin (make v3.79.1) and the latest GNU toolchain
(binutils+newlib+gcc).

Please help me!
Thanks,

Gilles





reply via email to

[Prev in Thread] Current Thread [Next in Thread]