summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2012-07-28 05:17:10 (EDT)
committer P. J. McDermott <pjm@nac.net>2012-07-28 05:17:10 (EDT)
commita28f2e4ccef454b74c9683e57d668741c7d8a3a4 (patch)
tree35de9d11c0df03a591f1be7e734eac8fdc15cf63 /build
parent19967dab63b2bf7ce2e92f649e2d0da8acfa94b4 (diff)
Support multiple targets per build.
Diffstat (limited to 'build')
-rw-r--r--build52
1 files changed, 33 insertions, 19 deletions
diff --git a/build b/build
index 6b8c8a4..ddf22c1 100644
--- a/build
+++ b/build
@@ -4,46 +4,60 @@ CFLAGS = -g -O2
configure: configure.stamp
configure.stamp:
- mkdir build
+ for target in $(PKG_TARGETS); do \
+ mkdir "build-$${target}"; \
+ done
# Generate the main makefile.
# Use shared BFD and opcodes libraries for all utilities.
# Don't enable multilib (multiarch is better).
# Enable plugins.
# Don't expect to find Gettext.
- cd build && \
- target_arch_gnu=$$(oh-getarchitecture -t gnu $(PKG_TARGET_ARCH)) && \
+ for target in $(PKG_TARGETS); do \
+ cd "build-$${target}" && \
+ target_arch_gnu=$$(oh-getarchitecture -t gnu "$${target}" && \
CFLAGS='$(CFLAGS)' ../src/configure \
- --prefix=/usr --with-sysroot=/ \
- --program-transform-name='s&^&$(PKG_TARGET_ARCH)-&' \
- --enable-shared --disable-multilib \
- --enable-plugins --disable-nls \
- --build=$(OH_BUILD_ARCH_GNU) --host=$(OH_HOST_ARCH_GNU) \
- --target=$${target_arch_gnu}
+ --prefix=/usr --with-sysroot=/ \
+ --program-transform-name="s&^&$${target}-&" \
+ --enable-shared --disable-multilib \
+ --enable-plugins --disable-nls \
+ --build=$(OH_BUILD_ARCH_GNU) --host=$(OH_HOST_ARCH_GNU) \
+ --target="$${target_arch_gnu}"; \
+ done
# Generate all the individual program makefiles.
- cd build && make configure-host
+ for target in $(PKG_TARGETS); do \
+ cd build && make configure-host; \
+ done
touch $@
build: build.stamp
build.stamp: configure
# Build BFD header files.
- cd build/bfd && make headers
+ for target in $(PKG_TARGETS); do \
+ cd "build-$${target}/bfd" && make headers; \
+ done
# Build ALL the things!
- cd build && make CFLAGS='$(CFLAGS)'
+ for target in $(PKG_TARGETS); do \
+ cd "build-$${target}" && make CFLAGS='$(CFLAGS)'; \
+ done
touch $@
install: install.stamp
install.stamp: build
# Install everything.
- cd build && \
- make CFLAGS='$(CFLAGS)' prefix="$${PWD}/../dest" install
+ for target in $(PKG_TARGETS); do \
+ cd build && \
+ make CFLAGS='$(CFLAGS)' prefix="$${PWD}/../dest" install; \
+ done
# Remove static library dependency metadata generated by libtool.
rm -f ../dest/usr/lib/*.la
# Make symbolic links to native utilities.
- if [ '$(OH_HOST_ARCH)' = '$(PKG_TARGET_ARCH)' ]; then \
- for util in ../dest/usr/bin/*; do \
- ln -sf "$(PKG_TARGET_ARCH)-$${util##*/}" "$${util}"; \
- done \
- fi
+ for target in $(PKG_TARGETS); do \
+ if [ '$(OH_HOST_ARCH)' = "$${target}" ]; then \
+ for util in "../dest/usr/bin/$${target}-"*; do \
+ ln -sf "$${util##*/}" "$${util%/*}/$${util##*/$${target}}"; \
+ done \
+ fi; \
+ done
touch $@
binary-arch: install