summaryrefslogtreecommitdiff
path: root/toolchain
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2014-08-15 16:07:44 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2014-08-15 16:08:18 +0200
commite7702be642eb91c48b6c596ab148b8a3a69db53a (patch)
treeac178ce469ab501252615d534bbcb63b60367196 /toolchain
parenta3875719fff2c2f74218a5d4f199328997167ad4 (diff)
move to toolchain dir
Diffstat (limited to 'toolchain')
-rw-r--r--toolchain/Makefile7
-rw-r--r--toolchain/elf2flt/Makefile41
-rw-r--r--toolchain/elf2flt/Makefile.inc8
3 files changed, 56 insertions, 0 deletions
diff --git a/toolchain/Makefile b/toolchain/Makefile
index 98130c07a..64cd8b1db 100644
--- a/toolchain/Makefile
+++ b/toolchain/Makefile
@@ -32,6 +32,9 @@ ifeq ($(ADK_TARGET_LIB_MUSL),y)
TARGETS+=musl
CLIB:=musl
endif
+ifeq ($(ADK_TARGET_BINFMT_FLAT),y)
+TARGETS+=elf2flt
+endif
DOWNLOAD:=kernel-headers-download $(patsubst %,%-download,$(TARGETS))
TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS))
@@ -48,7 +51,11 @@ $(CLIB)-prepare: gcc-prepare kernel-headers-prepare
gcc-configure: $(CLIB)-prepare
$(CLIB)-compile: gcc-configure
gcc-compile: $(CLIB)-install
+ifeq ($(ADK_TARGET_BINFMT_FLAT),y)
+$(CLIB)-fixup: gcc-install gdb-install elf2flt-install
+else
$(CLIB)-fixup: gcc-install gdb-install
+endif
%-download:
$(TRACE) toolchain/$(patsubst %-download,%,$@)/download
diff --git a/toolchain/elf2flt/Makefile b/toolchain/elf2flt/Makefile
new file mode 100644
index 000000000..72cb6f755
--- /dev/null
+++ b/toolchain/elf2flt/Makefile
@@ -0,0 +1,41 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(ADK_TOPDIR)/rules.mk
+include Makefile.inc
+include ../rules.mk
+include ${ADK_TOPDIR}/mk/buildhlp.mk
+
+BINUTILS_VERSION:= 2.24
+
+$(WRKBUILD)/.headers:
+$(WRKBUILD)/.configured:
+ (cd $(WRKBUILD); ./configure --prefix=$(STAGING_HOST_DIR)/usr \
+ --target=$(ADK_TARGET_ARCH) \
+ --with-bfd-include-dir=$(TOOLCHAIN_BUILD_DIR)/w-binutils-${BINUTILS_VERSION}-1/binutils-${BINUTILS_VERSION}/bfd \
+ --with-binutils-include-dir=$(TOOLCHAIN_BUILD_DIR)/w-binutils-${BINUTILS_VERSION}-1/binutils-${BINUTILS_VERSION}/include \
+ --with-libbfd=$(TOOLCHAIN_BUILD_DIR)/w-binutils-${BINUTILS_VERSION}-1/binutils-${BINUTILS_VERSION}/bfd/libbfd.a \
+ --with-libiberty=$(TOOLCHAIN_BUILD_DIR)/w-binutils-${BINUTILS_VERSION}-1/binutils-${BINUTILS_VERSION}/libiberty/libiberty.a )
+ touch $@
+
+$(WRKBUILD)/.compiled: $(WRKBUILD)/.configured
+ $(MAKE) -C $(WRKBUILD) all
+ touch $@
+
+$(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
+ ${INSTALL_BIN} ${WRKBUILD}/elf2flt ${TOOLCHAIN_DIR}/usr/$(GNU_TARGET_NAME)/bin
+ ${INSTALL_BIN} ${WRKBUILD}/flthdr ${TOOLCHAIN_DIR}/usr/$(GNU_TARGET_NAME)/bin
+ ${INSTALL_BIN} ${WRKBUILD}/ld-elf2flt ${TOOLCHAIN_DIR}/usr/$(GNU_TARGET_NAME)/bin
+ ${INSTALL_DATA} ${WRKBUILD}/elf2flt.ld ${TOOLCHAIN_DIR}/usr/$(GNU_TARGET_NAME)/lib
+ rm $(TOOLCHAIN_DIR)/usr/bin/$(GNU_TARGET_NAME)-ld
+ (cd ${TOOLCHAIN_DIR}/usr/$(GNU_TARGET_NAME)/bin && \
+ ln -sf ld.bfd ld.real )
+ (cd $(TOOLCHAIN_DIR)/usr/bin && \
+ ln -sf ../$(GNU_TARGET_NAME)/bin/elf2flt $(GNU_TARGET_NAME)-elf2flt && \
+ ln -sf ../$(GNU_TARGET_NAME)/bin/flthdr $(GNU_TARGET_NAME)-flthdr && \
+ ln -sf ../$(GNU_TARGET_NAME)/bin/ld-elf2flt $(GNU_TARGET_NAME)-ld-elf2flt && \
+ ln -sf ../$(GNU_TARGET_NAME)/bin/ld-elf2flt $(GNU_TARGET_NAME)-ld )
+ (cd $(TOOLCHAIN_DIR)/usr/bin/ && ln -sf $(GNU_TARGET_NAME)-ld.bfd $(GNU_TARGET_NAME)-ld.real )
+ touch $@
+
+include ${ADK_TOPDIR}/mk/toolchain.mk
diff --git a/toolchain/elf2flt/Makefile.inc b/toolchain/elf2flt/Makefile.inc
new file mode 100644
index 000000000..3a0f126dd
--- /dev/null
+++ b/toolchain/elf2flt/Makefile.inc
@@ -0,0 +1,8 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+PKG_NAME:= elf2flt
+PKG_VERSION:= 20140814
+PKG_RELEASE:= 1
+PKG_MD5SUM:= be5c918b90a591d3d4037580cda1764a
+PKG_SITES:= http://www.openadk.org/distfiles/