Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2004:
[Freeciv-Dev] Re: (PR#8640) Target "*.ruleset" at data/nation/Makefile
Home

[Freeciv-Dev] Re: (PR#8640) Target "*.ruleset" at data/nation/Makefile

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#8640) Target "*.ruleset" at data/nation/Makefile
From: "Marko Lindqvist" <marko.lindqvist@xxxxxxxxxxx>
Date: Sun, 2 May 2004 01:53:32 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8640 >

Jason Short wrote:

> <URL: http://rt.freeciv.org/Ticket/Display.html?id=8640 >
> 
> Marko Lindqvist wrote:
> 
>><URL: http://rt.freeciv.org/Ticket/Display.html?id=8640 >
>>
>>make[3]: *** No rule to make target `*.ruleset', needed by 
>>`Makefile.am'.  Stop.
>>
>>
>>  Looking Makefile.am.sh, rule to generate Makefile.am actually have 
>>dependency generated as $(echo *.ruleset). I don't even understand what 
>>it tries to achieve. Why would Makefile.am depend on all rulesets? 
>>Probably Makefile.am is meant to be rebuilt when ever _list of_ rulesets 
>>changes, but implementation is far from that in every aspect...
> 
> 
> It's a clever but somewhat broken way to make sure new nations get added 
> to Makefile.am automatically.  So if a new ruleset is added and you run 
> "make" Makefile.am (depending on this new ruleset) will be rebuilt to 
> include it.

  But it does not work if someone removes ruleset. Timestamp for no 
ruleset is newer than Makefile.am's. Something like this might work:

ruleset_list.txt :
        ls -1 *.ruleset > ruleset_list.temp
         if ! [ -e ruleset_list.txt ] || ! [ cmp -s ruleset_list.txt 
ruleset_list.temp ] ; then mv -f ruleset_list.temp ruleset_list.txt ; 
else rm ruleset_list.temp

Makefile.am : Makefile.am.sh ruleset_list.txt
        sh Makefile.am.sh >Makefile.am

> 
> This is broken because you generally have to rerun autogen.sh again 
> anyway for the changes to take effect.

  And this is because?

> 
> I guess on your system "echo *.ruleset" outputs "*.ruleset" rather than 
> an actual list of the ruleset files?

  Sometimes yes (as in every system), but this is caused just another 
problem of this particular Makefile: It does not work with separate 
builddir. It tries to generate Makefile.am into builddir and $(echo 
*.ruleset) gets done at directory containing only Makefile 
(builddir/data/nation).

> 
> 
>>  Well, this individual problem might is not worth fixing now, since it 
>>seems to me that whoever wrote this file, did not really understand what 
>>was doing and it should be rewritten completely. I'll volunteer, but 
>>give no estimations when I have time to actually do it. This is, of 
>>course, unless someone can explain why it must be the way it is. Maybe 
>>(minimum) implementation as Makefile.am puts too much constraints to 
>>what kind of 'make' programs one can use? (But I think it's quite 
>>unlikely that more limited 'make' can use Makefiles generated by 
>>automake -> autoconf anyway, not to mention compiler generated dependencies)
> 
> 
> Try searching the archives.  The old method required manual changes. 
> Someone got the idea it would be good to automate this.  But the result 
> isn't perfect.
> 

  I'll check archives, but I think I already understand what it tries to 
do. All the required automation is possible with automake + make. I just 
don't know how easy way I can take, easiest solutions for GNU make may 
not work with other versions of make. Older versions of automake may set 
some constraints too.

  Does anybody have system with quite old toolchain (as old as possible 
being still supported by freeciv) available?


  - Caz




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