Re: [Warzone-dev] Automatic dependencies

2006-11-15 Thread Giel van Schijndel
Gerard Krol schreef:
> Dennis Schridde wrote:
>> Am Montag, 13. November 2006 19:54 schrieb Per Inge Mathisen:
>>  
>>> Most of the sed code is just magic that I copied from somewhere else,
>>> probably  http://make.paulandlesley.org/autodep.html which is a
>>> must-read.
>>>
>>>
 Does that code run always before the %.o: %.c rule is applied to any
 file?
   
>>> Yes.
>>>
>>>
 if we want Makefile.raw to be able to run from within a dos shell
 (no sed
 for example).
   
>>> No sed is just the beginning. Does anything of any complexity really
>>> run in a DOS shell? I would guess even just make would struggle, with
>>> different path delimiters and all that. For those who do not want to
>>> run mingw/msys/cygwin, surely just using VS is a better choice.
>>> 
>> It worked _pretty_ well till now (after I rewrote the Makefile.raws
>> and striped any SHianisms)...
>> I did the last releases with only cmd.exe and a MinGW 3.4.5
>> installation, without any extras like MSys or CygWin...
> I don't really know, I'm using MSys AND Cygwin for developement.
> Anyone just using DOS?
>
> - Gerard
>
> PS. Why not join irc.freenode.net #warzone? Quite busy there ;)
Yes, I am using DOS only. This works good at the moment.

--
Giel



signature.asc
Description: OpenPGP digital signature
___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Automatic dependencies

2006-11-13 Thread Gerard Krol

Dennis Schridde wrote:

Am Montag, 13. November 2006 19:54 schrieb Per Inge Mathisen:
  

Most of the sed code is just magic that I copied from somewhere else,
probably  http://make.paulandlesley.org/autodep.html which is a
must-read.



Does that code run always before the %.o: %.c rule is applied to any
file?
  

Yes.



if we want Makefile.raw to be able to run from within a dos shell (no sed
for example).
  

No sed is just the beginning. Does anything of any complexity really
run in a DOS shell? I would guess even just make would struggle, with
different path delimiters and all that. For those who do not want to
run mingw/msys/cygwin, surely just using VS is a better choice.

It worked _pretty_ well till now (after I rewrote the Makefile.raws and 
striped any SHianisms)...
I did the last releases with only cmd.exe and a MinGW 3.4.5 installation, 
without any extras like MSys or CygWin...
I don't really know, I'm using MSys AND Cygwin for developement. Anyone 
just using DOS?


- Gerard

PS. Why not join irc.freenode.net #warzone? Quite busy there ;)

___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Automatic dependencies

2006-11-13 Thread Dennis Schridde
Am Montag, 13. November 2006 19:54 schrieb Per Inge Mathisen:
> Most of the sed code is just magic that I copied from somewhere else,
> probably  http://make.paulandlesley.org/autodep.html which is a
> must-read.
>
> > Does that code run always before the %.o: %.c rule is applied to any
> > file?
>
> Yes.
>
> > if we want Makefile.raw to be able to run from within a dos shell (no sed
> > for example).
>
> No sed is just the beginning. Does anything of any complexity really
> run in a DOS shell? I would guess even just make would struggle, with
> different path delimiters and all that. For those who do not want to
> run mingw/msys/cygwin, surely just using VS is a better choice.
It worked _pretty_ well till now (after I rewrote the Makefile.raws and 
striped any SHianisms)...
I did the last releases with only cmd.exe and a MinGW 3.4.5 installation, 
without any extras like MSys or CygWin...

--Dennis


pgp29JjgKehrA.pgp
Description: PGP signature
___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Automatic dependencies

2006-11-13 Thread Per Inge Mathisen

Most of the sed code is just magic that I copied from somewhere else,
probably  http://make.paulandlesley.org/autodep.html which is a
must-read.


Does that code run always before the %.o: %.c rule is applied to any file?


Yes.


if we want Makefile.raw to be able to run from within a dos shell (no sed for 
example).


No sed is just the beginning. Does anything of any complexity really
run in a DOS shell? I would guess even just make would struggle, with
different path delimiters and all that. For those who do not want to
run mingw/msys/cygwin, surely just using VS is a better choice.

 - Per

