Test your make-fu (update Makefile to maintain a version.h file)

Cristian Ionescu-Idbohrn cristian.ionescu-idbohrn at axis.com
Tue Feb 26 02:25:41 PST 2013


Trying to understand something that, for me, vanished from my world
many, many moons ago :)

On Tue, 26 Feb 2013, Lubomir I. Ivanov wrote:
>

So this is what needs to be done:

> write a Makefile that reads a version.h file and compares that to a
> "git describe" version.

Now, do I understand you correctly?
The reason for this Makefile montruosity is that a certain OS lacks a
*nix shell but has access to make, grep, cat, cut?

> ------------------
> other notes:

Of course, make can use a whole arsenal of commands, but if possible
avoid as much as possible and use primarily builtin make functions.

> - uses only grep, cat, cut

Now, this is hard to understand:

> - this is a portable version, things like "if / fi" aren't portable
              ^^^^^^^^
Portable to what?  Never mind.  Don't answer that ;)  Do you have
access to the `test' application in that odd build environment?

I can't even imagine that the `make' I know of, "GNU Make", works
without a proper *nix shell.  You could use the variable SHELL to
point make to a another *nix shell, but AFAIU you don't have access to
one?

>   outside of bash/sh, but the current Makefile uses them anyway.
    ^^^^^^^^^^^^^^^^^^
And there's no such beast in your build environment ?

> - runs on the windows native shell and on bash/sh with the msys toolchain.

So why is the above exercise so important.  How difficult can it be to
add a *nix shell to your build environment?

> - seems to work with GNU Make 3.82

Yes, it looks like it is (tested with GNU Make 3.81).


Cheers,

-- 
Cristian


More information about the subsurface mailing list