summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbuild18
1 files changed, 10 insertions, 8 deletions
diff --git a/build b/build
index ddf22c1..32c412a 100755
--- a/build
+++ b/build
@@ -5,7 +5,7 @@ CFLAGS = -g -O2
configure: configure.stamp
configure.stamp:
for target in $(PKG_TARGETS); do \
- mkdir "build-$${target}"; \
+ mkdir -p "build-$${target}"; \
done
# Generate the main makefile.
# Use shared BFD and opcodes libraries for all utilities.
@@ -14,18 +14,19 @@ configure.stamp:
# Don't expect to find Gettext.
for target in $(PKG_TARGETS); do \
cd "build-$${target}" && \
- target_arch_gnu=$$(oh-getarchitecture -t gnu "$${target}" && \
+ target_arch_gnu=$$(oh-getarchitecture -t gnu "$${target}") && \
CFLAGS='$(CFLAGS)' ../src/configure \
--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}"; \
+ --target="$${target_arch_gnu}" && \
+ cd ..; \
done
# Generate all the individual program makefiles.
for target in $(PKG_TARGETS); do \
- cd build && make configure-host; \
+ cd "build-$${target}" && make configure-host && cd ..; \
done
touch $@
@@ -33,11 +34,11 @@ build: build.stamp
build.stamp: configure
# Build BFD header files.
for target in $(PKG_TARGETS); do \
- cd "build-$${target}/bfd" && make headers; \
+ cd "build-$${target}/bfd" && make headers && cd ../..; \
done
# Build ALL the things!
for target in $(PKG_TARGETS); do \
- cd "build-$${target}" && make CFLAGS='$(CFLAGS)'; \
+ cd "build-$${target}" && make CFLAGS='$(CFLAGS)' && cd ..; \
done
touch $@
@@ -45,8 +46,9 @@ install: install.stamp
install.stamp: build
# Install everything.
for target in $(PKG_TARGETS); do \
- cd build && \
- make CFLAGS='$(CFLAGS)' prefix="$${PWD}/../dest" install; \
+ cd "build-$${target}" && \
+ make CFLAGS='$(CFLAGS)' prefix="$${PWD}/../dest/usr" install && \
+ cd ..; \
done
# Remove static library dependency metadata generated by libtool.
rm -f ../dest/usr/lib/*.la