public
Description: Set of makefiles to build cross and native toolchains for windows x64 on linux/darwin
Homepage:
Clone URL: git://github.com/cournape/cross-mingw-w64.git
cross-mingw-w64 / Makefile.w64
100644 212 lines (158 sloc) 5.21 kb
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
ROOT_DIR = $(PWD)
ARCHIVE_DIR = $(ROOT_DIR)/archives
BUILD_DIR = $(ROOT_DIR)/build
INSTALL_DIR = $(ROOT_DIR)/install
 
TARGET = x86_64-pc-mingw32
 
# BINUTILS_SRC = $(ARCHIVE_DIR)/binutils-2.19
# BINUTILS_BLD = $(BUILD_DIR)/binutils-2.19
#
# MINGW32_SRC = $(ARCHIVE_DIR)/mingw-runtime-3.14
# MINGW32_BLD = $(BUILD_DIR)/mingw-runtime-3.14
#
# MINGW64_SRC = $(ARCHIVE_DIR)/trunk
# MINGW64_BLD = $(BUILD_DIR)/mingw-w64
#
# W32API_SRC = $(ARCHIVE_DIR)/w32api-3.11
# W32API_BLD = $(BUILD_DIR)/w32api-3.11
#
# W64API_SRC = $(ARCHIVE_DIR)/trunk/mingw-w64-crt
# W64API_BLD = $(BUILD_DIR)/mingw-w64-crt
#
# GDB_SRC = $(ARCHIVE_DIR)/gdb-6.8
# GDB_BLD = $(BUILD_DIR)/gdb-6.8
#
# GMP_SRC = $(ARCHIVE_DIR)/gmp-4.2.2
# GMP_BLD = $(BUILD_DIR)/gmp-4.2.2
#
# MPFR_SRC = $(ARCHIVE_DIR)/mpfr-2.4.1
# MPFR_BLD = $(BUILD_DIR)/mpfr-2.4.1
#
# MAKE = make -j8
#
# LOCAL_PREFIX = /usr/data/david/local
# GCC_CONFIGURE_OPTS = --with-gmp=$(LOCAL_PREFIX) --with-mpfr=$(LOCAL_PREFIX) \
# --with-sysroot=$(INSTALL_DIR) --with-gnu-ld --with-gnu-as
#
# GCC_SRC = $(ARCHIVE_DIR)/gcc-4.4-20090320
# GCC_BLD = $(BUILD_DIR)/gcc-4.4-20090320
#
# GCC_LANGUAGES = c,fortran,c++
 
BINUTILS_SRC = $(ARCHIVE_DIR)/binutils/src
BINUTILS_BLD = $(BUILD_DIR)/binutils-2.19
 
MINGW64_SRC = $(ARCHIVE_DIR)/mingw
MINGW64_BLD = $(BUILD_DIR)/mingw-w64
 
W64API_SRC = $(ARCHIVE_DIR)/mingw/mingw-w64-crt
W64API_BLD = $(BUILD_DIR)/mingw-w64-crt
 
MAKE = make -j3
GCC_CONFIGURE_OPTS = --with-sysroot=$(INSTALL_DIR) --with-gnu-ld --with-gnu-as
 
GCC_SRC = $(ARCHIVE_DIR)/gcc/gcc
GCC_BLD = $(BUILD_DIR)/gcc-4.4
 
GCC_LANGUAGES = c#,fortran,c++
 
export PATH:=$(INSTALL_DIR)/bin:$(PATH)
 
gdb_install: gdb_build $(GDB_BLD)/install.done
 
$(GDB_BLD)/install.done:
(cd $(GDB_BLD) && make install)
touch $@
 
gdb_build: gdb_configure $(GDB_BLD)/build.done
 
$(GDB_BLD)/build.done:
(cd $(GDB_BLD) && $(MAKE))
touch $@
 
gdb_configure: gcc_install $(GDB_BLD)/configure.done
 
$(GDB_BLD)/configure.done:
mkdir -p $(GDB_BLD)
(cd $(GDB_BLD) && $(GDB_SRC)/configure --prefix=$(INSTALL_DIR)/$(TARGET) \
--target=$(TARGET) --disable-werror)
touch $@
 
mpfr_install: mpfr_build $(MPFR_BLD)/install.done
 
$(MPFR_BLD)/install.done:
(cd $(MPFR_BLD) && make install)
touch $@
 
mpfr_build: mpfr_configure $(MPFR_BLD)/build.done
 
$(MPFR_BLD)/build.done:
(cd $(MPFR_BLD) && $(MAKE))
touch $@
 