___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Automatic dependencies

2006-11-13 Thread Dennis Schridde
Am Montag, 13. November 2006 19:12 schrieb Gerard Krol:
> Per Inge Mathisen wrote:
> > On 11/13/06, Gerard Krol <[EMAIL PROTECTED]> wrote:
> >> And it is not that every user needs to run "make depend", it just needs
> >> to be done when there are changes to the includes. I believe there
> >> are switches to make
> >> gcc do the same as makedepend, but a lot slower.
> >
> > I do not know about slower, but there is no need to add dependencies
> > to files that are checked in, at least not if you use gcc -M.
>
> You mean that the dependency information is already there (in the .c
> files) so we should not commit it to SVN another time?
>
> > The standard way to do this is, it seems, to create new, hidden files
> > with
> > dependency information for each .c file. In autohell, those are added
> > as .Po files in a separate .deps directory. One advantage of this is
> > that you do not need to check in changes to dependencies to the
> > repository.
>
> This is a bit of a problem if we want Makefile.raw to be able to run
> from within a dos shell (no sed for example).
What exactly does this sed magic do, actually?
To me it looks like:
- Remove comentary lines
- ?
- Remove ending backslashes
- Remove empty lines
- ?

Is that all needed? I tested it a bit and didn't get any comments or empty 
lines. Ending backslashes don't seem evil to me, either. Are they interpreted 
badly by mingw32-make?

--Dennis


pgpfrcbrvpih8.pgp
Description: PGP signature
___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Automatic dependencies

2006-11-13 Thread Dennis Schridde
Am Montag, 13. November 2006 18:54 schrieb Per Inge Mathisen:
> On 11/13/06, Gerard Krol <[EMAIL PROTECTED]> wrote:
> > And it is not that every user needs to run "make depend", it just needs
> > to be done when there are changes to the includes. I believe there are
> > switches to make gcc do the same as makedepend, but a lot slower.
>
> I do not know about slower, but there is no need to add dependencies
> to files that are checked in, at least not if you use gcc -M. The
> standard way to do this is, it seems, to create new, hidden files with
> dependency information for each .c file. In autohell, those are added
> as .Po files in a separate .deps directory. One advantage of this is
> that you do not need to check in changes to dependencies to the
> repository.
>
> I had some fun with gnu make and gcc -M a few months ago, and created
> a very generalized build system with only those two components,
> including configuration checking, 'make dist' and dependency
> generation. You can see it at
> http://svn.gna.org/viewcvs/buckyball/trunk/ if you are interested. I
> do not know how well something like that would scale.
Looks interesting...


$(OBJDIR)/%.o : %.c
$(COMPILE.c) -MD -o $@ $<
@mkdir -p $(DEPDIR)
@mv $(do).d $(df).d
@cp $(df).d $(df).P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $(df).d >> $(df).P; \
rm -f $(df).d
-include $(SOURCE:%.c=$(DEPDIR)/%.P)

Does that code run always before the %.o: %.c rule is applied to any file?

