summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
Diffstat (limited to 'build')
-rwxr-xr-xbuild62
1 files changed, 28 insertions, 34 deletions
diff --git a/build b/build
index c734e1e..1326229 100755
--- a/build
+++ b/build
@@ -2,46 +2,44 @@
CFLAGS = -g -O2
-configure.stamp:
- for target in $(PKG_TARGETS); do \
- mkdir -p "build-$${target}"; \
- done
+configure:
# 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.
- 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=/ \
+ for target in $$(cat ../targets); do \
+ CFLAGS='$(CFLAGS)' oh-autoconfigure \
+ -B "build-$${target}" -t "$${target}" -- \
+ $$([ -n "$${OPK_SYSROOT}" ] && \
+ printf "--with-sysroot='%s'" "$${OPK_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}" \
- --with-pkgversion='GNU Binutils for embedded distro' && \
- cd ..; \
+ --with-pkgversion='GNU Binutils for ProteanOS' || \
+ exit 1; \
done
# Generate all the individual program makefiles.
- for target in $(PKG_TARGETS); do \
- cd "build-$${target}" && make configure-host && cd ..; \
+ for target in $$(cat ../targets); do \
+ oh-autobuild -B "build-$${target}" -T configure-host || \
+ exit 1; \
done
touch $@
-build.stamp: configure.stamp
+build: configure
# Build BFD header files.
- for target in $(PKG_TARGETS); do \
- cd "build-$${target}/bfd" && make headers && cd ../..; \
+ for target in $$(cat ../targets); do \
+ oh-autobuild -B "build-$${target}/bfd" -T headers || \
+ exit 1; \
done
# Build ALL the things!
- for target in $(PKG_TARGETS); do \
- cd "build-$${target}" && make CFLAGS='$(CFLAGS)' && cd ..; \
+ for target in $$(cat ../targets); do \
+ oh-autobuild -B "build-$${target}" CFLAGS='$(CFLAGS)' || \
+ exit 1; \
done
touch $@
-install.stamp: build.stamp
+install: build
# Install everything.
for target in $(PKG_TARGETS); do \
cd "build-$${target}" && \
@@ -97,19 +95,15 @@ install.stamp: build.stamp
echo "/usr/lib/$(OH_HOST_ARCH)/$${target}" \
>>"dest/etc/ld.so.conf.d/bdf-$${target}"; \
done
- touch $@
-
-binary-arch: install.stamp
+ # Post-process and install everything.
oh-strip
oh-installfiles
- oh-installdocs binutils
- oh-gencontrol
- oh-buildopk
-
-binary-indep: install.stamp
- oh-installfiles
- oh-installdocs binutils
- oh-gencontrol
- oh-buildopk
+ touch $@
-binary: binary-arch binary-indep
+clean:
+ for target in $$(cat ../targets); do \
+ oh-autoclean -B "build-$${target}" || \
+ exit 1; \
+ done
+ rm -f configure build
+ rm -Rf *.data