forked from dlang/tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwin32.mak
108 lines (82 loc) · 2.33 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
# Where scp command copies to
SCPDIR=..\backup
##### Tools
# D compiler
DMD=dmd
# C++ compiler
CC=dmc
# Make program
MAKE=make
# Librarian
LIB=lib
# Delete file(s)
DEL=del
# Make directory
MD=mkdir
# Remove directory
RD=rmdir
# File copy
CP=cp
# De-tabify
DETAB=detab
# Convert line endings to Unix
TOLF=tolf
# Zip
ZIP=zip32
# Copy to another directory
SCP=$(CP)
DFLAGS=-O -release -m$(MODEL)
GENERATED = generated
ROOT = $(GENERATED)\windows\32
TARGETS= $(ROOT)\dman.exe \
$(ROOT)\rdmd.exe \
$(ROOT)\ddemangle.exe \
$(ROOT)\changed.exe \
$(ROOT)\dustmite.exe
MAKEFILES=win32.mak win64.mak posix.mak
SRCS=dman.d rdmd.d ddemangle.d
targets : $(TARGETS)
dman: $(ROOT)\dman.exe
rdmd: $(ROOT)\rdmd.exe
ddemangle: $(ROOT)\ddemangle.exe
changed: $(ROOT)\changed.exe
dustmite: $(ROOT)\dustmite.exe
d-tags.json :
@echo 'Build d-tags.json and copy it here, e.g. by running:'
@echo " make -C ../dlang.org -f win32.mak d-tags.json && copy ../dlang.org/d-tags-latest.json d-tags.json"
@exit
$(ROOT)\dman.exe : dman.d d-tags.json
$(DMD) $(DFLAGS) -of$@ dman.d -J.
$(ROOT)\rdmd.exe : rdmd.d
$(DMD) $(DFLAGS) -of$@ rdmd.d advapi32.lib
$(ROOT)\ddemangle.exe : ddemangle.d
$(DMD) $(DFLAGS) -of$@ ddemangle.d
$(ROOT)\dustmite.exe : DustMite/dustmite.d DustMite/splitter.d DustMite/polyhash.d
$(DMD) $(DFLAGS) -of$@ -version=Dlang_Tools DustMite/dustmite.d DustMite/splitter.d DustMite/polyhash.d
$(ROOT)\changed.exe : changed.d
$(DMD) $(DFLAGS) -of$@ changed.d
clean :
rmdir /s /q $(GENERATED)
detab:
$(DETAB) $(SRCS)
tolf:
$(TOLF) $(SRCS) $(MAKEFILES)
zip: detab tolf $(MAKEFILES)
$(DEL) dman.zip
$(ZIP) dman $(MAKEFILES) $(SRCS) $(TAGS)
scp: detab tolf $(MAKEFILES)
$(SCP) $(SRCS) $(MAKEFILES) $(SCPDIR)
################################################################################
# Build and run tests
################################################################################
RDMD_TEST_COMPILERS = $(DMD)
RDMD_TEST_EXECUTABLE = $(ROOT)\rdmd.exe
RDMD_TEST_DEFAULT_COMPILER = $(DMD)
$(ROOT)\rdmd_test.exe : rdmd_test.d
$(DMD) $(DFLAGS) -of$@ rdmd_test.d
test_rdmd : $(ROOT)\rdmd_test.exe $(RDMD_TEST_EXECUTABLE)
$(ROOT)\rdmd_test.exe \
$(RDMD_TEST_EXECUTABLE) -m$(MODEL) -v \
--rdmd-default-compiler=$(RDMD_TEST_DEFAULT_COMPILER) \
--test-compilers=$(RDMD_TEST_COMPILERS)
test : test_rdmd