Josh Wilmes wrote: > > At 12:48 on 07/14/2003 +0200, Lars Balker Rasmussen <[EMAIL PROTECTED]> wrote: > > > I've taken this very simple approach to the problem. A perl-wrapper > > for the CC lines in makefiles/root.in > > > > .c$(O) : > > $(PERL) tools/dev/cc_flags.pl $(CC) $(CFLAGS) ${cc_o_out}$@ -c $< > > I would go a bit further, and create a tools/build/compile, tools/build/ > link_executable, tools/build/link_library, etc.
That would be silly. Instead, specify the file to read the flags from as the first argument to cc_flags.pl. That is, change: if (open F, "CFLAGS") { To: if (open F, shift @ARGV) { Then: c$(O) : $(PERL) tools/dev/flags.pl CFLAGS $(CC) $(CFLAGS) \ ${cc_o_out}$@ -c $< And for linking, flags.pl gets an argument of LINKFLAGS, and for making a shared library, it gets an argument of SHAREFLAGS, etc.. In each of those files are rules for the per-file flags for that type of step. > Take all the flags out of the makefile altogether. Just a thought. > > --Josh -- $a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca );{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "[EMAIL PROTECTED] ]\n";((6<=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))&&redo;}