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

Dirk Hohndel dirk at hohndel.org
Tue Feb 26 06:36:20 PST 2013

On Feb 26, 2013, at 2:58 AM, Lubomir I. Ivanov wrote:

> On 26 February 2013 12:25, Cristian Ionescu-Idbohrn
> <cristian.ionescu-idbohrn at axis.com> wrote:
>> 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?
> well, i find no need to use an unix shell where it's not needed, but
> also GNU Make works without it and same goes for tools like grep.
> such software should not be bound to a shell.
> the default Subsurface Makefile seems to depend on bash (or bash like
> shells), so the addition discussed in this thread would probably
> follow that as well.
> my example (of make-fu written in 30minutes) is for something i will
> use for my own needs for the native Windows build, were bash is also
> available in fact. :-).

I have good reason to believe that you are in fact the only person doing
native Windows builds. I know at least two people who do cross builds;
one of them is myself - that's how I build the official binaries (far less risk
of bundling a virus by mistake…)

> now the question is, can someone write the same functionality for the
> default Makefile (which i don't use due to the oddities in my Windows
> and Linux setups) in a prettier way?
> i'm sure that answers most of the questions bellow with a few exceptions.

I'm not sure I understand the value of removing a tool that is universally
available from use in the Makefile, Lubomir. This isn't a purity contest,
we want something that works and is easy to maintain (ha!)

>> So why is the above exercise so important.  How difficult can it be to
>> add a *nix shell to your build environment?
> the idea of course here is to improve the Makefile, by adding the
> "version.h" support in the best way possible.
> i think you can ignore my "portability" comments (to a certain extent that is).

I agree with the goal. Good implementation. Needs to run in a reasonable
build environment.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4130 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130226/e7462579/attachment.bin>

More information about the subsurface mailing list