summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2013-04-22 13:34:30 (EDT)
committer P. J. McDermott <pjm@nac.net>2013-04-22 13:43:51 (EDT)
commitc2de406d0454a1f2475835e69ff31d0fb5e5ee58 (patch)
tree65115a656441763f39e9b2287f7be33bd69c0420
parentd469b558c4ffb7976767f803d59f8a5a859fad20 (diff)
build: Support multiple target architectures.
-rwxr-xr-xbuild16
1 files changed, 10 insertions, 6 deletions
diff --git a/build b/build
index 1988161..beba2eb 100755
--- a/build
+++ b/build
@@ -30,14 +30,16 @@ bootstrap1_opts = \
--disable-libmudflap \
--disable-libssp
-target = $(OPK_HOST_ARCH)
-builddir = gcc-build
-destdir = dest
+include ../targets.mk
+target = $$(printf '%s' '$@' | sed 's/^[a-z]*-//')
+builddir = obj-$(target)
+destdir = dest-$(target)
nop:
@:
-configure:
+configure: $(configure_targets)
+$(configure_targets):
if [ 'x$(OPK_HOST_PLAT)' = 'xbootstrap1' ]; then \
oh-autoconfigure -B "$(builddir)" -t "$(target)" -- \
$(bootstrap1_opts); \
@@ -47,7 +49,8 @@ configure:
fi
touch $@
-build: configure
+build: $(build_targets)
+$(build_targets): configure
libsubdir="/usr/lib/$(target)/gcc-$(base_version)" && \
oh-autobuild -B "$(builddir)" -T bootstrap-lean -- -j $${JOBS:-1} \
libsubdir="$${libsubdir}" \
@@ -58,7 +61,8 @@ build: configure
MULTIOSDIR=
touch $@
-install: build
+install: $(install_targets)
+$(install_targets): build
# The -T option is necessary because otherwise:
# * oh-autoinstall checks for an "install" target by running make with
# the -n option,