@@ -266,10 +266,10 @@ alias opTabGen = memoize!(function() {
266266});
267267
268268// / Returns: the dependencies that build the D backend
269- alias dBackend = memoize! (function () {
269+ alias backendObj = memoize! (function () {
270270 Dependency dependency = {
271- name: " dbackend " ,
272- target: env[" G" ].buildPath(" dbackend " ).objName,
271+ name: " backendObj " ,
272+ target: env[" G" ].buildPath(" backend " ).objName,
273273 sources: sources.backend,
274274 msg: " (DC) D_BACK_OBJS %-(%s, %)" .format(sources.backend.map! (e => e.baseName).array),
275275 deps: [opTabGen],
@@ -289,9 +289,9 @@ alias backend = memoize!(function() {
289289 Dependency dependency = {
290290 name: " backend" ,
291291 msg: " (LIB) %s" .format(" BACKEND" .libName),
292- sources: [ env[" G" ].buildPath(" dbackend " ).objName ],
292+ sources: [ env[" G" ].buildPath(" backend " ).objName ],
293293 target: env[" G" ].buildPath(" backend" ).libName,
294- deps: [opTabGen, dBackend ],
294+ deps: [opTabGen, backendObj ],
295295 command: [env[" HOST_DMD_RUN" ], env[" MODEL_FLAG" ], " -lib" , " -of$@" , " $<" ]
296296 };
297297 return new DependencyRef(dependency);
@@ -397,6 +397,7 @@ alias clean = memoize!(function() {
397397 return new DependencyRef(dependency);
398398});
399399
400+
400401/**
401402Goes through the target list and replaces short-hand targets with their expanded version.
402403Special targets:
@@ -521,6 +522,31 @@ struct DependencyRange
521522// / Sets the environment variables
522523void parseEnvironment ()
523524{
525+ // This block is temporary until we can remove the windows make files
526+ {
527+ const ddebug = env.get (" DDEBUG" , null );
528+ if (ddebug.length)
529+ {
530+ writefln(" WARNING: the DDEBUG variable is deprecated" );
531+ if (ddebug == " -debug -g -unittest -cov" )
532+ {
533+ environment[" ENABLE_DEBUG" ] = " 1" ;
534+ environment[" ENABLE_UNITTEST" ] = " 1" ;
535+ environment[" ENABLE_COVERAGE" ] = " 1" ;
536+ }
537+ else if (ddebug == " -debug -g -unittest" )
538+ {
539+ environment[" ENABLE_DEBUG" ] = " 1" ;
540+ environment[" ENABLE_UNITTEST" ] = " 1" ;
541+ }
542+ else
543+ {
544+ writefln(" Error: DDEBUG is not an expected value '%s'" , ddebug);
545+ exit(1 );
546+ }
547+ }
548+ }
549+
524550 env.getDefault(" TARGET_CPU" , " X86" );
525551 version (Windows )
526552 {
@@ -755,22 +781,39 @@ auto sourceFiles()
755781 .map! (e => e.name)
756782 .filter! (e => ! lexerRootFiles.canFind(e.baseName.stripExtension))
757783 .array,
758- backend:
759- dirEntries(env[" C" ], " *.d" , SpanMode.shallow)
760- .map! (e => e.name)
761- .filter! (e => ! e.baseName.among(" dt.d" , " obj.d" , " optabgen.d" ))
762- .array,
763- backendHeaders: [
764- // can't be built with -betterC
765- " dt" ,
766- " obj" ,
767- ].map! (e => env[" C" ].buildPath(e ~ " .d" )).array,
784+ backend: ("
785+ bcomplex.d evalu8.d divcoeff.d dvec.d go.d gsroa.d glocal.d gdag.d gother.d gflow.d
786+ out.d
787+ gloop.d compress.d cgelem.d cgcs.d ee.d cod4.d cod5.d nteh.d blockopt.d mem.d cg.d cgreg.d
788+ dtype.d debugprint.d fp.d symbol.d elem.d dcode.d cgsched.d cg87.d cgxmm.d cgcod.d cod1.d cod2.d
789+ cod3.d cv8.d dcgcv.d pdata.d util2.d var.d md5.d backconfig.d ph2.d drtlsym.d dwarfeh.d ptrntab.d
790+ dvarstats.d dwarfdbginf.d cgen.d os.d goh.d barray.d cgcse.d elpicpie.d
791+ " .split
792+ ~ versionTernary! " OSX" ([" machobj.d" ], [" elfobj.d" ])
793+ ~ versionTernary! " Windows" (" cgobj.d filespec.d mscoffobj.d newman.d" .split, [" aarray.d" ])
794+ ).map! (e => env[" C" ].buildPath(e)).array,
795+ backendHeaders: "
796+ cc.d cdef.d cgcv.d code.d cv4.d dt.d el.d global.d
797+ obj.d oper.d outbuf.d rtlsym.d code_x86.d iasm.d codebuilder.d
798+ ty.d type.d exh.d mach.d mscoff.d dwarf.d dwarf2.d xmm.d
799+ dlist.d melf.d varstats.di
800+ " .split.map! (e => env[" C" ].buildPath(e)).array,
768801 };
802+ sources.backend ~= ((env[" OS" ] == " windows" && env[" MODEL" ] == " 64" ) ? [" strtold.d" , " longdouble.d" ] : [])
803+ .map! (e => env[" ROOT" ].buildPath(e)).array;
804+
769805 sources.dmd = sources.frontend ~ sources.backendHeaders;
770806
771807 return sources;
772808}
773809
810+ // / Returns the first argument if the given version is true, otherwise, returns the second argument.
811+ auto versionTernary (string version_, T)(T trueCase, T falseCase)
812+ {
813+ mixin (" version(" ~ version_ ~ " ) { return trueCase; }" );
814+ return falseCase;
815+ }
816+
774817/**
775818Downloads a file from a given URL
776819
0 commit comments