23 changes: 15 additions & 8 deletions src/posix.mak
Original file line number Diff line number Diff line change
Expand Up @@ -179,20 +179,20 @@ endif
endif


DMD_SRCS=$(addsuffix .d,access aggregate aliasthis apply argtypes arrayop \
arraytypes attrib backend builtin canthrow clone complex cond constfold \
FRONT_SRCS=$(addsuffix .d,access aggregate aliasthis apply argtypes arrayop \
arraytypes attrib builtin canthrow clone complex cond constfold \
cppmangle ctfeexpr dcast dclass declaration delegatize denum dimport \
dinifile dinterpret dmacro dmangle dmodule doc dscope dstruct dsymbol \
dtemplate dunittest dversion entity errors escape expression func \
globals hdrgen id identifier impcnvtab imphint init inline intrange \
json lexer lib link mars mtype nogc nspace opover optimize parse sapply \
sideeffect statement staticassert target tokens traits utf visitor \
typinf irstate toelfdebug toctype)
typinf)

ifeq ($(D_OBJC),1)
DMD_SRCS += objc.d
FRONT_SRCS += objc.d
else
DMD_SRCS += objc_stubs.d
FRONT_SRCS += objc_stubs.d
endif

ROOT_SRCS = $(addsuffix .d,$(addprefix $(ROOT)/,aav array file filename \
Expand All @@ -210,11 +210,15 @@ else
endif

ifeq (osx,$(OS))
DMD_SRCS += libmach.d scanmach.d
FRONT_SRCS += libmach.d scanmach.d
else
DMD_SRCS += libelf.d scanelf.d
FRONT_SRCS += libelf.d scanelf.d
endif

GLUE_SRCS=$(addsuffix .d,backend irstate toelfdebug toctype gluelayer)

DMD_SRCS=$(FRONT_SRCS) $(GLUE_SRCS)

BACK_OBJS = go.o gdag.o gother.o gflow.o gloop.o var.o el.o \
glocal.o os.o nteh.o evalu8.o cgcs.o \
rtlsym.o cgelem.o cgen.o cgreg.o out.o \
Expand Down Expand Up @@ -285,7 +289,7 @@ DEPS = $(patsubst %.o,%.deps,$(DMD_OBJS) $(GLUE_OBJS) $(BACK_OBJS))

all: dmd

auto-tester-build: dmd checkwhitespace
auto-tester-build: dmd checkwhitespace dmd_frontend
.PHONY: auto-tester-build

glue.a: $(GLUE_OBJS)
Expand All @@ -294,6 +298,9 @@ glue.a: $(GLUE_OBJS)
backend.a: $(BACK_OBJS)
$(AR) rcs backend.a $(BACK_OBJS)

dmd_frontend: $(FRONT_SRCS) gluelayer.d $(ROOT_SRCS) newdelete.o $(STRING_IMPORT_FILES) $(HOST_DMD_PATH)
CC=$(HOST_CC) $(HOST_DMD_RUN) -of$@ $(MODEL_FLAG) -vtls -J. -L-lstdc++ $(DFLAGS) $(filter-out $(STRING_IMPORT_FILES) $(HOST_DMD_PATH),$^) -version=NoBackend

ifdef ENABLE_LTO
dmd: $(DMD_SRCS) $(ROOT_SRCS) newdelete.o $(GLUE_OBJS) $(BACK_OBJS) $(STRING_IMPORT_FILES) $(HOST_DMD_PATH)
CC=$(HOST_CC) $(HOST_DMD_RUN) -of$@ $(MODEL_FLAG) -vtls -J. -L-lstdc++ $(DFLAGS) $(filter-out $(STRING_IMPORT_FILES) $(HOST_DMD_PATH),$^)
Expand Down
4 changes: 1 addition & 3 deletions src/statement.d
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import ddmd.aliasthis;
import ddmd.arrayop;
import ddmd.arraytypes;
import ddmd.attrib;
import ddmd.backend;
import ddmd.gluelayer;
import ddmd.canthrow;
import ddmd.clone;
import ddmd.cond;
Expand Down Expand Up @@ -54,8 +54,6 @@ import ddmd.target;
import ddmd.tokens;
import ddmd.visitor;

extern extern (C++) Statement asmSemantic(AsmStatement s, Scope* sc);

extern (C++) Identifier fixupLabelName(Scope* sc, Identifier ident)
{
uint flags = (sc.flags & SCOPEcontract);
Expand Down
3 changes: 1 addition & 2 deletions src/typinf.d
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ import ddmd.dstruct;
import ddmd.dsymbol;
import ddmd.errors;
import ddmd.globals;
import ddmd.gluelayer;
import ddmd.mtype;
import ddmd.visitor;

extern (C++) void toObjFile(Dsymbol ds, bool multiobj);

/****************************************************
* Get the exact TypeInfo.
*/
Expand Down
19 changes: 13 additions & 6 deletions src/win32.mak
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,8 @@ DMDMAKE=$(MAKE) -fwin32.mak C=$C TK=$(TK) ROOT=$(ROOT) HOST_DC="$(HOST_DC)"
############################### Rule Variables ###############################

# D front end
# mars.obj
DMD_SRCS=access.d aggregate.d aliasthis.d apply.d argtypes.d arrayop.d \
arraytypes.d attrib.d backend.d builtin.d canthrow.d clone.d complex.d \
FRONT_SRCS=access.d aggregate.d aliasthis.d apply.d argtypes.d arrayop.d \
arraytypes.d attrib.d builtin.d canthrow.d clone.d complex.d \
cond.d constfold.d cppmangle.d ctfeexpr.d dcast.d dclass.d \
declaration.d delegatize.d denum.d dimport.d dinifile.d dinterpret.d \
dmacro.d dmangle.d dmodule.d doc.d dscope.d dstruct.d dsymbol.d \
Expand All @@ -148,7 +147,11 @@ DMD_SRCS=access.d aggregate.d aliasthis.d apply.d argtypes.d arrayop.d \
mars.d mtype.d nogc.d nspace.d objc_stubs.d opover.d optimize.d parse.d \
sapply.d sideeffect.d statement.d staticassert.d target.d tokens.d \
traits.d utf.d visitor.d libomf.d scanomf.d typinf.d \
libmscoff.d scanmscoff.d irstate.d toctype.d
libmscoff.d scanmscoff.d

GLUE_SRCS=irstate.d toctype.d backend.d gluelayer.d

DMD_SRCS=$(FRONT_SRCS) $(GLUE_SRCS)

# Glue layer
GLUEOBJ=glue.obj msc.obj s2ir.obj todt.obj e2ir.obj tocsym.obj \
Expand Down Expand Up @@ -188,7 +191,8 @@ GLUESRC= glue.c msc.c s2ir.c todt.c e2ir.c tocsym.c \
toobj.c tocvdebug.c toir.h toir.c \
irstate.h iasm.c \
toelfdebug.d libelf.d scanelf.d libmach.d scanmach.d \
tk.c eh.c objc_glue_stubs.c objc_glue.c gluestub.d
tk.c eh.c objc_glue_stubs.c objc_glue.c \
$(GLUE_SRCS)

# D back end
BACKSRC= $C\cdef.h $C\cc.h $C\oper.h $C\ty.h $C\optabgen.c \
Expand Down Expand Up @@ -244,7 +248,7 @@ MAKEFILES=win32.mak posix.mak osmodel.mak

defaulttarget: debdmd

auto-tester-build: dmd checkwhitespace
auto-tester-build: dmd checkwhitespace dmd_frontend.exe

dmd: reldmd

Expand Down Expand Up @@ -272,6 +276,9 @@ backend.lib : $(BACKOBJ)

LIBS= glue.lib backend.lib

dmd_frontend.exe: $(FRONT_SRCS) gluelayer.d $(ROOT_SRCS) newdelete.obj verstr.h
$(HOST_DC) $(DSRC) -of$@ -vtls -J. -L/STACK:8388608 $(DFLAGS) $(FRONT_SRCS) gluelayer.d $(ROOT_SRCS) newdelete.obj -version=NoBackend

$(TARGETEXE): $(DMD_SRCS) $(ROOT_SRCS) newdelete.obj $(LIBS) verstr.h
$(HOST_DC) $(DSRC) -of$@ -vtls -J. -L/STACK:8388608 $(DFLAGS) $(DMD_SRCS) $(ROOT_SRCS) newdelete.obj $(LIBS)

Expand Down