[Top][All Lists]

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

[Make] Counter variable? Buildbar

From: Dan
Subject: [Make] Counter variable? Buildbar
Date: 20 Jul 2006 02:59:48 -0700
User-agent: G2/0.2

In gnumake, is it possible to have a variable act as a counter?
Basically I want to be able to pass in a numerical value to a program
each time I compile a C file.

For example, this kind of thing ...

%.obj: %.c
        $(cc) $(cc_args) /Fo$@ $<
        @buildbar $(counter)
        $(counter) ++

My buildbar program is basically just a windows progress bar that will
display how far through the build I am.  To get the max files, I'm
using "$(words $(c_object_file)".  Obviously this will only work if I'm
doing a full remake.  Can anyone think of a better way of doing this,
so that it will work when not doing a full remake?  I'm guessing it's
not possible without being quite hacky, due to the fact that the files'
timestamps are compared as it goes along, so it's no way of knowing how
many files it will be compiling in the long run.  Unless or course
there was a dummy iteration first.

Thanks for any help,
- Dan

reply via email to

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