help-gnu-utils
[Top][All Lists]
Advanced

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

function to change case


From: Murali
Subject: function to change case
Date: 9 May 2006 15:18:47 -0700
User-agent: G2/0.2

I need to generate a Makefile to compile fortran code. I generate a
Makefile.Depend which contains lines like

a.o: header.h file.mod

Certain compilers generate a "file.mod" while others generate
"FILE.mod". When a.o depends on "file.mod" and the compiler generates
"FILE.mod", gmake recompiles my whole project. My proposed method for
handling this is to have Makefile.Depend contain lines like

a.o: header.h $(case file).mod

Also, I will have a Make variable "MODCASEUPPER" set to 1 if I need
upper case and 0 if lower case. At this point I need to define

$(case x)

which looks at MODCASEUPPER and if set to 1, return uppercase version
of x, and returns lowercase version of x otherwise.

* Is there a gmake builtin function for case changes?
* How do I test for the existence of a Make variable, i.e. if
MODCASEUPPER is not defined, I need it to make $(case x) default to
lower case.

Other approach I considered:
* after every compilation create a "file.mod" which symlinks to
"FILE.mod" (if FILE.mod exists and file.mod does not) -- easily creates
too many files in the directory (which already has about 500 files)

- Murali



reply via email to

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