View mode: basic / threaded / horizontal-split · Log in · Help
January 01, 2005
DFLAGS versus GDC
Is it wise to use the same variables for
the different syntax of compiler flags ?

Sometimes I use the "gdc" compiler, and
sometimes I use the dmd wrapper instead.
But if I put in a Makefile, then I must
remember to use the correct flags syntax...


Q: Would it be easier to *not* use the same
DFLAGS setting for two compilers, in make ?

I was thinking something like this:
> CC=gcc
> CFLAGS=-O2
> 
> CXX=g++
> CXXFLAGS=-O2
> 
> DC=gdc
> DCFLAGS=-O2 -frelease
>
> DMD=dmd
> DFLAGS=-O -release

I agree that "DFLAGS" is the best name for it
(same as CFLAGS), but unfortunately it's taken.
And I guess DMDFLAGS is not really an option ;)


Or am I just complicating it? Maybe I am the only
one getting the two mixed up, and it can stay asis...

--anders
January 01, 2005
Re: DFLAGS versus GDC
Anders F Björklund wrote:
> Is it wise to use the same variables for
> the different syntax of compiler flags ?
> 
> Sometimes I use the "gdc" compiler, and
> sometimes I use the dmd wrapper instead.
> But if I put in a Makefile, then I must
> remember to use the correct flags syntax...
> 
> 
> Q: Would it be easier to *not* use the same
> DFLAGS setting for two compilers, in make ?
> 
> I was thinking something like this:
> 
>> CC=gcc
>> CFLAGS=-O2
>>
>> CXX=g++
>> CXXFLAGS=-O2
>>
>> DC=gdc
>> DCFLAGS=-O2 -frelease
>>
>> DMD=dmd
>> DFLAGS=-O -release
> 
> 
> I agree that "DFLAGS" is the best name for it
> (same as CFLAGS), but unfortunately it's taken.
> And I guess DMDFLAGS is not really an option ;)
> 
> 
> Or am I just complicating it? Maybe I am the only
> one getting the two mixed up, and it can stay asis...
> 
> --anders

Note that when A-A-P get gdc support (whenever anyone cares to test it 
enough), it will expect DMD style flags and convert them where needed.

Lars Ivar Igesund
January 02, 2005
Re: DFLAGS versus GDC
Lars Ivar Igesund wrote:

> Note that when A-A-P get gdc support (whenever anyone cares to test it 
> enough), it will expect DMD style flags and convert them where needed.

Why A-A-P over SCons, or one of the other Python hacks ? (just curious)

I think most of the D projects uses DMD and DFLAGS, and not gdc style...
(which should work just fine with GDC, using the "dmd" wrapper script)

Which was why I thought the xFLAGS variable for gdc should be renamed ?

--anders
January 02, 2005
Re: DFLAGS versus GDC
Anders F Björklund wrote:
> Lars Ivar Igesund wrote:
> 
>> Note that when A-A-P get gdc support (whenever anyone cares to test it 
>> enough), it will expect DMD style flags and convert them where needed.
> 
> 
> Why A-A-P over SCons, or one of the other Python hacks ? (just curious)
> 

I think A-A-P has some more functionality, or at least higher aims, than 
SCons (Downloading, publishing...). The last time I tried it (which was 
about a year ago, I think) it didn't work very well, but maybe it would 
be time to try again. I've always thought the SConstruct file syntax was 
a bit clumsy, and SCons is slow.

-Sebastian
January 02, 2005
Re: DFLAGS versus GDC
Anders F Björklund wrote:
> Why A-A-P over SCons, or one of the other Python hacks ? (just curious)

Ehm, it's syntax is more highlevel, IMHO. Also, many of it's ideas are 
taken from SCons, refining them. Apart from that, I know to little of 
SCons to comment.

I find A-A-P syntax at least as powerful as that used by make and much 
more easy on the eye. In addition to being scriptable by Python where 
needed.

> I think most of the D projects uses DMD and DFLAGS, and not gdc style...
> (which should work just fine with GDC, using the "dmd" wrapper script)

Good point, A-A-P could use the dmd wrapper when using gdc. Then again, 
A-A-P have generalized some flags such that they must be translated for 
any compiler. By using the dmd wrapper, they would then be translated 
twice. Whether this practice is good, might be questionable, although I 
find the current decisions sound. Also, it might be possible to finetune 
the gdc tool in A-A-P if the wrapper ain't used. (BTW, it handle 
compilation, linking (of exes, dlls (sos) and libs) and even more if 
possible through the compiler itself or auxiliary tools. E.g. on 
Windows, DMD can produce import libraries (using link.exe), something 
which is handled by an A-A-P variable.

Lars Ivar Igesund
Top | Discussion index | About this forum | D home