This repository has been archived by the owner on Oct 12, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 420
/
Copy pathwin64.mak
137 lines (91 loc) · 4.24 KB
/
win64.mak
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# Makefile to build D runtime library druntime{64,32mscoff}.lib for Windows MSVC
# Set this to `32mscoff` for a 32-bit build.
MODEL=64
# Assume MSVC cl.exe in PATH is set up for the target MODEL.
# 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`.
CC=cl
DMD_DIR=..\dmd
BUILD=release
OS=windows
DMD=$(DMD_DIR)\generated\$(OS)\$(BUILD)\$(MODEL)\dmd
DOCDIR=doc
IMPDIR=import
MAKE=make
HOST_DMD=dmd
DFLAGS=-m$(MODEL) -conf= -O -release -preview=dip1000 -preview=fieldwise -preview=dtorfields -inline -w -Isrc -Iimport
UDFLAGS=-m$(MODEL) -conf= -O -release -preview=dip1000 -preview=fieldwise -w -version=_MSC_VER_$(_MSC_VER) -Isrc -Iimport
DDOCFLAGS=-conf= -c -w -o- -Isrc -Iimport -version=CoreDdoc
UTFLAGS=-version=CoreUnittest -unittest -checkaction=context
CFLAGS=/Z7
DRUNTIME_BASE=druntime$(MODEL)
DRUNTIME=lib\$(DRUNTIME_BASE).lib
# do not preselect a C runtime (extracted from the line above to make the auto tester happy)
CFLAGS=$(CFLAGS) /Zl
DOCFMT=
target: copydir copy $(DRUNTIME)
$(mak\COPY)
$(mak\DOCS)
$(mak\SRCS)
# NOTE: trace.d and cover.d are not necessary for a successful build
# as both are used for debugging features (profiling and coverage)
OBJS= errno_c_$(MODEL).obj
OBJS_TO_DELETE= errno_c_$(MODEL).obj
######################## Header file copy ##############################
import: copy
copydir:
"$(MAKE)" -f mak/WINDOWS copydir DMD="$(DMD)" HOST_DMD="$(HOST_DMD)" MODEL=$(MODEL) IMPDIR="$(IMPDIR)"
copy:
"$(MAKE)" -f mak/WINDOWS copy DMD="$(DMD)" HOST_DMD="$(HOST_DMD)" MODEL=$(MODEL) IMPDIR="$(IMPDIR)"
################### C\ASM Targets ############################
errno_c_$(MODEL).obj: src\core\stdc\errno.c
"$(CC)" -c -Fo$@ $(CFLAGS) src\core\stdc\errno.c
################### Library generation #########################
$(DRUNTIME): $(OBJS) $(SRCS) win64.mak
*"$(DMD)" -lib -of$(DRUNTIME) -Xfdruntime.json $(DFLAGS) $(SRCS) $(OBJS)
# due to -conf= on the command line, LINKCMD and LIB need to be set in the environment
unittest: $(SRCS) $(DRUNTIME)
*"$(DMD)" $(UDFLAGS) -version=druntime_unittest $(UTFLAGS) -ofunittest.exe -main $(SRCS) $(DRUNTIME) -debuglib=$(DRUNTIME) -defaultlib=$(DRUNTIME) user32.lib
.\unittest.exe
################### tests ######################################
test_uuid:
"$(MAKE)" -f test\uuid\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) test
test_aa:
"$(DMD)" -m$(MODEL) -conf= -Isrc -defaultlib=$(DRUNTIME) -run test\aa\src\test_aa.d
test_betterc:
"$(MAKE)" -f test\betterc\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
test_betterc_mingw:
"$(MAKE)" -f test\betterc\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" MINGW=_mingw test
test_cpuid:
"$(MAKE)" -f test\cpuid\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
test_exceptions:
"$(MAKE)" -f test\exceptions\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
test_hash:
"$(DMD)" -m$(MODEL) -conf= -Isrc -defaultlib=$(DRUNTIME) -run test\hash\src\test_hash.d
test_stdcpp:
setmscver.bat
"$(MAKE)" -f test\stdcpp\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
test_gc:
"$(MAKE)" -f test\gc\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
custom_gc:
$(MAKE) -f test\init_fini\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
test_shared:
$(MAKE) -f test\shared\win64.mak "DMD=$(DMD)" MODEL=$(MODEL) DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
test_common: test_shared test_aa test_cpuid test_exceptions test_hash test_gc custom_gc
test_mingw: test_common test_betterc_mingw
test_all: test_common test_betterc test_uuid test_stdcpp
################### zip/install/clean ##########################
zip: druntime.zip
druntime.zip: import
del druntime.zip
git ls-tree --name-only -r HEAD >MANIFEST.tmp
zip32 -T -ur druntime @MANIFEST.tmp
del MANIFEST.tmp
install: druntime.zip
unzip -o druntime.zip -d \dmd2\src\druntime
clean:
del $(DRUNTIME) $(OBJS_TO_DELETE)
rmdir /S /Q $(DOCDIR) $(IMPDIR)
auto-tester-build:
echo "Windows builds have been disabled on auto-tester"
auto-tester-test:
echo "Windows builds have been disabled on auto-tester"