Phobos posix.mak -> D file using reggae: round 2

Marco Leise via Digitalmars-d digitalmars-d at puremagic.com
Mon Apr 18 16:17:39 PDT 2016


Am Mon, 18 Apr 2016 15:15:26 +0000
schrieb Atila Neves <atila.neves at gmail.com>:

Just remember that makefiles are well integrated with other
systems (i.e. package managers) and there are some
conventions, about what certain environment variables mean.
To name a few:

MAKEOPTS=-j4  (parallel build with N processes)
DC=/opt/ldc2-0.17/bin/ldc2  (Dlang compiler)
DC_FLAGS=-O5  (flags for that compiler)
LDFLAGS=-L=-O1  (flags for the linker)
PREFIX=/usr  (installation prefix)

Dlang projects already have some make files that handle linker
flag prefixes while others will pass them verbatim to gcc and
some make files accept a DMD (ldmd2, gdmd, dmd) and others a
DC (ldc2, gdc, dmd). The more things we can override, the
better.
As a practical example, on Gentoo, the package management sets
all kinds of environment variables, most importantly PREFIX,
LDFLAGS, CFLAGS and CXXFLAGS. It would be great if any
replacement system would also honor those (translated to D).
Even better if it could handle GDC and LDC2 directly (since
gdmd and ldmd2 don't do all the way).
LDFLAGS need translation from the default (GCC) syntax to DMD
and LDC2. I currently do this in a helper script and would not
depend on the build script doing that.

-- 
Marco



More information about the Digitalmars-d mailing list