diff options
-rw-r--r-- | mk/build.mk | 5 | ||||
-rw-r--r-- | mk/vars.mk | 14 | ||||
-rwxr-xr-x | scripts/create-menu | 2 | ||||
-rw-r--r-- | target/Makefile | 12 | ||||
-rw-r--r-- | target/config/Config.in.libc | 12 | ||||
-rw-r--r-- | target/config/Config.in.os | 22 | ||||
-rw-r--r-- | target/rtems/Config.in | 0 | ||||
-rw-r--r-- | target/rtems/Makefile | 33 | ||||
-rw-r--r-- | target/rtems/arch.lst | 14 | ||||
-rw-r--r-- | toolchain/gcc/Makefile | 11 |
10 files changed, 104 insertions, 21 deletions
diff --git a/mk/build.mk b/mk/build.mk index 671335799..a1dd6dd82 100644 --- a/mk/build.mk +++ b/mk/build.mk @@ -179,11 +179,14 @@ else ifeq ($(ADK_TARGET_OS_BAREMETAL),y) $(MAKE) -f mk/build.mk package/hostcompile toolchain/final endif +ifeq ($(ADK_TARGET_OS_RTEMS),y) + $(MAKE) -f mk/build.mk package/hostcompile toolchain/final target/compile target/install target/targethelp +endif ifeq ($(ADK_TARGET_OS_FROSTED),y) $(MAKE) -f mk/build.mk package/hostcompile toolchain/final target/config-prepare target/compile target/install target/targethelp endif ifeq ($(ADK_TARGET_OS_ZEPHYR),y) - $(MAKE) -f mk/build.mk package/hostcompile toolchain/final target/config-prepare target/compile target/install target/targethelp + $(MAKE) -f mk/build.mk package/hostcompile toolchain/final target/compile target/install target/targethelp endif ifeq ($(ADK_TARGET_OS_LINUX),y) $(MAKE) -f mk/build.mk package/hostcompile toolchain/final target/config-prepare target/compile package_clean package/compile root_clean package/install target/install package_index diff --git a/mk/vars.mk b/mk/vars.mk index ad0e56206..09031dcf8 100644 --- a/mk/vars.mk +++ b/mk/vars.mk @@ -82,13 +82,19 @@ else GNU_TARGET_NAME:= $(ADK_TARGET_CPU_ARCH)-abiv2-$(ADK_TARGET_LINUXTYPE) endif endif -ifeq ($(ADK_TARGET_LIB_NEWLIB),y) -ifeq ($(ADK_TARGET_OS_FROSTED),y) -GNU_TARGET_NAME:= $(ADK_TARGET_CPU_ARCH)-frosted-$(ADK_TARGET_SUFFIX) -else +ifeq ($(ADK_TARGET_OS_BAREMETAL),y) GNU_TARGET_NAME:= $(ADK_TARGET_CPU_ARCH)-$(ADK_TARGET_SUFFIX) endif +ifeq ($(ADK_TARGET_OS_FROSTED),y) +GNU_TARGET_NAME:= $(ADK_TARGET_CPU_ARCH)-$(ADK_TARGET_OS)-$(ADK_TARGET_SUFFIX) +endif +ifeq ($(ADK_TARGET_OS_RTEMS),y) +GNU_TARGET_NAME:= $(ADK_TARGET_CPU_ARCH)-$(ADK_TARGET_OS) +endif +ifeq ($(ADK_TARGET_OS_ZEPHYR),y) +GNU_TARGET_NAME:= $(ADK_TARGET_CPU_ARCH)-$(ADK_TARGET_OS) endif + TARGET_CROSS:= $(TOOLCHAIN_DIR)/usr/bin/$(GNU_TARGET_NAME)- TARGET_COMPILER_PREFIX?=${TARGET_CROSS} CONFIGURE_TRIPLE:= --build=${GNU_HOST_NAME} \ diff --git a/scripts/create-menu b/scripts/create-menu index f4b7184b5..7ba854c8a 100755 --- a/scripts/create-menu +++ b/scripts/create-menu @@ -98,7 +98,7 @@ config ADK_TARGET_CHOOSE_ARCH bool "choose architecture" EOD -for os in linux frosted zephyr baremetal; do +for os in linux frosted rtems zephyr baremetal; do for arch in $(cat $topdir/target/$os/arch.lst);do OS=$(echo $os | tr '[:lower:]' '[:upper:]') ARCH=$(echo $arch | tr '[:lower:]' '[:upper:]') diff --git a/target/Makefile b/target/Makefile index 9882e4d84..b95be18b5 100644 --- a/target/Makefile +++ b/target/Makefile @@ -140,11 +140,6 @@ config-prepare: $(ADK_TOPDIR)/.config >$(BUILD_DIR)/.frostedapps endif -ifeq ($(ADK_TARGET_OS_ZEPHYR),y) -config-prepare: $(ADK_TOPDIR)/.config - echo foo -endif - ifeq ($(ADK_TARGET_OS_FROSTED),y) prepare: frosted-prepare compile: frosted-compile @@ -152,6 +147,13 @@ install: frosted-install targethelp: frosted-targethelp endif +ifeq ($(ADK_TARGET_OS_RTEMS),y) +prepare: rtems-prepare +compile: rtems-compile +install: rtems-install +targethelp: rtems-targethelp +endif + ifeq ($(ADK_TARGET_OS_ZEPHYR),y) prepare: zephyr-prepare compile: zephyr-compile diff --git a/target/config/Config.in.libc b/target/config/Config.in.libc index ebf477bbb..14a49955e 100644 --- a/target/config/Config.in.libc +++ b/target/config/Config.in.libc @@ -130,6 +130,7 @@ config ADK_TARGET_LIB_NEWLIB ADK_TARGET_ARCH_XTENSA) && \ (ADK_TARGET_OS_BAREMETAL || \ ADK_TARGET_OS_FROSTED || \ + ADK_TARGET_OS_RTEMS || \ ADK_TARGET_OS_ZEPHYR ) help https://sourceware.org/newlib/ @@ -176,7 +177,8 @@ config ADK_TARGET_LIB_NEWLIB_2_5_0 depends on ADK_TARGET_LIB_NEWLIB \ && !ADK_TARGET_ARCH_RISCV \ && !ADK_TARGET_ARCH_XTENSA \ - && !ADK_TARGET_OS_FROSTED + && !ADK_TARGET_OS_FROSTED \ + && !ADK_TARGET_OS_RTEMS config ADK_TARGET_LIB_NEWLIB_RISCV bool "2.4.0-riscv" @@ -198,18 +200,18 @@ endchoice choice prompt "Threading" +depends on ADK_TARGET_LIB_UCLIBC_NG config ADK_TARGET_WITH_NPTL bool "enable NPTL" - depends on ADK_TARGET_SUPPORTS_NPTL && ADK_TARGET_SUPPORTS_THREADS && !ADK_TARGET_LIB_NEWLIB + depends on ADK_TARGET_SUPPORTS_NPTL && ADK_TARGET_SUPPORTS_THREADS config ADK_TARGET_WITH_LT bool "enable Linuxthreads" - depends on ADK_TARGET_SUPPORTS_LT && ADK_TARGET_SUPPORTS_THREADS && ADK_TARGET_LIB_UCLIBC_NG + depends on ADK_TARGET_SUPPORTS_LT && ADK_TARGET_SUPPORTS_THREADS config ADK_TARGET_WITHOUT_THREADS bool "disable threads" - depends on ADK_TARGET_LIB_UCLIBC_NG || ADK_TARGET_LIB_NEWLIB endchoice @@ -278,4 +280,4 @@ config ADK_TARGET_SUFFIX default "muslfdpic" if ADK_TARGET_LIB_MUSL && ADK_TARGET_BINFMT_FDPIC default "musl" if ADK_TARGET_LIB_MUSL default "eabi" if ADK_TARGET_LIB_NEWLIB && ADK_TARGET_ARCH_ARM - default "elf" if ADK_TARGET_LIB_NEWLIB + default "elf" if ADK_TARGET_LIB_NEWLIB && ADK_TARGET_OS_BAREMETAL diff --git a/target/config/Config.in.os b/target/config/Config.in.os index 6d77dfa4b..7fff1d521 100644 --- a/target/config/Config.in.os +++ b/target/config/Config.in.os @@ -9,6 +9,16 @@ config ADK_TARGET_OS_LINUX help Create a Linux system or toolchain. +config ADK_TARGET_OS_BAREMETAL + bool "Bare metal" + help + Create a bare metal appliance or toolchain. + +config ADK_TARGET_OS_RTEMS + bool "RTEMS" + help + Create a RTEMS appliance or toolchain. + config ADK_TARGET_OS_FROSTED bool "Frosted" help @@ -19,9 +29,11 @@ config ADK_TARGET_OS_ZEPHYR help Create a zephyr appliance or toolchain. -config ADK_TARGET_OS_BAREMETAL - bool "Bare metal" - help - Create a bare metal appliance or toolchain. - endchoice + +config ADK_TARGET_OS + string + default "linux" if ADK_TARGET_OS_LINUX + default "frosted" if ADK_TARGET_OS_FROSTED + default "rtems5.0.0" if ADK_TARGET_OS_RTEMS + default "zephyr" if ADK_TARGET_OS_ZEPHYR diff --git a/target/rtems/Config.in b/target/rtems/Config.in new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/target/rtems/Config.in diff --git a/target/rtems/Makefile b/target/rtems/Makefile new file mode 100644 index 000000000..b33391269 --- /dev/null +++ b/target/rtems/Makefile @@ -0,0 +1,33 @@ +# 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 + +prepare: + if [ ! -d $(BUILD_DIR)/rtems ]; then \ + cd $(BUILD_DIR) ;\ + git clone git://git.rtems.org/rtems.git ;\ + fi + if [ ! -f $(BUILD_DIR)/rtems/configure ]; then \ + cd $(BUILD_DIR)/rtems && ./bootstrap ;\ + fi + -mkdir $(BUILD_DIR)/rtems-build + cd $(BUILD_DIR)/rtems-build && \ + PATH='$(TARGET_PATH)' $(BUILD_DIR)/rtems/configure \ + --prefix=$(BUILD_DIR)/rtems-install + --target=$(ADK_TARGET_CPU_ARCH)-$(ADK_TARGET_OS) \ + --enable-tests=samples \ + +compile: + PATH='$(TARGET_PATH)' $(MAKE) -C \ + $(BUILD_DIR)/rtems-build + +install: + -mkdir $(BUILD_DIR)/rtems-install + PATH='$(TARGET_PATH)' $(MAKE) -C \ + $(BUILD_DIR)/rtems-build install + +clean: + +targethelp: + diff --git a/target/rtems/arch.lst b/target/rtems/arch.lst new file mode 100644 index 000000000..fbc2ed8bf --- /dev/null +++ b/target/rtems/arch.lst @@ -0,0 +1,14 @@ +arm +bfin +lm32 +m68k +mips +nios2 +or1k +ppc +riscv +sh +sparc +sparc64 +x86 +x86_64 diff --git a/toolchain/gcc/Makefile b/toolchain/gcc/Makefile index aefc945a8..1857cf0cb 100644 --- a/toolchain/gcc/Makefile +++ b/toolchain/gcc/Makefile @@ -56,6 +56,8 @@ GCC_CONFOPTS:= --prefix=$(TOOLCHAIN_DIR)/usr \ --disable-werror \ --disable-nls +ifeq ($(ADK_TARGET_OS_LINUX),y) +ifeq ($(ADK_TARGET_LIB_UCLIBC_NG),y) ifeq ($(ADK_TARGET_WITH_NPTL),y) GCC_FINAL_CONFOPTS:= --enable-tls --enable-threads --enable-libatomic GCC_TLS_CONFOPTS:= --enable-tls @@ -68,6 +70,15 @@ ifeq ($(ADK_TARGET_LIB_WITHOUT_THREADS)$(ADK_TARGET_WITHOUT_THREADS),y) GCC_FINAL_CONFOPTS:= --disable-tls --disable-threads --disable-libatomic GCC_TLS_CONFOPTS:= --disable-tls endif +else +GCC_FINAL_CONFOPTS:= --enable-tls --enable-threads --enable-libatomic +GCC_TLS_CONFOPTS:= --enable-tls +endif +endif + +ifeq ($(ADK_TARGET_OS_RTEMS),y) +GCC_FINAL_CONFOPTS:= --enable-libatomic +endif ifeq ($(ADK_TARGET_LIB_NEWLIB),y) GCC_FINAL_CONFOPTS+= --with-newlib |