Build libbfd for host seperately and install in <toolchain root>/lib.
[android/toolchain/build.git] / Makefile.in
1 # -------------------------------
2 # Standard Autoconf-set variables
3 # -------------------------------
4 VPATH=@srcdir@
5
6 build_alias=@build_alias@
7 build_vendor=@build_vendor@
8 build_os=@build_os@
9 build=@build@
10 host_alias=@host_alias@
11 host_vendor=@host_vendor@
12 host_os=@host_os@
13 host=@host@
14 target_alias=@target_alias@
15 target_vendor=@target_vendor@
16 target_os=@target_os@
17 target_cpu=@target_cpu@
18 target=@target@
19
20 program_transform_name = @program_transform_name@
21
22 prefix = @prefix@
23 exec_prefix = @exec_prefix@
24
25 srcdir = @srcdir@
26 abs_srcdir = @abs_srcdir@
27
28 bindir = @bindir@
29 sbindir = @sbindir@
30 libexecdir = @libexecdir@
31 datadir = @datadir@
32 sysconfdir = @sysconfdir@
33 sharedstatedir = @sharedstatedir@
34 localstatedir = @localstatedir@
35 libdir = @libdir@
36 includedir = @includedir@
37 oldincludedir = @oldincludedir@
38 infodir = @infodir@
39 datarootdir = @datarootdir@
40 docdir = @docdir@
41 pdfdir = @pdfdir@
42 htmldir = @htmldir@
43 mandir = @mandir@
44
45 builddir = @builddir@
46 abs_builddir = @abs_builddir@
47 #
48 # miscellaneous variables
49 #
50 TOPLEVEL_CONFIGURE_ARGUMENTS:=@TOPLEVEL_CONFIGURE_ARGUMENTS@
51 baseargs = @baseargs@
52 GCC_MIN_VERSION_4_3_0:=@GCC_MIN_VERSION_4_3_0@
53 GCC_MIN_VERSION_4_5_0:=@GCC_MIN_VERSION_4_5_0@
54 PACKAGE_TO_SRCDIR:=@package_to_srcdir@
55 BUILD_ANDROID_GCC:=@BUILD_ANDROID_GCC@
56 GDB_TARGET:=@GDB_TARGET@
57
58 # We need to figure out how to get to top level source directory from
59 # a package build directory. 
60 # For host modules, accept cache file option, or specification as blank.
61
62
63 BINUTILS_VERSION=binutils-@BINUTILS_VERSION@
64 GOLD_VERSION=binutils-@GOLD_VERSION@
65 GCC_VERSION=gcc-@GCC_VERSION@
66 NEWLIB_VERSION=newlib-@NEWLIB_VERSION@
67 GMP_VERSION=gmp-@GMP_VERSION@
68 MPFR_VERSION=mpfr-@MPFR_VERSION@
69 MPC_VERSION=mpc-@MPC_VERSION@
70 GDB_VERSION=gdb-@GDB_VERSION@
71 STAMP=touch
72
73 TARGET_BINUTILS_BUILDDIR=$(abs_builddir)/$(BINUTILS_VERSION)
74 TARGET_GCC_BUILDDIR=$(abs_builddir)/$(GCC_VERSION)
75 TEMP_INSTALLDIR=$(abs_builddir)/temp-install
76
77 # Figure out where to find the ld binary.
78 FIND_TARGET_LD=\
79         `[ -d $(TARGET_BINUTILS_BUILDDIR)/gold ] && echo "gold" || echo "ld"`
80
81 # We export these insteading when configuring target gcc and newlib
82 TARGET_BINUTILS_EXPORTS= \
83 export  AS_FOR_TARGET=$(TARGET_BINUTILS_BUILDDIR)/gas/as-new \
84         LD_FOR_TARGET=$(TARGET_BINUTILS_BUILDDIR)/$(FIND_TARGET_LD)/ld-new \
85         AR_FOR_TARGET=$(TARGET_BINUTILS_BUILDDIR)/binutils/ar \
86         NM_FOR_TARGET=$(TARGET_BINUTILS_BUILDDIR)/binutils/nm-new \
87         STRIP_FOR_TARGET=$(TARGET_BINUTILS_BUILDDIR)/binutils/strip-new \
88         RANLIB_FOR_TARGET=$(TARGET_BINUTILS_BUILDDIR)/binutils/ranlib \
89         OBJDUMP_FOR_TARGET=$(TARGET_BINUTILS_BUILDDIR)/binutils/objdump
90
91 TARGET_MINIMAL_GCC_EXPORTS= \
92 export  CC_FOR_TARGET="$(TARGET_GCC_BUILDDIR)/gcc/xgcc \
93                       -B $(TARGET_GCC_BUILDDIR)/gcc \
94                       -isystem $(TARGET_GCC_BUILDDIR)/gcc/include-fixed \
95                       -isystem $(TARGET_GCC_BUILDDIR)/gcc/include"
96 #
97 # We need -Os as the overrides below interfere with --enable-target-optspace.
98 # We also need -mandroid for for target libraries to pass linking test
99 # in configuration.
100
101 # To build libstdc++ with RTTI and exceptions do:
102 #
103 #export CFLAGS_FOR_TARGET=-fexceptions
104 #export CXXFLAGS_FOR_TARGET=-frtti
105 #
106 CFLAGS_FOR_TARGET+= -O2 -Os -g
107 CXXFLAGS_FOR_TARGET+=$(CFLAGS_FOR_TARGET)
108 LDFLAGS_FOR_TARGET=
109
110 # Helper
111 prefix-list = $(foreach e, $(2), $(join $1, $e))
112
113 # find source directory for package. This can either be <srcdir>/<package>
114 # or <objdir>/temp-src/<package>
115
116 find-package-srcdir = $(shell \
117   if [ -f $(srcdir)/../$(firstword $(subst -, ,$1))/$(strip $1)/configure ]; then \
118      echo $(PACKAGE_TO_SRCDIR)/../$(firstword $(subst -, ,$1))/$(strip $1); \
119   elif [ -f $(abs_builddir)/temp-src/$(strip $1)/configure ]; then \
120     echo $(abs_builddir)/temp-src/$(strip $1) ; \
121   else \
122     echo 'error cannot find $(strip $1)' ; \
123   fi)
124
125 # Set effective <build>, <host> and <target>.
126
127 ifneq ($(build_alias),)
128 cur_build := $(build_alias)
129 else
130 cur_build := $(build)
131 endif
132
133 ifneq ($(host_alias),)
134 cur_host := $(host_alias)
135 else
136 cur_host := $(host)
137 endif
138
139 ifneq ($(target_alias),)
140 cur_target := $(target_alias)
141 else
142 cur_target := $(target)
143 endif
144
145 # Define environment variables for canadian cross build.
146 ifneq ($(cur_host),$(cur_build))
147 canadian_build_env := \
148         export CC_FOR_BUILD=$(cur_build)-gcc ; \
149         export CC=$(cur_build)-gcc ; \
150         export CXX=$(cur_build)-g++ ;
151
152 CANADIAN_ROOT := $(PWD)/host-${cur_build}
153 canadian_env := \
154         export CC_FOR_BUILD=$(cur_build)-gcc ; \
155         export CC=$(cur_host)-gcc ; \
156         export CXX=$(cur_host)-g++ ; \
157         export AR=$(cur_host)-ar ; \
158         export RANLIB=$(cur_host)-ranlib ; \
159         export PATH="$(CANADIAN_ROOT)/install/bin:${PATH}" ;
160 endif
161
162 #
163 # Make rules
164 #
165
166 .PHONY: all clean
167
168 all: build
169
170 # top level
171 build: build-target-binutils build-host-libbfd build-target-gcc \
172         build-target-gdb
173
174 install: install-target-binutils install-host-libbfd install-target-gcc \
175         install-target-gdb
176
177 # To support canadian cross build we need to build build->target toolchain
178 # as well as final host->target toolchain.
179 ifneq ($(cur_host),$(cur_build))
180 .PHONY: config-canadian-tools build-canadian-tools install-canadian-tools
181
182 config-canadian-tools: stmp-config-canadian-tools
183 stmp-config-canadian-tools:
184         ([ -d $(CANADIAN_ROOT) ] || \
185           mkdir $(CANADIAN_ROOT)) && \
186         ($(canadian_build_env) \
187          cd $(CANADIAN_ROOT) && \
188          $(abs_srcdir)/configure $(baseargs) --build=$(cur_build) \
189                 --host=$(cur_build) --target=$(cur_target)) && \
190         $(STAMP) $@
191
192 build-canadian-tools: stmp-build-canadian-tools
193 stmp-build-canadian-tools: stmp-config-canadian-tools
194         ($(canadian_build_env) \
195          cd $(CANADIAN_ROOT) && \
196          $(MAKE)) && \
197         $(STAMP) $@
198
199 install-canadian-tools: stmp-install-canadian-tools
200 stmp-install-canadian-tools: stmp-build-canadian-tools
201         ($(canadian_build_env) \
202          cd $(CANADIAN_ROOT) && \
203          $(MAKE) install prefix=$(CANADIAN_ROOT)/install) && \
204         $(STAMP) $@
205
206 # When building canadian cross toolchain we cannot build GCC target libraries.
207 # So we build the compilers only and copy the target libaries from
208 # $(CANADIAN_ROOT)/install/ installation.
209 gcc_build_target := all-gcc
210 gcc_install_target := install-gcc
211 install-target-gcc-multilibs: stmp-install-canadian-tools
212         mkdir -p $(prefix)/lib/gcc/
213         rsync -a $(CANADIAN_ROOT)/install/lib/gcc/ $(prefix)/lib/gcc/
214 install-target-gcc-multilibs := install-target-gcc-multilibs
215
216 # We add canadian_stmp dependency to rules that have no dependencies
217 # on other modules.  This is to ensure that simple cross toolchain is built
218 # before canadian cross toolchain.
219 canadian_stmp := stmp-install-canadian-tools
220 else
221 gcc_build_target :=
222 gcc_install_target := install
223 install-target-gcc-multilibs :=
224 canadian_stmp :=
225 endif
226
227 ifneq ($(BINUTILS_VERSION), $(GOLD_VERSION))
228 build: build-target-gold
229 install: install-target-gold
230 endif
231
232 # target binutils rules
233 .PHONY: config-target-binutils build-target-binutils install-target-binutils
234 config-target-binutils: stmp-config-target-binutils
235 # We do not want to enable shared libraries in binutils
236 BINUTILS_CONFIG_ARGS=--prefix=$(prefix) \
237         --target=${cur_target} --host=${cur_host} --build=${cur_build} \
238         $(baseargs) --disable-shared
239 stmp-config-target-binutils: config.status $(canadian_stmp)
240         ([ -d ${BINUTILS_VERSION} ] || \
241           mkdir ${BINUTILS_VERSION}) && \
242         ($(canadian_env) \
243          cd ${BINUTILS_VERSION} ; \
244          $(call find-package-srcdir, ${BINUTILS_VERSION})/configure \
245           $(BINUTILS_CONFIG_ARGS)) && \
246         $(STAMP) $@
247 build-target-binutils: stmp-build-target-binutils
248 stmp-build-target-binutils: stmp-config-target-binutils
249         ($(canadian_env) \
250          $(MAKE) -C ${BINUTILS_VERSION}) && $(STAMP) $@
251 install-target-binutils: stmp-build-target-binutils
252         ($(canadian_env) \
253          $(MAKE) -C ${BINUTILS_VERSION} install)
254
255 # target gold rules.  We need these only if BINUTILS_VERSION != GOLD_VERSION
256 ifneq ($(BINUTILS_VERSION), $(GOLD_VERSION))
257 .PHONY: config-target-gold build-target-gold install-target-gold
258 config-target-gold: stmp-config-target-gold
259 # We do not want to enable shared libraries in gold
260 GOLD_CONFIG_ARGS=--prefix=$(prefix) \
261         --target=${target_alias} --host=${host} --build=${build} \
262         $(baseargs) --disable-shared
263 stmp-config-target-gold: config.status
264         ([ -d ${GOLD_VERSION} ] || \
265           mkdir ${GOLD_VERSION}) && \
266         (cd ${GOLD_VERSION} ; \
267          $(call find-package-srcdir, ${GOLD_VERSION})/configure \
268           $(GOLD_CONFIG_ARGS)) && \
269         $(STAMP) $@
270 build-target-gold: stmp-build-target-gold
271 stmp-build-target-gold: stmp-config-target-gold
272         ($(canadian_env) \
273      $(MAKE) -C ${GOLD_VERSION} && $(STAMP) $@)
274
275 # If we use a different binutils version of gold, we build gold twice.  We
276 # first build everything, including gold with the main binutils version and
277 # then install it.  Then we build the gold-only binutils version and install
278 # just gold.  We don't bother to skip building the first gold to simplify
279 # handling of all combinations of --enable-gold[=*]
280
281 install-target-gold: stmp-build-target-gold install-target-binutils
282         ($(canadian_env) \
283      make -C $(GOLD_VERSION)/gold install)
284
285 endif
286
287 # build libbfd for host.  We configure with all targets, so this is built
288 # separately from the same source.
289 .PHONY: config-host-libbfd build-host-libbfd install-host-libbfd
290 config-host-libbfd: stmp-config-host-libbfd
291 LIBBFD_CONFIG_ARGS=--prefix=$(prefix) \
292         --enable-targets=all --host=${host} --build=${build} \
293         $(baseargs) --disable-shared --enable-install-libbfd
294 stmp-config-host-libbfd: config.status
295         ([ -d libbfd-${BINUTILS_VERSION} ] || \
296           mkdir libbfd-${BINUTILS_VERSION}) && \
297         (cd libbfd-${BINUTILS_VERSION} ; \
298          $(call find-package-srcdir, ${BINUTILS_VERSION})/configure \
299           $(LIBBFD_CONFIG_ARGS)) && \
300         $(STAMP) $@
301 build-host-libbfd: stmp-build-host-libbfd
302 stmp-build-host-libbfd: stmp-config-host-libbfd
303         $(MAKE) -C libbfd-${BINUTILS_VERSION} all-bfd && $(STAMP) $@
304 install-host-libbfd: stmp-build-host-libbfd install-target-binutils
305         $(MAKE) -C libbfd-${BINUTILS_VERSION} install-bfd
306
307 # target gcc rules
308 .PHONY: config-target-gcc build-target-gcc install-target-gcc
309 .PHONY: install-target-gcc-gcc $(install-target-gcc-multilibs)
310 config-target-gcc: stmp-config-target-gcc
311
312 GCC_CONFIG_ARGS=--prefix=$(prefix) \
313           --target=${cur_target} --host=${cur_host} --build=${cur_build} \
314           --with-gnu-as --with-gnu-ld --enable-languages=c,c++
315
316 # For gcc versions 4.3.0 and later, gmp and mpfr are required.
317 # Also build libgcc is a seperate sub-target in 4.3.0+.
318 ifeq ($(GCC_MIN_VERSION_4_3_0),yes)
319 stmp-config-target-gcc: stmp-install-host-gmp stmp-install-host-mpfr
320 GCC_CONFIG_ARGS += --with-gmp=$(TEMP_INSTALLDIR) --with-mpfr=$(TEMP_INSTALLDIR)
321 endif
322
323 # For gcc versions 4.5.0 and higher, mpc is required.
324 ifeq ($(GCC_MIN_VERSION_4_5_0),yes)
325 stmp-config-target-gcc: stmp-install-host-mpc
326 GCC_CONFIG_ARGS += --with-mpc=$(TEMP_INSTALLDIR)
327 endif
328
329 # Add Android specific gcc options.
330 # FIXME: These should be overridable by configure options.
331
332
333 # Target indenpendent Android gcc options.
334 ifeq ($(BUILD_ANDROID_GCC),yes)
335 GCC_CONFIG_ARGS += $(GCC_CONFIG_LIBSTDCXX_V3) --disable-libssp \
336         --enable-threads --disable-nls --disable-libmudflap --disable-libgomp \
337         --disable-libstdc__-v3 --disable-sjlj-exceptions --disable-shared \
338         --disable-tls
339 CFLAGS_FOR_TARGET += -DTARGET_POSIX_IO -fno-short-enums
340 # ARM specific options.
341 ifeq ($(target_cpu),arm)
342 GCC_CONFIG_ARGS += --with-float=soft --with-fpu=vfp --with-arch=armv5te \
343         --enable-target-optspace
344 ifneq ($(target_os),linux-androideabi)
345 GCC_CONFIG_ARGS += --with-abi=aapcs
346 endif
347 endif
348
349 endif
350
351 # We add the baseargs and the end so that they override any default args
352 GCC_CONFIG_ARGS += $(baseargs)
353
354 # We have to add -mandroid in target CFLAGS and CXXFLAGS
355 stmp-config-target-gcc: config.status stmp-build-target-binutils
356         ([ -d ${GCC_VERSION} ] || \
357           mkdir ${GCC_VERSION}) && \
358         ($(canadian_env) \
359          cd ${GCC_VERSION} ; \
360          $(TARGET_BINUTILS_EXPORTS) ; \
361          export CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" ; \
362          export CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" ; \
363          export LDFLAGS_FOR_TARGET="$(LDFLAGS_FOR_TARGET)" ; \
364          $(call find-package-srcdir, ${GCC_VERSION})/configure \
365            $(GCC_CONFIG_ARGS)) && \
366         $(STAMP) $@
367 build-target-gcc: stmp-build-target-gcc
368 stmp-build-target-gcc: stmp-config-target-gcc
369         ($(canadian_env) \
370          $(MAKE) -C ${GCC_VERSION} \
371                 CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
372                 CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
373                 LDFLAGS_FOR_TARGET="$(LDFLAGS_FOR_TARGET)" \
374                 $(gcc_build_target)) \
375         && $(STAMP) $@
376 install-target-gcc-gcc: stmp-build-target-gcc
377         ($(canadian_env) \
378          $(MAKE) -C ${GCC_VERSION} $(gcc_install_target))
379 install-target-gcc: install-target-gcc-gcc $(install-target-gcc-multilibs)
380
381 # minimal gcc rules
382 # minimal gcc only builds the C and C++ compilers and libgcc
383 # We use the full gcc configure rules.
384 .PHONY: build-target-minimal-gcc install-target-minimal-gcc
385 ifeq ("$(GCC_MIN_VERSION_4_3_0)","yes")
386 MINIMAL_GCC_BUILD_TARGETS:= gcc target-libgcc 
387 else
388 MINIMAL_GCC_BUILD_TARGETS:= gcc
389 endif
390
391 build-target-minimal-gcc: stmp-build-target-minimal-gcc
392 stmp-build-target-minimal-gcc: stmp-config-target-gcc
393         ($(canadian_env) \
394          $(MAKE) -C ${GCC_VERSION} \
395                 $(call prefix-list, all-, $(MINIMAL_GCC_BUILD_TARGETS))) && \
396         $(STAMP) $@
397 install-target-minimal-gcc: stmp-build-target-minimal-gcc
398         ($(canadian_env) \
399          $(MAKE) -C ${GCC_VERSION} \
400                 $(call prefix-list, install-, $(MINIMAL_GCC_BUILD_TARGETS)))
401
402 # target newlib rules
403 .PHONY: config-target-newlib build-target-newlib install-target-newlib
404 config-target-newlib: stmp-config-target-newlib
405 NEWLIB_CONFIG_ARGS=$(baseargs) --prefix=$(prefix) \
406           --target=${cur_target} --host=${cur_host} --build=${cur_build}
407
408 stmp-config-target-newlib: stmp-build-target-binutils \
409                            stmp-build-target-minimal-gcc
410         ([ -d ${NEWLIB_VERSION} ] || \
411           mkdir ${NEWLIB_VERSION}) && \
412         ($(canadian_env) \
413          cd ${NEWLIB_VERSION} ; \
414          $(TARGET_BINUTILS_EXPORTS) ; \
415          $(TARGET_MINIMAL_GCC_EXPORTS) ; \
416          $(call find-package-srcdir, ${NEWLIB_VERSION})/configure \
417           $(NEWLIB_CONFIG_ARGS)) && \
418         $(STAMP) $@
419 stmp-build-target-newlib: stmp-config-target-newlib
420         ($(canadian_env) \
421          $(MAKE) -C ${NEWLIB_VERSION}) && $(STAMP) $@
422 install-target-newlib: stmp-build-target-newlib
423         ($(canadian_env) \
424          $(MAKE) -C ${NEWLIB_VERSION} install)
425
426 # host gmp rules
427 .PHONY: config-host-gmp build-host-gmp install-host-gmp
428 config-host-gmp: stmp-config-host-gmp
429 GMP_CONFIG_ARGS=$(baseargs) --prefix=$(TEMP_INSTALLDIR) --disable-shared \
430           --host=${cur_host} --build=${cur_build}
431 stmp-config-host-gmp: config.status $(canadian_stmp)
432         ([ -d ${GMP_VERSION} ] || \
433           mkdir ${GMP_VERSION}) && \
434         ($(canadian_env) \
435          cd ${GMP_VERSION} ; \
436          $(call find-package-srcdir, ${GMP_VERSION})/configure \
437           $(GMP_CONFIG_ARGS)) && \
438         $(STAMP) $@
439 stmp-build-host-gmp: stmp-config-host-gmp
440         ($(canadian_env) \
441          $(MAKE) -C ${GMP_VERSION}) && $(STAMP) $@
442 build-host-gmp: stmp-build-host-gmp
443 # Need -j1 to avoid a race condition in building on OS X.
444 stmp-install-host-gmp: stmp-build-host-gmp
445         ($(canadian_env) \
446          $(MAKE) -C ${GMP_VERSION} install -j1) && \
447         $(STAMP) $@
448 install-host-gmp: stmp-install-host-gmp
449
450 # host mpfr rules
451 .PHONY: config-host-mpfr build-host-mpfr install-host-mpfr
452 config-host-mpfr: stmp-config-host-mpfr
453 MPFR_CONFIG_ARGS=$(baseargs) --prefix=$(TEMP_INSTALLDIR) --disable-shared \
454           --host=${cur_host} --build=${cur_build} \
455           --with-gmp=$(TEMP_INSTALLDIR)
456 stmp-config-host-mpfr: config.status stmp-install-host-gmp
457         ([ -d ${MPFR_VERSION} ] || \
458           mkdir ${MPFR_VERSION}) && \
459         ($(canadian_env) \
460          cd ${MPFR_VERSION} ; \
461          $(call find-package-srcdir, ${MPFR_VERSION})/configure \
462           $(MPFR_CONFIG_ARGS)) && \
463         $(STAMP) $@
464 stmp-build-host-mpfr: stmp-config-host-mpfr
465         ($(canadian_env) \
466          $(MAKE) -C ${MPFR_VERSION}) && $(STAMP) $@
467 build-host-mpfr: stmp-build-host-mpfr
468 stmp-install-host-mpfr: stmp-build-host-mpfr
469         ($(canadian_env) \
470          $(MAKE) -C ${MPFR_VERSION} install) && \
471         $(STAMP) $@
472 install-host-mpfr: stmp-install-host-mpfr
473
474 # host mpc rules
475 .PHONY: config-host-mpc build-host-mpc install-host-mpc
476 config-host-mpc: stmp-config-host-mpc
477 MPC_CONFIG_ARGS=$(baseargs) --prefix=$(TEMP_INSTALLDIR) --disable-shared \
478          --host=${cur_host} --build=${cur_build} \
479          --with-gmp=$(TEMP_INSTALLDIR) --with-mpfr=$(TEMP_INSTALLDIR)
480 stmp-config-host-mpc: config.status stmp-install-host-gmp stmp-install-host-mpfr
481         ([ -d ${MPC_VERSION} ] || \
482           mkdir ${MPC_VERSION}) && \
483         ($(canadian_env) \
484          cd ${MPC_VERSION} ; \
485          $(call find-package-srcdir, ${MPC_VERSION})/configure \
486           $(MPC_CONFIG_ARGS)) && \
487         $(STAMP) $@
488 stmp-build-host-mpc: stmp-config-host-mpc
489         ($(canadian_env) \
490          $(MAKE) -C ${MPC_VERSION}) && $(STAMP) $@
491 build-host-mpc: stmp-build-host-mpc
492 stmp-install-host-mpc: stmp-build-host-mpc
493         ($(canadian_env) \
494          $(MAKE) -C ${MPC_VERSION} install) && \
495         $(STAMP) $@
496 install-host-mpc: stmp-install-host-mpc
497
498 # target gdb rules
499 .PHONY: config-target-gdb build-target-gdb install-target-gdb
500 config-target-gdb: stmp-config-target-gdb
501
502 GDB_CONFIG_ARGS=$(baseargs) --prefix=$(prefix) \
503         --target=$(GDB_TARGET) --host=${cur_host} --build=${cur_build} \
504         --disable-nls
505
506 stmp-config-target-gdb: config.status $(canadian_stmp)
507         ([ -d ${GDB_VERSION} ] || \
508           mkdir ${GDB_VERSION}) && \
509         ($(canadian_env) \
510          cd ${GDB_VERSION} ; \
511          $(call find-package-srcdir, ${GDB_VERSION})/configure \
512           $(GDB_CONFIG_ARGS)) && \
513         $(STAMP) $@
514 build-target-gdb: stmp-build-target-gdb
515 stmp-build-target-gdb: stmp-config-target-gdb
516         ($(canadian_env) \
517          $(MAKE) -C ${GDB_VERSION}) && $(STAMP) $@
518 install-target-gdb: stmp-build-target-gdb
519         ($(canadian_env) \
520          $(MAKE) -C ${GDB_VERSION} install)
521
522 # clean rules
523 .PHONY: clean
524 clean:
525         $(RM) -r $(TEMP_INSTALLDIR) stmp-build-* stmp-install-* && \
526         for sub in [ * ]; do \
527           if [ -f $$sub/Makefile ]; then \
528             $(MAKE) -C $$sub clean ; \
529           fi; \
530         done
531
532 .PHONY: distclean
533 distclean:
534         @$(RM) -r config.log config.status \
535                   $(TEMP_INSTALLDIR) temp-src \
536                   stmp-config-* stmp-build-* stmp-install-* && \
537         for sub in [ * ]; do \
538           if [ -f $$sub/config.status ]; then \
539             echo "Deleting " $$sub "..." && $(RM) -r $$sub ; \
540           fi; \
541         done
542         @$(RM) Makefile