Skip to content

Commit 49a3da0

Browse files
kinkeGeod24
authored andcommitted
Clean up win64.mak
* Remove unused variables. * Default to a matching MSVC cl.exe in PATH instead of an ancient Visual Studio 2010 installation. * Remove explicit 32-bit recipes, requiring a separate make invocation.
1 parent 15f69b5 commit 49a3da0

File tree

3 files changed

+17
-43
lines changed

3 files changed

+17
-43
lines changed

.github/workflows/cxx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ jobs:
275275
# but providing all three to avoid surprise for future contributors
276276
# Those should really be in the path, though.
277277
cd druntime
278-
make -f win64.mak CC=cl.exe LD=link "AR=$VISUAL_STUDIO_LIB_NOT_DM"
278+
make -f win64.mak
279279
if [ $? -ne 0 ]; then return 1; fi
280280
cd ../phobos/
281281
make -f win64.mak CC=cl.exe LD=link "AR=$VISUAL_STUDIO_LIB_NOT_DM"

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@ build_script:
5959
- cd c:\projects\dmd\src
6060
- msbuild vcbuild\dmd.sln /m /p:Configuration=Release;Platform=x64
6161
- cd c:\projects\druntime
62-
- make -f win64.mak DMD=../dmd/generated/Windows/Release/x64/dmd CC=cl auto-tester-build auto-tester-test
62+
- make -f win64.mak DMD=../dmd/generated/Windows/Release/x64/dmd auto-tester-build auto-tester-test
6363

6464
test_script: true

win64.mak

Lines changed: 15 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,17 @@
1-
# Makefile to build D runtime library druntime64.lib for Win64
1+
# Makefile to build D runtime library druntime{64,32mscoff}.lib for Windows MSVC
22

3+
# Set this to `32mscoff` for a 32-bit build.
34
MODEL=64
45

5-
# Visual Studio 2019
6-
#VCDIR=\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110
7-
#SDKDIR=\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0
8-
# Visual Studio 2015 and before
9-
VCDIR=\Program Files (x86)\Microsoft Visual Studio 10.0\VC
10-
SDKDIR=\Program Files (x86)\Microsoft SDKs\Windows\v7.0A
6+
# Assume MSVC cl.exe in PATH is set up for the target MODEL.
7+
# Otherwise set it explicitly, e.g., to `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x86\cl.exe`.
8+
CC=cl
119

1210
DMD_DIR=..\dmd
1311
BUILD=release
1412
OS=windows
1513
DMD=$(DMD_DIR)\generated\$(OS)\$(BUILD)\$(MODEL)\dmd
1614

17-
# Visual Studio 2017/2019
18-
#BINDIR=$(VCDIR)\bin\Hostx64\x64
19-
# Visual Studio 2015 and before
20-
BINDIR=$(VCDIR)\bin\amd64
21-
22-
CC=$(BINDIR)\cl
23-
LD=$(BINDIR)\link
24-
AR=$(BINDIR)\lib
25-
CP=cp
26-
2715
DOCDIR=doc
2816
IMPDIR=import
2917

@@ -36,10 +24,7 @@ DDOCFLAGS=-conf= -c -w -o- -Isrc -Iimport -version=CoreDdoc
3624

3725
UTFLAGS=-version=CoreUnittest -unittest -checkaction=context
3826

39-
#CFLAGS=/O2 /I"$(VCDIR)"\INCLUDE /I"$(SDKDIR)"\Include
40-
CFLAGS=/Z7 /I"$(VCDIR)"\INCLUDE /I"$(SDKDIR)"\Include
41-
# Visual Studio 2019
42-
#CFLAGS=/Z7 /I"$(VCDIR)"\include /I"$(SDKDIR)"\ucrt
27+
CFLAGS=/Z7
4328

4429
DRUNTIME_BASE=druntime$(MODEL)
4530
DRUNTIME=lib\$(DRUNTIME_BASE).lib
@@ -86,52 +71,41 @@ unittest: $(SRCS) $(DRUNTIME)
8671
*"$(DMD)" $(UDFLAGS) -version=druntime_unittest $(UTFLAGS) -ofunittest.exe -main $(SRCS) $(DRUNTIME) -debuglib=$(DRUNTIME) -defaultlib=$(DRUNTIME) user32.lib
8772
.\unittest.exe
8873

89-
################### Win32 COFF support #########################
90-
91-
# default to 32-bit compiler relative to 64-bit compiler, link and lib are architecture agnostic
92-
CC32=$(CC)\..\..\cl
93-
94-
druntime32mscoff:
95-
"$(MAKE)" -f win64.mak "DMD=$(DMD)" MODEL=32mscoff "CC=$(CC32)" "AR=$(AR)" "VCDIR=$(VCDIR)" "SDKDIR=$(SDKDIR)"
96-
97-
unittest32mscoff:
98-
"$(MAKE)" -f win64.mak "DMD=$(DMD)" MODEL=32mscoff "CC=$(CC32)" "AR=$(AR)" "VCDIR=$(VCDIR)" "SDKDIR=$(SDKDIR)" unittest
99-
10074
################### tests ######################################
10175

10276
test_uuid:
103-
"$(MAKE)" -f test\uuid\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) "VCDIR=$(VCDIR)" DRUNTIMELIB=$(DRUNTIME) test
77+
"$(MAKE)" -f test\uuid\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) test
10478

10579
test_aa:
10680
"$(DMD)" -m$(MODEL) -conf= -Isrc -defaultlib=$(DRUNTIME) -run test\aa\src\test_aa.d
10781

10882
test_betterc:
109-
"$(MAKE)" -f test\betterc\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) "VCDIR=$(VCDIR)" DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
83+
"$(MAKE)" -f test\betterc\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
11084

11185
test_betterc_mingw:
112-
"$(MAKE)" -f test\betterc\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) "VCDIR=$(VCDIR)" DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" MINGW=_mingw test
86+
"$(MAKE)" -f test\betterc\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" MINGW=_mingw test
11387

11488
test_cpuid:
115-
"$(MAKE)" -f test\cpuid\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) "VCDIR=$(VCDIR)" DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
89+
"$(MAKE)" -f test\cpuid\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
11690

11791
test_exceptions:
118-
"$(MAKE)" -f test\exceptions\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) "VCDIR=$(VCDIR)" DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
92+
"$(MAKE)" -f test\exceptions\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
11993

12094
test_hash:
12195
"$(DMD)" -m$(MODEL) -conf= -Isrc -defaultlib=$(DRUNTIME) -run test\hash\src\test_hash.d
12296

12397
test_stdcpp:
12498
setmscver.bat
125-
"$(MAKE)" -f test\stdcpp\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) "VCDIR=$(VCDIR)" DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
99+
"$(MAKE)" -f test\stdcpp\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
126100

127101
test_gc:
128-
"$(MAKE)" -f test\gc\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) "VCDIR=$(VCDIR)" DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
102+
"$(MAKE)" -f test\gc\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
129103

130104
custom_gc:
131-
$(MAKE) -f test\init_fini\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) "VCDIR=$(VCDIR)" DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
105+
$(MAKE) -f test\init_fini\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
132106

133107
test_shared:
134-
$(MAKE) -f test\shared\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) "VCDIR=$(VCDIR)" DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
108+
$(MAKE) -f test\shared\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
135109

136110
test_common: test_shared test_aa test_cpuid test_exceptions test_hash test_gc custom_gc
137111

0 commit comments

Comments
 (0)