diff options
author | P. J. McDermott <pjm@nac.net> | 2012-11-08 01:36:25 (EST) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2012-11-08 01:36:25 (EST) |
commit | 9f4e5b4aca897841e42001af85e59fb109f9de3e (patch) | |
tree | 78f42d27799ab4bd028acd7a1c7895163b618a60 /build | |
parent | c65074611db7a7f1a404e9d98ff289a073af537e (diff) |
Update build.
* Use new features of opkhelper; don't use obsolete oh-* utilities.
* Clean up code according to best practices and SPF 2.0
recommendations.
* Read target architectures from generated configuration file.
* Add a "clean" target for convenience.
The "install" target has yet to be updated.
Diffstat (limited to 'build')
-rwxr-xr-x | build | 62 |
1 files changed, 28 insertions, 34 deletions
@@ -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 |