Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ druntime.json
trace.def
trace.log
Makefile
/errno_c.obj
/errno_c*.obj
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why isn't this in the obj/ directory like everything else?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What obj/ directory? The Windows makefile does not make any reference to such a directory.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, see line 3 of the gitignore file. I forgot windows was lame, again. Which opens the other obvious question, why ignore just this one .obj and not all .obj? This line just screams out "Why?"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, minit.obj is versioned because it's hard to build or something...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minit.obj is in a subfolder where no other object files are generated to. "/*.obj" is non-recursive, but would include unittest.obj aswell.
In the long run, we should build into the /obj file hierarchy.

34 changes: 22 additions & 12 deletions win64.mak
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
# Makefile to build D runtime library druntime64.lib for Win64
# Makefile to build D runtime library druntime64.lib for Win64 or Win32/COFF

# To cross-compile 64-bit Druntime using 32-bit C++ compilers, run:
# make -f win64.mak VCBIN_SUBDIR=bin\x86_amd64

# To build for Win32/COFF, run:
# make -f win64.mak MODEL=32mscoff VCBIN_SUBDIR=bin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should use MODEL in the make file to set the VCBIN_SUBDIR.
Not sure if it can be done though, maybe double expansion works.
VCBIN_SUBDIR_64=bin\x86_64
VCBIN_SUBDIR=$(VCBIN_SUBDIR_$(MODEL))

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, DM make cannot do that.


## Memory model (32 or 64)
MODEL=64

VCDIR=\Program Files (x86)\Microsoft Visual Studio 10.0\VC
SDKDIR=\Program Files (x86)\Microsoft SDKs\Windows\v7.0A
## Visual C settings
VC=10
VCDIR=$(ProgramFiles)\Microsoft Visual Studio $(VC).0\VC
VCBIN_SUBDIR=bin\amd64
VCBIN_DIR=$(VCDIR)\$(VCBIN_SUBDIR)
CC="$(VCBIN_DIR)\cl"
#LD="$(VCBIN_DIR)\link"
#AR="$(VCBIN_DIR)\lib"

SDKDIR=$(ProgramFiles)\Microsoft SDKs\Windows\v7.0A
DMD=dmd

CC="$(VCDIR)\bin\amd64\cl"
LD="$(VCDIR)\bin\amd64\link"
AR="$(VCDIR)\bin\amd64\lib"
CP=cp

DOCDIR=doc
Expand Down Expand Up @@ -40,9 +50,9 @@ $(mak\SRCS)
# as both are used for debugging features (profiling and coverage)
# NOTE: a pre-compiled minit.obj has been provided in dmd for Win32 and
# minit.asm is not used by dmd for Linux

OBJS= errno_c.obj
OBJS_TO_DELETE= errno_c.obj
ERRNO_C_OBJ=errno_c$(MODEL).obj
OBJS= $(ERRNO_C_OBJ)
OBJS_TO_DELETE= $(ERRNO_C_OBJ)

######################## Doc .html file generation ##############################

Expand Down Expand Up @@ -637,8 +647,8 @@ $(IMPDIR)\etc\linux\memoryerror.d : src\etc\linux\memoryerror.d

################### C\ASM Targets ############################

errno_c.obj : src\core\stdc\errno.c
$(CC) -c $(CFLAGS) src\core\stdc\errno.c -Foerrno_c.obj
$(ERRNO_C_OBJ) : src\core\stdc\errno.c
$(CC) -c $(CFLAGS) src\core\stdc\errno.c -Fo$(ERRNO_C_OBJ)

src\rt\minit.obj : src\rt\minit.asm
$(CC) -c $(CFLAGS) src\rt\minit.asm
Expand Down