summaryrefslogtreecommitdiffstats
path: root/build.in
diff options
context:
space:
mode:
Diffstat (limited to 'build.in')
-rw-r--r--build.in58
1 files changed, 58 insertions, 0 deletions
diff --git a/build.in b/build.in
new file mode 100644
index 0000000..31a1260
--- /dev/null
+++ b/build.in
@@ -0,0 +1,58 @@
+#! /usr/bin/make -f
+
+PKG_TARGET_ARCH = @PKG_TARGET_ARCH@
+PKG_TARGET_ARCH_GNU = @PKG_TARGET_ARCH_GNU@
+
+CFLAGS = -g -O2
+
+configure: configure.stamp
+configure.stamp:
+ mkdir build
+ # 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 && \
+ 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=$(PKG_TARGET_ARCH_GNU)
+ # Generate all the individual program makefiles.
+ cd build && make configure-host
+ touch $@
+
+build: build.stamp
+build.stamp: configure
+ # Build BFD header files.
+ cd build/bfd && make headers
+ # Build ALL the things!
+ cd build && make CFLAGS='$(CFLAGS)'
+ touch $@
+
+install: install.stamp
+install.stamp: build
+ # Install everything.
+ cd build && \
+ make CFLAGS='$(CFLAGS)' prefix="$${PWD}/../dest" install
+ # Remove static library dependency metadata generated by libtool.
+ rm -f ../dest/usr/lib/*.la
+ touch $@
+
+binary-arch: install
+ oh-strip
+ oh-installfiles
+ oh-installdocs binutils
+ oh-gencontrol
+ oh-buildopk
+
+binary-indep: install
+ oh-installfiles
+ oh-installdocs binutils
+ oh-gencontrol
+ oh-buildopk
+
+binary: binary-arch binary-indep