Otherwise it should be run before and look similar to
gcc -I. -MM -MF file.P file.c
(-MM: Don't include system headers in the list.)

--Dennis


pgpBDEmKEKzbt.pgp
Description: PGP signature
___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Automatic dependencies

2006-11-13 Thread Gerard Krol

Per Inge Mathisen wrote:

On 11/13/06, Gerard Krol <[EMAIL PROTECTED]> wrote:

And it is not that every user needs to run "make depend", it just needs
to be done when there are changes to the includes. I believe there 
are switches to make

gcc do the same as makedepend, but a lot slower.


I do not know about slower, but there is no need to add dependencies
to files that are checked in, at least not if you use gcc -M.
You mean that the dependency information is already there (in the .c 
files) so we should not commit it to SVN another time?
The standard way to do this is, it seems, to create new, hidden files 
with

dependency information for each .c file. In autohell, those are added
as .Po files in a separate .deps directory. One advantage of this is
that you do not need to check in changes to dependencies to the
repository.
This is a bit of a problem if we want Makefile.raw to be able to run 
from within a dos shell (no sed for example).

I had some fun with gnu make and gcc -M a few months ago, and created
a very generalized build system with only those two components,
including configuration checking, 'make dist' and dependency
generation. You can see it at
http://svn.gna.org/viewcvs/buckyball/trunk/ if you are interested. I
do not know how well something like that would scale.
I think it would scale the same way makedepend does, it just is O(n) on 
.c files, just with a higher constant I guess.


- Gerard

___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Automatic dependencies

2006-11-13 Thread Per Inge Mathisen

On 11/13/06, Gerard Krol <[EMAIL PROTECTED]> wrote:

And it is not that every user needs to run "make depend", it just needs
to be done when there are changes to the includes. I believe there are switches 
to make
gcc do the same as makedepend, but a lot slower.


I do not know about slower, but there is no need to add dependencies
to files that are checked in, at least not if you use gcc -M. The
standard way to do this is, it seems, to create new, hidden files with
dependency information for each .c file. In autohell, those are added
as .Po files in a separate .deps directory. One advantage of this is
that you do not need to check in changes to dependencies to the
repository.

I had some fun with gnu make and gcc -M a few months ago, and created
a very generalized build system with only those two components,
including configuration checking, 'make dist' and dependency
generation. You can see it at
http://svn.gna.org/viewcvs/buckyball/trunk/ if you are interested. I
do not know how well something like that would scale.

 - Per

___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Automatic dependencies

2006-11-13 Thread Dennis Schridde
Am Montag, 13. November 2006 18:30 schrieb Gerard Krol:
> Dennis Schridde wrote:
> > Am Montag, 13. November 2006 00:04 schrieb Gerard Krol:
> >> Dennis Schridde wrote:
> >>> Am Freitag, 10. November 2006 16:54 schrieb Gerard Krol:
>  Hi,
> 
>  The complete lack of dependencies somewhat bothers me, so I ran (X11)
>  makedepend. Attached are changes for the Makefile.raw's.
>  Now you don't have to run "make clean" all the time anymore.
>  Could someone with access to automake also incorporate the changes
>  into the Makefile.am's?
> >>>
> >>> Is the makedepend exe included in MinGW?
> >>> Because I rewrote the Makefile.raw s to run with just a plain MinGW
> >>> installation (without MSys). Would be ugly if we now required a non
> >>> standard exe for a task like dependency checking...
> >>
> >> Eh, no, makedepend is part of the linux/cygwin x11-bin package, I ran
> >> the cygwin version.
> >> And it is not that every user needs to run "make depend", it just needs
> >> to be done when
> >> there are changes to the includes. I believe there are switches to make
> >> gcc do the same as
> >> makedepend, but a lot slower.
> >
> > But in the Makefile I found ".PHONY depend"...
> > Would mean that he does "depend" on every run, or am I wrong?
>
> No, ".PHONY" is a flag that signals make that the targets do not produce
> a file (such as an .o or .exe), see
> http://theory.uwinnipeg.ca/gnu/make/make_33.html
We used it for updating the svnversion in src/version.c on every run of 
make...

--Dennis


pgpofUciyPMmJ.pgp
Description: PGP signature
___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Automatic dependencies

2006-11-13 Thread Gerard Krol

Dennis Schridde wrote:

Am Montag, 13. November 2006 00:04 schrieb Gerard Krol:
  

Dennis Schridde wrote:


Am Freitag, 10. November 2006 16:54 schrieb Gerard Krol:
  

Hi,

The complete lack of dependencies somewhat bothers me, so I ran (X11)
makedepend. Attached are changes for the Makefile.raw's.
Now you don't have to run "make clean" all the time anymore.
Could someone with access to automake also incorporate the changes into
the Makefile.am's?


Is the makedepend exe included in MinGW?
Because I rewrote the Makefile.raw s to run with just a plain MinGW
installation (without MSys). Would be ugly if we now required a non
standard exe for a task like dependency checking...
  

Eh, no, makedepend is part of the linux/cygwin x11-bin package, I ran
the cygwin version.
And it is not that every user needs to run "make depend", it just needs
to be done when
there are changes to the includes. I believe there are switches to make
gcc do the same as
makedepend, but a lot slower.


But in the Makefile I found ".PHONY depend"...
Would mean that he does "depend" on every run, or am I wrong?
No, ".PHONY" is a flag that signals make that the targets do not produce 
a file (such as an .o or .exe), see

http://theory.uwinnipeg.ca/gnu/make/make_33.html

- Gerard

___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Automatic dependencies

2006-11-13 Thread Dennis Schridde
Am Montag, 13. November 2006 00:04 schrieb Gerard Krol:
> Dennis Schridde wrote:
> > Am Freitag, 10. November 2006 16:54 schrieb Gerard Krol:
> >> Hi,
> >>
> >> The complete lack of dependencies somewhat bothers me, so I ran (X11)
> >> makedepend. Attached are changes for the Makefile.raw's.
> >> Now you don't have to run "make clean" all the time anymore.
> >> Could someone with access to automake also incorporate the changes into
> >> the Makefile.am's?
> >
> > Is the makedepend exe included in MinGW?
> > Because I rewrote the Makefile.raw s to run with just a plain MinGW
> > installation (without MSys). Would be ugly if we now required a non
> > standard exe for a task like dependency checking...
>
> Eh, no, makedepend is part of the linux/cygwin x11-bin package, I ran
> the cygwin version.
> And it is not that every user needs to run "make depend", it just needs
> to be done when
> there are changes to the includes. I believe there are switches to make
> gcc do the same as
> makedepend, but a lot slower.
But in the Makefile I found ".PHONY depend"...
Would mean that he does "depend" on every run, or am I wrong?

--Dennis


pgpuoYRBnu2Qh.pgp
Description: PGP signature
___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Automatic dependencies

2006-11-12 Thread Gerard Krol

Dennis Schridde wrote:

Am Freitag, 10. November 2006 16:54 schrieb Gerard Krol:
  

Hi,

The complete lack of dependencies somewhat bothers me, so I ran (X11)
makedepend. Attached are changes for the Makefile.raw's.
Now you don't have to run "make clean" all the time anymore.
Could someone with access to automake also incorporate the changes into
the Makefile.am's?


Is the makedepend exe included in MinGW?
Because I rewrote the Makefile.raw s to run with just a plain MinGW 
installation (without MSys). Would be ugly if we now required a non standard 
exe for a task like dependency checking...
  


Eh, no, makedepend is part of the linux/cygwin x11-bin package, I ran 
the cygwin version.
And it is not that every user needs to run "make depend", it just needs 
to be done when
there are changes to the includes. I believe there are switches to make 
gcc do the same as

makedepend, but a lot slower.

I think we really need those dependencies, it is, after all, quite 
annoying to do a "find -name "*.o" | xargs rm", alias "make clean",  
after a change in the header files.


- Gerard

___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Automatic dependencies

2006-11-11 Thread Dennis Schridde
Am Freitag, 10. November 2006 16:54 schrieb Gerard Krol:
> Hi,
>
> The complete lack of dependencies somewhat bothers me, so I ran (X11)
> makedepend. Attached are changes for the Makefile.raw's.
> Now you don't have to run "make clean" all the time anymore.
> Could someone with access to automake also incorporate the changes into
> the Makefile.am's?
Is the makedepend exe included in MinGW?
Because I rewrote the Makefile.raw s to run with just a plain MinGW 
installation (without MSys). Would be ugly if we now required a non standard 
exe for a task like dependency checking...

--Dennis


pgpSqXZ7dvslz.pgp
Description: PGP signature
___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Automatic dependencies

2006-11-10 Thread Per Inge Mathisen

On 11/10/06, Gerard Krol <[EMAIL PROTECTED]> wrote:

The complete lack of dependencies somewhat bothers me, so I ran (X11)
makedepend. Attached are changes for the Makefile.raw's.
Now you don't have to run "make clean" all the time anymore.
Could someone with access to automake also incorporate the changes into
the Makefile.am's?


There is no need. Automake automatically adds dependencies for
Makefile.am makefiles. If you change a Makefile.am, run automake and
./configure again before doing 'make'.

 - Per

___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev