Re: [rfc] Colorized output for GNU make?

2012-02-13 Thread Paul Smith
On Sun, 2012-02-12 at 19:34 +0200, Eli Zaretskii wrote:
  Date: Sun, 12 Feb 2012 18:11:49 +0100
  From: Sebastian Pipping sebast...@pipping.org
  CC: psm...@gnu.org, bug-make@gnu.org
  
  Since we would run into buffer overflows with sprintf/vsprintf, we
  rely on snprintf/vsnprintf for that task.  Quoting from my man 3
  printf output:
  
snprintf(), vsnprintf():
  _BSD_SOURCE || _XOPEN_SOURCE = 500 || _ISOC99_SOURCE \
|| _POSIX_C_SOURCE = 200112L;
  or cc -std=c99
  
  That's my understanding of the situation.
 
 If all you need is vsnprintf, I think you can rely on it being
 present, and if it isn't, disable argument reordering on that
 platform.  Or we could import one from libiberty or from gnulib, I
 guess.  Paul?

I don't see any good way to support systems without vsnprintf(), if we
decide to depend on it, except for writing a lot of yucky ifdef'd code
scattered throughout the codebase.

If we have vsnprintf() we can abstract away the construction of the
string into a general function.  If we don't, we have to do it down at
the very lowest level and pass va_lists around, which means the function
signature of the lowest-level functions will have to be different, etc.

Pulling in an implementation from gnulib, just in case, might be the way
to go.


___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


Re: [rfc] Colorized output for GNU make?

2012-02-13 Thread Sebastian Pipping
On 02/13/2012 05:41 PM, Paul Smith wrote:
 Pulling in an implementation from gnulib, just in case, might be the way
 to go.

This seems to be the entry point:

http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=modules/vasnprintf

I'd make a new directory gnulib and copy needed files in.  How should
integration work on build system level?  Is this stuff you want to play
with for yourself or would you rather have me try X Y for you?  What
would X Y be?

Best,




Sebastian

___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


RE: Content tracking mode for make

2012-02-13 Thread Lawrence Ibarria
This looks like work for your code generator instead of make. The code 
generator could do a diff before replacing the file.
Make would have to keep a backup copy of the last time it built with that file, 
increasing complexity and time for normal builds.

I'd recommend against this.

-- Lawrence

From: bug-make-bounces+libarria=nvidia@gnu.org 
[mailto:bug-make-bounces+libarria=nvidia@gnu.org] On Behalf Of Raman Gopalan
Sent: Monday, February 13, 2012 1:38 PM
To: psm...@gnu.org; bug-make
Subject: Content tracking mode for make


Hello,

I am Raman, a student. I am currently working with code
generation for a microcontroller. I was wondering if it is
possible to support a new mode on make which tracks
dependancy content instead of timestamps.

Somtimes, it is possible that a code generator replaces the
existing files in the code base with the same content. It might
be a good option to enable content checking before make
rebuilds the replaced file (with the same content) again.

I could certainly add this option. Could you please give me
some guidance to proceed? Am I in the right direction?

Awaiting your response,

Regards,
Raman
___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


Re: Content tracking mode for make

2012-02-13 Thread Raman Gopalan
Hello Lawrence,

Thanks for the reply.

This looks like work for your code generator instead of make.


I agree with you. This should be fixed in the code gen. But I'm

currently working with a production code generator (DAVE)

which is nor free and does not include this feature. The build

process takes a long time.


The code generator could do a diff before replacing the file.


Sure. I could pitch this around in the community.


Make would have to keep a backup copy of the last time it built with that
file, increasing complexity and time for normal builds.


Yes, indeed. But could this be an option for make without touching

the traditional make process? (strictly as a side option)


Also, do you suggest a work around?


Best,

Raman
___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


Re: Content tracking mode for make

2012-02-13 Thread Daniel Herring

On Mon, 13 Feb 2012, Raman Gopalan wrote:


Also, do you suggest a work around?


Something like this?

output.h : source.file
codegen -o output.h-tmp source.file
diff output.h output.h-tmp /dev/null || mv output.h-tmp output.h
rm -f output.h-tmp

?
(untested)

- Daniel

___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make