-
Notifications
You must be signed in to change notification settings - Fork 15
/
makefile.in
287 lines (276 loc) · 11.4 KB
/
makefile.in
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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
srcdir = @srcdir@
target = mips64
tooldir = $(exec_prefix)/$(target)
sysroot = $(tooldir)/n64-sysroot
export PATH := $(DESTDIR)$(bindir):$(PATH)
PROGS = ed64rdb gfxdis grc libgru libgs luapatch
ALLPROGS = $(foreach prog,$(PROGS),all-$(prog))
INSTALLPROGS = $(foreach prog,$(PROGS),install-$(prog))
INSTALLSTRIPPROGS = $(foreach prog,$(PROGS),install-strip-$(prog))
CLEANPROGS = $(foreach prog,$(PROGS),clean-$(prog))
DISTCLEANPROGS = $(foreach prog,$(PROGS),distclean-$(prog))
BINUTILS_VERSION = @BINUTILS_VERSION@
GCC_VERSION = @GCC_VERSION@
NEWLIB_VERSION = @NEWLIB_VERSION@
GDB_VERSION = @GDB_VERSION@
BINUTILS_URL = https://ftp.gnu.org/gnu/binutils/$(BINUTILS_VERSION).tar.gz
GCC_URL = https://ftp.gnu.org/gnu/gcc/$(GCC_VERSION)/$(GCC_VERSION).tar.gz
NEWLIB_URL = https://sourceware.org/pub/newlib/$(NEWLIB_VERSION).tar.gz
GDB_URL = https://ftp.gnu.org/gnu/gdb/$(GDB_VERSION).tar.gz
GCC_IN_TREE_DEPS = @GCC_IN_TREE_DEPS@
CONFIG_BINUTILS = @CONFIG_BINUTILS@
CONFIG_GCC = @CONFIG_GCC@
CONFIG_NEWLIB = @CONFIG_NEWLIB@
CONFIG_GDB = @CONFIG_GDB@
LDFLAGS = @LDFLAGS@
CFLAGS_FOR_TARGET = @CFLAGS_FOR_TARGET@
CXXFLAGS_FOR_TARGET = @CXXFLAGS_FOR_TARGET@
INSTALL = @INSTALL@
MKDIR_P = @MKDIR_P@
LN_S = @LN_S@
WGET = @WGET@
.PHONY : all install install-full install-full-nospc clean distclean quickclean
.PHONY : all-progs $(ALLPROGS) install-progs $(INSTALLPROGS) install-strip-progs $(INSTALLSTRIPPROGS) clean-progs $(CLEANPROGS) distclean-progs $(DISTCLEANPROGS)
.PHONY : binutils-nospc configure-binutils clean-binutils gcc-nospc configure-gcc clean-gcc newlib-nospc configure-newlib clean-newlib gdb-nospc configure-gdb clean-gdb
.PHONY : clean-local-exec uninstall-local-exec clean-sys uninstall-sys install-toolchain
.SECONDARY : binutils.tar.gz binutils build-binutils/config.status all-binutils install-binutils
.SECONDARY : gcc.tar.gz gcc build-gcc/config.status all-gcc-executables install-gcc-executables all-gcc install-gcc
.SECONDARY : newlib.tar.gz newlib build-newlib/config.status all-newlib install-newlib
.SECONDARY : gdb.tar.gz gdb build-gdb/config.status all-gdb install-gdb
all : all-progs
install : install-progs
install-strip : install-strip-progs
clean : clean-progs clean-binutils clean-gcc clean-newlib clean-gdb clean-local-exec clean-sys
distclean : distclean-progs distclean-binutils distclean-gcc distclean-newlib distclean-gdb distclean-local-exec distclean-sys
rm -f config.log config.status src/config.h makefile
quickclean : clean-progs quickclean-binutils quickclean-gcc quickclean-newlib quickclean-gdb clean-local-exec clean-sys
install-full :
$(MAKE) install-toolchain
$(MAKE) all-progs
$(MAKE) install-progs
$(MAKE) install-sys
install-full-nospc :
$(MAKE) binutils-nospc
$(MAKE) install-binutils
$(MAKE) clean-binutils
$(MAKE) gcc-nospc
$(MAKE) install-gcc-executables
$(MAKE) newlib-nospc
$(MAKE) install-newlib
$(MAKE) clean-newlib
$(MAKE) install-gcc
$(MAKE) clean-gcc
$(MAKE) gdb-nospc
$(MAKE) install-gdb
$(MAKE) clean-gdb
$(MAKE) all-progs
$(MAKE) install-progs
$(MAKE) clean-progs
$(MAKE) install-sys
all-progs : $(ALLPROGS)
$(ALLPROGS) :
cd src/$(patsubst all-%,%,$@) && $(MAKE) all
install-progs : $(INSTALLPROGS)
$(INSTALLPROGS) :
cd src/$(patsubst install-%,%,$@) && $(MAKE) install
install-strip-progs : $(INSTALLSTRIPPROGS)
$(INSTALLSTRIPPROGS) :
cd src/$(patsubst install-strip-%,%,$@) && $(MAKE) install-strip
clean-progs : $(CLEANPROGS)
$(CLEANPROGS) :
cd src/$(patsubst clean-%,%,$@) && $(MAKE) clean
distclean-progs : $(DISTCLEANPROGS)
$(DISTCLEANPROGS) :
cd src/$(patsubst distclean-%,%,$@) && $(MAKE) distclean
binutils.tar.gz :
$(WGET) binutils.tar.gz "$(BINUTILS_URL)"
binutils : | binutils.tar.gz
if test ! -d binutils; then mkdir binutils; fi
tar xfv binutils.tar.gz --strip-components=1 -C binutils
binutils-nospc :
if test ! -d binutils; then mkdir binutils; fi
$(WGET) - "$(BINUTILS_URL)" | tar xzv --strip-components=1 -C binutils
build-binutils/config.status : | binutils
if test ! -d build-binutils; then mkdir build-binutils; fi
cd build-binutils && ../binutils/configure \
--prefix="$(prefix)" \
--target=$(target) \
--with-sysroot="$(sysroot)" \
--disable-nls \
LDFLAGS="$(LDFLAGS)" \
CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
$(CONFIG_BINUTILS)
configure-binutils : build-binutils/config.status
all-binutils : | build-binutils/config.status
cd build-binutils && $(MAKE) all
touch $@
install-binutils : | all-binutils
cd build-binutils && $(MAKE) install
touch $@
clean-binutils :
rm -rf binutils.tar.gz binutils build-binutils all-binutils
distclean-binutils :
rm -f install-binutils
quickclean-binutils :
rm -rf build-binutils all-binutils
gcc.tar.gz :
$(WGET) gcc.tar.gz "$(GCC_URL)"
gcc : | gcc.tar.gz
if test ! -d gcc; then mkdir gcc; fi
tar xfv gcc.tar.gz --strip-components=1 -C gcc
if [ x"$(GCC_IN_TREE_DEPS)" = x"yes" ]; then \
cd gcc && ./contrib/download_prerequisites; \
fi
gcc-nospc :
if test ! -d gcc; then mkdir gcc; fi
$(WGET) - "$(GCC_URL)" | tar xzv --strip-components=1 -C gcc
if [ x"$(GCC_IN_TREE_DEPS)" = x"yes" ]; then \
cd gcc && ./contrib/download_prerequisites; \
fi
build-gcc/config.status : | gcc
if test ! -d build-gcc; then mkdir build-gcc; fi
cd build-gcc && ../gcc/configure \
--prefix="$(prefix)" \
--target=$(target) \
--with-gnu-as \
--with-gnu-ld \
--with-arch=vr4300 \
--with-abi=32 \
--with-newlib \
--with-sysroot="$(sysroot)" \
--with-native-system-header-dir="//usr/include" \
--enable-languages=c,c++,lto \
--enable-sjlj-exceptions \
--disable-multilib \
--disable-threads \
--disable-nls \
LDFLAGS="$(LDFLAGS)" \
CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
$(CONFIG_GCC)
configure-gcc : build-gcc/config.status
all-gcc-executables : | build-gcc/config.status
cd build-gcc && $(MAKE) all-gcc
touch $@
install-gcc-executables : | all-gcc-executables
cd build-gcc && $(MAKE) install-gcc
touch $@
all-gcc : | build-gcc/config.status install-binutils install-newlib
cd build-gcc && $(MAKE) all
touch $@
install-gcc : | all-gcc
cd build-gcc && $(MAKE) install
touch $@
clean-gcc :
rm -rf gcc.tar.gz gcc build-gcc all-gcc-executables all-gcc
distclean-gcc :
rm -f install-gcc-executables install-gcc
quickclean-gcc :
rm -rf build-gcc all-gcc-executables all-gcc
newlib.tar.gz :
$(WGET) newlib.tar.gz "$(NEWLIB_URL)"
newlib : | newlib.tar.gz
if test ! -d newlib; then mkdir newlib; fi
tar xfv newlib.tar.gz --strip-components=1 -C newlib
newlib-nospc :
if test ! -d newlib; then mkdir newlib; fi
$(WGET) - "$(NEWLIB_URL)" | tar xzv --strip-components=1 -C newlib
build-newlib/config.status : | newlib install-binutils install-gcc-executables
if test ! -d build-newlib; then mkdir build-newlib; fi
cd build-newlib && ../newlib/configure \
--prefix="$(prefix)" \
--target=$(target) \
--with-newlib \
--enable-newlib-global-atexit \
--disable-newlib-fvwrite-in-streamio \
--disable-newlib-wide-orient \
--disable-newlib-unbuf-stream-opt \
--disable-newlib-supplied-syscalls \
--enable-lite-exit \
LDFLAGS="$(LDFLAGS)" \
CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET) -fpermissive" \
CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET) -fpermissive" \
$(CONFIG_NEWLIB)
configure-newlib : build-newlib/config.status
all-newlib : | build-newlib/config.status install-binutils install-gcc-executables
cd build-newlib && $(MAKE) all
touch $@
install-newlib : | all-newlib
cd build-newlib && $(MAKE) install
touch $@
clean-newlib :
rm -rf newlib.tar.gz newlib build-newlib all-newlib
distclean-newlib :
rm -f install-newlib
quickclean-newlib :
rm -rf build-newlib all-newlib
gdb.tar.gz :
$(WGET) gdb.tar.gz "$(GDB_URL)"
gdb : | gdb.tar.gz
if test ! -d gdb; then mkdir gdb; fi
tar xfv gdb.tar.gz --strip-components=1 -C gdb
gdb-nospc :
if test ! -d gdb; then mkdir gdb; fi
$(WGET) - "$(GDB_URL)" | tar xzv --strip-components=1 -C gdb
build-gdb/config.status : | gdb
if test ! -d build-gdb; then mkdir build-gdb; fi
cd build-gdb && ../gdb/configure \
--prefix="$(prefix)" \
--target=$(target) \
--with-sysroot="$(sysroot)" \
--disable-nls \
LDFLAGS="$(LDFLAGS)" \
CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
$(CONFIG_GDB)
configure-gdb : build-gdb/config.status
all-gdb : | build-gdb/config.status
cd build-gdb && $(MAKE) all
touch $@
install-gdb : | all-gdb
cd build-gdb && $(MAKE) install
touch $@
clean-gdb :
rm -rf gdb.tar.gz gdb build-gdb all-gdb
distclean-gdb :
rm -f install-gdb
quickclean-gdb :
rm -rf build-gdb all-gdb
install-local-exec :
$(MKDIR_P) "$(DESTDIR)$(tooldir)/bin"
for f in "$(DESTDIR)$(bindir)/"*; do \
if test -f "$$f"; then \
f="$${f##*/}"; \
(cd "$(DESTDIR)$(tooldir)/bin" && rm -f "$${f##$(target)-}" && $(LN_S) -f "$(bindir)/$$f" "$${f##$(target)-}"); \
fi \
done
touch $@
clean-local-exec :
distclean-local-exec :
rm -f install-local-exec
uninstall-local-exec :
for f in "$(DESTDIR)$(bindir)/"*; do \
if test -f "$$f"; then \
f="$${f##*/}"; \
(cd "$(DESTDIR)$(tooldir)/bin" && rm -f "$${f##$(target)-}"); \
fi \
done
-rm -df "$(DESTDIR)$(tooldir)/bin"
rm -f install-local-exec
install-sys :
$(MKDIR_P) "$(DESTDIR)$(sysroot)/usr"
cp -R -p "$(srcdir)/include" "$(srcdir)/lib" "$(DESTDIR)$(sysroot)/usr"
touch $@
clean-sys :
distclean-sys :
rm -f install-sys
uninstall-sys :
(cd "$(srcdir)/include" && find . -depth -exec rm -df "$(DESTDIR)$(sysroot)/usr/include/"\{\} \;)
(cd "$(srcdir)/lib" && find . -depth -exec rm -df "$(DESTDIR)$(sysroot)/usr/lib/"\{\} \;)
-rm -df "$(DESTDIR)$(sysroot)/usr"
rm -f install-sys
install-toolchain : install-binutils install-gcc install-newlib install-gdb