mpfr_configure: gmp_install $(MPFR_BLD)/configure.done
 
$(MPFR_BLD)/configure.done:
mkdir -p $(MPFR_BLD)
(cd $(MPFR_BLD) && $(MPFR_SRC)/configure \
--prefix=$(INSTALL_DIR)/$(TARGET) \
--host=$(TARGET) --with-gmp=$(INSTALL_DIR)/$(TARGET))
touch $@
 
gmp_install: gmp_build $(GMP_BLD)/install.done
 
$(GMP_BLD)/install.done:
(cd $(GMP_BLD) && make install)
touch $@
 
gmp_build: gmp_configure $(GMP_BLD)/build.done
 
$(GMP_BLD)/build.done:
(cd $(GMP_BLD) && $(MAKE))
touch $@
 
gmp_configure: gcc_install $(GMP_BLD)/configure.done
 
$(GMP_BLD)/configure.done:
mkdir -p $(GMP_BLD)
(cd $(GMP_BLD) && $(GMP_SRC)/configure \
--prefix=$(INSTALL_DIR)/$(TARGET) \
--host=$(TARGET))
touch $@
 
gcc_install: gcc_build $(GCC_BLD)/install.done
 
$(GCC_BLD)/install.done:
(cd $(GCC_BLD) && make install)
touch $@
 
gcc_build: w64api_install $(GCC_BLD)/build.done
 
$(GCC_BLD)/build.done:
(cd $(GCC_BLD) && $(MAKE))
touch $@
 
w64api_install: w64api_build $(W64API_BLD)/install.done
 
$(W64API_BLD)/install.done:
(cd $(W64API_BLD) && make install)
touch $@
 
w64api_build: w64api_configure $(W64API_BLD)/build.done
 
$(W64API_BLD)/build.done:
(cd $(W64API_BLD) && $(MAKE))
touch $@
 
w64api_configure: gcc_bootstrap_install $(W64API_BLD)/configure.done
 
$(W64API_BLD)/configure.done:
mkdir -p $(W64API_BLD)
(cd $(W64API_BLD) && $(W64API_SRC)/configure \
--prefix=$(INSTALL_DIR) \
--host=$(TARGET))
touch $@
 
gcc_bootstrap_install: gcc_bootstrap_build $(GCC_BLD)/install.bootstrap.done
 
$(GCC_BLD)/install.bootstrap.done:
(cd $(GCC_BLD) && make install-gcc)
touch $@
 
gcc_bootstrap_build: gcc_bootstrap_configure $(GCC_BLD)/build.bootstrap.done
 
$(GCC_BLD)/build.bootstrap.done:
(cd $(GCC_BLD) && $(MAKE) all-gcc)
touch $@
 
gcc_bootstrap_configure: sysheader_install $(GCC_BLD)/configure.done
 
$(GCC_BLD)/configure.done:
mkdir -p $(GCC_BLD)
(cd $(GCC_BLD) && $(GCC_SRC)/configure \
--prefix=$(INSTALL_DIR) --target=$(TARGET) --enable-languages=$(GCC_LANGUAGES) \
$(GCC_CONFIGURE_OPTS))
touch $@
 
sysheader_install: binutils $(BUILD_DIR)/sys.done
 
$(BUILD_DIR)/sys.done:
mkdir -p $(INSTALL_DIR)/$(TARGET)/include
cp -r $(MINGW64_SRC)/mingw-w64-headers/include/* $(INSTALL_DIR)/$(TARGET)/include
ln -s $(INSTALL_DIR)/$(TARGET) $(INSTALL_DIR)/mingw
touch $@
 
binutils: binutils_install
 
binutils_install: binutils_build $(BINUTILS_BLD)/install.done
 
$(BINUTILS_BLD)/install.done:
(cd $(BINUTILS_BLD) && make install)
touch $@
 
binutils_build: binutils_configure $(BINUTILS_BLD)/build.done
 
$(BINUTILS_BLD)/build.done:
(cd $(BINUTILS_BLD) && $(MAKE))
touch $@
 
binutils_configure: $(BINUTILS_BLD)/configure.done
 
$(BINUTILS_BLD)/configure.done:
mkdir -p $(BINUTILS_BLD)
(cd $(BINUTILS_BLD) && $(BINUTILS_SRC)/configure \
--prefix=$(INSTALL_DIR) --target=$(TARGET) \
--with-sysroot=$(INSTALL_DIR)/$(TARGET))
touch $@
 
clean:
rm -rf $(BUILD_DIR)
rm -rf $(INSTALL_DIR)