This repository has been archived by the owner on Feb 8, 2024. It is now read-only.
forked from dlang/druntime
-
Notifications
You must be signed in to change notification settings - Fork 28
/
win32.mak
172 lines (119 loc) · 4.63 KB
/
win32.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# Makefile to build D runtime library druntime.lib for Win32 OMF
# MS COFF builds use win64.mak for 32 and 64 bit
# Ignored, only the default value is supported
#MODEL=32omf
DMD_DIR=..\dmd
BUILD=release
OS=windows
DMD=$(DMD_DIR)\generated\$(OS)\$(BUILD)\32\dmd
# Used for running MASM assembler on .asm files
CC=dmc
MAKE=make
HOST_DMD=dmd
DOCDIR=doc
IMPDIR=import
# For compiling D and ImportC files
DFLAGS=-m32omf -conf= -O -release -preview=dip1000 -preview=fieldwise -preview=dtorfields -inline -w -Isrc -Iimport
# For unittest build
UDFLAGS=-m32omf -conf= -O -release -preview=dip1000 -preview=fieldwise -w -Isrc -Iimport
# Also for unittest build
UTFLAGS=-version=CoreUnittest -unittest -checkaction=context
CFLAGS=
DRUNTIME_BASE=druntime
DRUNTIME=lib\$(DRUNTIME_BASE).lib
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)
# 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_32omf.obj src\rt\minit.obj
OBJS_TO_DELETE= errno_c_32omf.obj
######################## Header file copy ##############################
import: copy
copydir:
"$(MAKE)" -f mak/WINDOWS copydir DMD="$(DMD)" HOST_DMD="$(HOST_DMD)" MODEL=32 IMPDIR="$(IMPDIR)"
copy:
"$(MAKE)" -f mak/WINDOWS copy DMD="$(DMD)" HOST_DMD="$(HOST_DMD)" MODEL=32 IMPDIR="$(IMPDIR)"
################### Win32 Import Libraries ###################
IMPLIBS= \
lib\win32\glu32.lib \
lib\win32\odbc32.lib \
lib\win32\opengl32.lib \
lib\win32\rpcrt4.lib \
lib\win32\shell32.lib \
lib\win32\version.lib \
lib\win32\wininet.lib \
lib\win32\winspool.lib
implibsdir:
if not exist lib\win32 mkdir lib\win32
implibs: implibsdir $(IMPLIBS)
lib\win32\glu32.lib: def\glu32.def
implib $@ $**
lib\win32\odbc32.lib: def\odbc32.def
implib $@ $**
lib\win32\opengl32.lib: def\opengl32.def
implib $@ $**
lib\win32\rpcrt4.lib: def\rpcrt4.def
implib $@ $**
lib\win32\shell32.lib: def\shell32.def
implib $@ $**
lib\win32\version.lib: def\version.def
implib $@ $**
lib\win32\wininet.lib: def\wininet.def
implib $@ $**
lib\win32\winspool.lib: def\winspool.def
implib $@ $**
################### C\ASM Targets ############################
errno_c_32omf.obj: src\core\stdc\errno.c
$(DMD) -c -of=$@ $(DFLAGS) -v -P=-I. src\core\stdc\errno.c
# only rebuild explicitly
rebuild_minit_obj: src\rt\minit.asm
$(CC) -c $(CFLAGS) src\rt\minit.asm
################### Library generation #########################
$(DRUNTIME): $(OBJS) $(SRCS) win32.mak
*$(DMD) -lib -of$(DRUNTIME) -Xfdruntime.json $(DFLAGS) $(SRCS) $(OBJS)
################### Unittests #########################
# Unittest are not run because OPTLINK tends to crash when linking
# unittest.exe. Note that the unittests are still run for -m32mscoff
# and -m64 which are configured in win64.mak
unittest: unittest.obj
@echo "Unittests cannot be linked on Win32 + OMF due to OPTLINK issues"
# Split compilation into a different step to avoid unnecessary rebuilds
unittest.obj: $(SRCS) win32.mak
*$(DMD) $(UDFLAGS) $(UTFLAGS) -c -of$@ $(SRCS)
################### tests ######################################
test_aa:
$(DMD) -m32omf -conf= -Isrc -defaultlib=$(DRUNTIME) -run test\aa\src\test_aa.d
test_cpuid:
"$(MAKE)" -f test\cpuid\win64.mak "DMD=$(DMD)" MODEL=32omf "VCDIR=$(VCDIR)" DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
test_exceptions:
"$(MAKE)" -f test\exceptions\win64.mak "DMD=$(DMD)" MODEL=32omf "VCDIR=$(VCDIR)" DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
test_hash:
$(DMD) -m32omf -conf= -Isrc -defaultlib=$(DRUNTIME) -run test\hash\src\test_hash.d
test_gc:
"$(MAKE)" -f test\gc\win64.mak "DMD=$(DMD)" MODEL=32omf "VCDIR=$(VCDIR)" DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
custom_gc:
$(MAKE) -f test\init_fini\win64.mak "DMD=$(DMD)" MODEL=32omf "VCDIR=$(VCDIR)" DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
test_shared:
$(MAKE) -f test\shared\win64.mak "DMD=$(DMD)" MODEL=32omf "VCDIR=$(VCDIR)" DRUNTIMELIB=$(DRUNTIME) "CC=$(CC)" test
test_all: test_aa test_cpuid test_exceptions test_hash test_gc custom_gc test_shared
################### zip/install/clean ##########################
zip: druntime.zip
druntime.zip:
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"