diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-07-19 13:09:43 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-09-14 07:11:32 +0200 |
commit | f3f0370f1054f4e49aa8f5ea70485d673e8e94b6 (patch) | |
tree | 11d44920353aea9bf4301eb267f8c831e622520e | |
parent | 9f096f47243ab19db617ec990188dbef71166e41 (diff) | |
download | rtems-f3f0370f1054f4e49aa8f5ea70485d673e8e94b6.tar.bz2 |
build: Alternative build system based on waf
Update #3818.
Diffstat (limited to '')
2071 files changed, 65911 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore index e4836e446e..d7ca74b338 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,13 @@ aclocal.m4 autom4te.cache -configure +/build config.h.in -Makefile.in +configure doc +.lock* +Makefile.in +*.pyc +/testsuites/build/bin/fake-rtems5-g++ +/testsuites/build/build +/testsuites/build/wscript +.waf* diff --git a/bsps/arm/csb337/start/linkcmds.kit637_v6 b/bsps/arm/csb337/start/linkcmds.kit637_v6 new file mode 100644 index 0000000000..91a34b7229 --- /dev/null +++ b/bsps/arm/csb337/start/linkcmds.kit637_v6 @@ -0,0 +1,27 @@ +MEMORY { + SDRAM : ORIGIN = 0x20100000, LENGTH = 63M - 16k + SDRAM_MMU : ORIGIN = 0x23ffc000, LENGTH = 16k + SRAM : ORIGIN = 0x00200000, LENGTH = 16k +} + +REGION_ALIAS ("REGION_START", SDRAM); +REGION_ALIAS ("REGION_VECTOR", SRAM); +REGION_ALIAS ("REGION_TEXT", SDRAM); +REGION_ALIAS ("REGION_TEXT_LOAD", SDRAM); +REGION_ALIAS ("REGION_RODATA", SDRAM); +REGION_ALIAS ("REGION_RODATA_LOAD", SDRAM); +REGION_ALIAS ("REGION_DATA", SDRAM); +REGION_ALIAS ("REGION_DATA_LOAD", SDRAM); +REGION_ALIAS ("REGION_FAST_TEXT", SDRAM); +REGION_ALIAS ("REGION_FAST_TEXT_LOAD", SDRAM); +REGION_ALIAS ("REGION_FAST_DATA", SDRAM); +REGION_ALIAS ("REGION_FAST_DATA_LOAD", SDRAM); +REGION_ALIAS ("REGION_BSS", SDRAM); +REGION_ALIAS ("REGION_WORK", SDRAM); +REGION_ALIAS ("REGION_STACK", SDRAM); +REGION_ALIAS ("REGION_NOCACHE", SDRAM); +REGION_ALIAS ("REGION_NOCACHE_LOAD", SDRAM); + +_ttbl_base = ORIGIN (SDRAM_MMU); + +INCLUDE linkcmds.armv4 diff --git a/gccdeps.py b/gccdeps.py new file mode 100644 index 0000000000..1fc9373489 --- /dev/null +++ b/gccdeps.py @@ -0,0 +1,238 @@ +#!/usr/bin/env python +# encoding: utf-8 +# Thomas Nagy, 2008-2010 (ita) + +""" +Execute the tasks with gcc -MD, read the dependencies from the .d file +and prepare the dependency calculation for the next run. +This affects the cxx class, so make sure to load Qt5 after this tool. + +Usage:: + + def options(opt): + opt.load('compiler_cxx') + def configure(conf): + conf.load('compiler_cxx gccdeps') +""" + +import os, re, threading +from waflib import Task, Logs, Utils, Errors +from waflib.Tools import c_preproc +from waflib.TaskGen import before_method, feature + +lock = threading.Lock() + +gccdeps_flags = ['-MD'] +if not c_preproc.go_absolute: + gccdeps_flags = ['-MMD'] + +# Third-party tools are allowed to add extra names in here with append() +supported_compilers = ['gas', 'gcc', 'icc', 'clang'] + +def scan(self): + if not self.__class__.__name__ in self.env.ENABLE_GCCDEPS: + return super(self.derived_gccdeps, self).scan() + nodes = self.generator.bld.node_deps.get(self.uid(), []) + names = [] + return (nodes, names) + +re_o = re.compile(r"\.o$") +re_splitter = re.compile(r'(?<!\\)\s+') # split by space, except when spaces are escaped + +def remove_makefile_rule_lhs(line): + # Splitting on a plain colon would accidentally match inside a + # Windows absolute-path filename, so we must search for a colon + # followed by whitespace to find the divider between LHS and RHS + # of the Makefile rule. + rulesep = ': ' + + sep_idx = line.find(rulesep) + if sep_idx >= 0: + return line[sep_idx + 2:] + else: + return line + +def path_to_node(base_node, path, cached_nodes): + # Take the base node and the path and return a node + # Results are cached because searching the node tree is expensive + # The following code is executed by threads, it is not safe, so a lock is needed... + if getattr(path, '__hash__'): + node_lookup_key = (base_node, path) + else: + # Not hashable, assume it is a list and join into a string + node_lookup_key = (base_node, os.path.sep.join(path)) + try: + lock.acquire() + node = cached_nodes[node_lookup_key] + except KeyError: + node = base_node.find_resource(path) + cached_nodes[node_lookup_key] = node + finally: + lock.release() + return node + +def post_run(self): + if not self.__class__.__name__ in self.env.ENABLE_GCCDEPS: + return super(self.derived_gccdeps, self).post_run() + + name = self.outputs[0].abspath() + name = re_o.sub('.d', name) + try: + txt = Utils.readf(name) + except EnvironmentError: + Logs.error('Could not find a .d dependency file, are cflags/cxxflags overwritten?') + raise + #os.remove(name) + + # Compilers have the choice to either output the file's dependencies + # as one large Makefile rule: + # + # /path/to/file.o: /path/to/dep1.h \ + # /path/to/dep2.h \ + # /path/to/dep3.h \ + # ... + # + # or as many individual rules: + # + # /path/to/file.o: /path/to/dep1.h + # /path/to/file.o: /path/to/dep2.h + # /path/to/file.o: /path/to/dep3.h + # ... + # + # So the first step is to sanitize the input by stripping out the left- + # hand side of all these lines. After that, whatever remains are the + # implicit dependencies of task.outputs[0] + txt = '\n'.join([remove_makefile_rule_lhs(line) for line in txt.splitlines()]) + + # Now join all the lines together + txt = txt.replace('\\\n', '') + + val = txt.strip() + val = [x.replace('\\ ', ' ') for x in re_splitter.split(val) if x] + + nodes = [] + bld = self.generator.bld + + # Dynamically bind to the cache + try: + cached_nodes = bld.cached_nodes + except AttributeError: + cached_nodes = bld.cached_nodes = {} + + for x in val: + + node = None + if os.path.isabs(x): + node = path_to_node(bld.root, x, cached_nodes) + else: + # TODO waf 1.9 - single cwd value + path = getattr(bld, 'cwdx', bld.bldnode) + # when calling find_resource, make sure the path does not contain '..' + x = [k for k in Utils.split_path(x) if k and k != '.'] + while '..' in x: + idx = x.index('..') + if idx == 0: + x = x[1:] + path = path.parent + else: + del x[idx] + del x[idx-1] + + node = path_to_node(path, x, cached_nodes) + + if not node: + raise ValueError('could not find %r for %r' % (x, self)) + if id(node) == id(self.inputs[0]): + # ignore the source file, it is already in the dependencies + # this way, successful config tests may be retrieved from the cache + continue + nodes.append(node) + + Logs.debug('deps: gccdeps for %s returned %s', self, nodes) + + bld.node_deps[self.uid()] = nodes + bld.raw_deps[self.uid()] = [] + + try: + del self.cache_sig + except AttributeError: + pass + + Task.Task.post_run(self) + +def sig_implicit_deps(self): + if not self.__class__.__name__ in self.env.ENABLE_GCCDEPS: + return super(self.derived_gccdeps, self).sig_implicit_deps() + bld = self.generator.bld + + try: + return self.compute_sig_implicit_deps() + except Errors.TaskNotReady: + raise ValueError("Please specify the build order precisely with gccdeps (asm/c/c++ tasks)") + except EnvironmentError: + # If a file is renamed, assume the dependencies are stale and must be recalculated + for x in bld.node_deps.get(self.uid(), []): + if not x.is_bld() and not x.exists(): + try: + del x.parent.children[x.name] + except KeyError: + pass + + key = self.uid() + bld.node_deps[key] = [] + bld.raw_deps[key] = [] + return Utils.SIG_NIL + +def wrap_compiled_task(classname): + derived_class = type(classname, (Task.classes[classname],), {}) + derived_class.derived_gccdeps = derived_class + derived_class.post_run = post_run + derived_class.scan = scan + derived_class.sig_implicit_deps = sig_implicit_deps + +for k in ('asm', 'c', 'cxx'): + if k in Task.classes: + wrap_compiled_task(k) + +@before_method('process_source') +@feature('force_gccdeps') +def force_gccdeps(self): + self.env.ENABLE_GCCDEPS = ['asm', 'c', 'cxx'] + +def configure(conf): + # in case someone provides a --enable-gccdeps command-line option + if not getattr(conf.options, 'enable_gccdeps', True): + return + + global gccdeps_flags + flags = conf.env.GCCDEPS_FLAGS or gccdeps_flags + if conf.env.ASM_NAME in supported_compilers: + try: + conf.check(fragment='', features='asm force_gccdeps', asflags=flags, compile_filename='test.S', msg='Checking for asm flags %r' % ''.join(flags)) + except Errors.ConfigurationError: + pass + else: + conf.env.append_value('ASFLAGS', flags) + conf.env.append_unique('ENABLE_GCCDEPS', 'asm') + + if conf.env.CC_NAME in supported_compilers: + try: + conf.check(fragment='int main() { return 0; }', features='c force_gccdeps', cflags=flags, msg='Checking for c flags %r' % ''.join(flags)) + except Errors.ConfigurationError: + pass + else: + conf.env.append_value('CFLAGS', flags) + conf.env.append_unique('ENABLE_GCCDEPS', 'c') + + if conf.env.CXX_NAME in supported_compilers: + try: + conf.check(fragment='int main() { return 0; }', features='cxx force_gccdeps', cxxflags=flags, msg='Checking for cxx flags %r' % ''.join(flags)) + except Errors.ConfigurationError: + pass + else: + conf.env.append_value('CXXFLAGS', flags) + conf.env.append_unique('ENABLE_GCCDEPS', 'cxx') + +def options(opt): + raise ValueError('Do not load gccdeps options') + diff --git a/long_gcc.py b/long_gcc.py new file mode 100644 index 0000000000..20ca2a7f77 --- /dev/null +++ b/long_gcc.py @@ -0,0 +1,45 @@ +#! /usr/bin/env python +# encoding: utf-8 + +""" +def build(bld): + bld.load('long_gcc') +""" + +import os, tempfile +from waflib import Task + +def exec_command(self, cmd, **kw): + # workaround for command line length limit: + # http://support.microsoft.com/kb/830473 + tmp = None + try: + if not isinstance(cmd, str) and len(str(cmd)) > 8192: + (fd, tmp) = tempfile.mkstemp(dir=self.generator.bld.bldnode.abspath()) + flat = ['"%s"' % x.replace('\\', '\\\\').replace('"', '\\"') for x in cmd[1:]] + try: + os.write(fd, ' '.join(flat).encode()) + finally: + if tmp: + os.close(fd) + # Line may be very long: + # Logs.debug('runner:' + ' '.join(flat)) + cmd = [cmd[0], '@' + tmp] + ret = super(self.__class__, self).exec_command(cmd, **kw) + finally: + if tmp: + os.remove(tmp) + return ret + +def wrap_class(class_name): + cls = Task.classes.get(class_name) + if not cls: + return None + derived_class = type(class_name, (cls,), {}) + derived_class.exec_command = exec_command + if hasattr(cls, 'hcode'): + derived_class.hcode = cls.hcode + return derived_class + +for k in 'c cxx cprogram cxxprogram cshlib cxxshlib cstlib cxxstlib'.split(): + wrap_class(k) diff --git a/make/README b/make/README new file mode 100644 index 0000000000..f3491c2577 --- /dev/null +++ b/make/README @@ -0,0 +1,465 @@ + make/README + + This file describes the layout and conventions of the application + makefile support for RTEMS applications. Internally, RTEMS uses + GNU-style autoconf/automake Makefiles as much as possible to + ease integration with other GNU tools. + + All of these "make" trees are substantially similar; however this + file documents the current state of the RTEMS Application Makefile + support. + + This make tree is based on a build system originally developed + to simplify porting projects between various OS's. The primary + goals were: + + . simple *and* customizable individual makefiles + + . use widely available GNU make. There is no pre-processing or + automatic generation of Makefiles. + + . Same makefiles work on *many* host OS's due to portability + of GNU make and the host OS config files. + + . Support for different compilers and operating systems + on a per-user basis. Using the same sources (including + Makefiles) one developer can develop and test under SVR4, + another under 4.x, another under HPUX. + + . Builtin support for compiling "variants" such as debug + versions. These variants can be built + recursively. + + . Control of system dependencies. "hidden" dependencies on + environment variables (such as PATH) + have been removed whenever possible. No matter what your + PATH variable is set to, you should get the same thing + when you 'make' as everyone else on the project. + + This Makefile system has evolved into its present form and as it + exists in RTEMS today, its sole goal is to build RTEMS applications. + The use of these Makefiles hides the complexity of producing + executables for a wide variety of embedded CPU families and target + BSPs. Switching between RTEMS BSPs is accomplished via setting + the environment variable "RTEMS_MAKEFILE_PATH." + + This description attempts to cover all aspects of the Makefile tree. Most + of what is described here is maintained automatically by the configuration + files. + + The example makefiles in make/Templates should be used as a starting + point for new directories. + + There are 2 main types of Makefile: + + directory and leaf. + + Directory Makefiles + ------------------- + + A Makefile in a source directory with sub-directories is called a + "directory" Makefile. + + Directory Makefile's are simply responsible for acting as "middle-men" + and recursing into their sub-directories and propagating the make. + + For example, directory src/bin will contain only a Makefile and + sub-directories. No actual source code will reside in the directory. + The following commands: + + $ cd src/bin + $ make all + + would descend into all the subdirectories of 'src/bin' and recursively + perform a 'make all'. + + A 'make debug' will recurse thru sub-directories as a debug build. + + A template directory Makefile which should work in almost all + cases is in make/Templates/Makefile.dir + + + Leaf Makefiles + -------------- + + Source directories that contain source code for libraries or + programs use a "leaf" Makefile. + + These makefiles contain the rules necessary to build programs + (or libraries). + + A template leaf Makefile is in Templates/Makefile.leaf . A template + leaf Makefile for building libraries is in Templates/Makefile.lib . + + + NOTE: To simplify nested makefile's and source maintenance, we disallow + combining source and directories (that make(1) would be expected to + recurse into) in one source directory. Ie., a directory in the source + tree may contain EITHER source files OR recursive sub directories, but NOT + both. This assumption is generally shared with GNU automake. + + Variants (where objects go) + --------------------------- + + All binary targets are placed in a sub-directory whose name is (for + example): + + o-optimize/ -- optimized binaries + o-debug/ -- debug binaries + + Using the template Makefiles, this will all happen automatically. + The contents of these directories are specific to a BSP. + + Within a Makefile, the ${ARCH} variable is set to o-optimize, + o-debug, etc., as appropriate. + + HISTORICAL NOTE: Prior to version 4.5, the name of the sub-directory + in which objects were placed included the BSP name. + + Typing 'make' will place objects in o-optimize. + 'make debug' will place objects in o-debug. + + The debug targets are equivalent to 'all' except that + CFLAGS and/or LDFLAGS are modified as per the compiler config file for + debug and profile support. + + The targets debug etc., can be invoked recursively at + the directory make level. So from the top of a tree, one could + install a debug version of everything under that point by: + + $ cd src/lib + $ gmake debug + $ gmake install + + When building a command that is linked with a generated library, the + appropriate version of the library will be linked in. + + For example, the following fragments link the normal, debug, or + version of "libmine.a" as appropriate: + + LD_LIBS += $(LIBMINE) + LIBMINE = ../libmine/${ARCH}/libmine.a + + ${ARCH}/pgm: $(LIBMINE) ${OBJS} + $(make-exe) + + If we do 'gmake debug', then the library in + ../libmine/o-debug/libmine.a will be linked in. If $(LIBMINE) + might not exist (or might be out of date) at this point, we could add + + ${LIBMINE}: FORCEIT + cd ../libmine; ${MAKE} ${VARIANT_VA} + + The above would generate the following command to build libmine.a: + + cd ../libmine; gmake debug + + The macro reference ${VARIANT_VA} converts ${ARCH} to the word 'debug' + (in this example) and thus ensures the proper version of the library + is built. + + + Targets + ------- + + All Makefile's support the following targets: + + all -- make "everything" + install -- install "everything" + + The following targets are provided automatically by + the included config files: + + clean -- delete all targets + depend -- build a make dependency file + "variant targets" -- special variants, see below + + + All directory Makefiles automatically propagate all these targets. If + you don't wish to support 'all' or 'install' in your source directory, + you must leave the rules section empty, as the parent directory Makefile + will attempt it on recursive make's. + + + Configuration + ------------- + + All the real work described here happens in file(s) included + from your Makefile. + + All Makefiles include a customization file which is used to select + compiler and host operating system. The environment variable + RTEMS_MAKEFILE_PATH must point to the directory containing this file; eg: + + export RTEMS_MAKEFILE_PATH=/.../pc386/ + + All leaf Makefile's also include either 'make/leaf.cfg' (or + 'make/lib.cfg' for building libraries). These config files provide + default rules and set up the command macros as appropriate. + + All directory Makefiles include 'make/directory.cfg'. directory.cfg + provides all the rules for recursing through sub directories. + + The Makefile templates already perform these include's. + + 'make/leaf.cfg' (or directory.cfg) in turn includes: + + a file specifying general purpose rules appropriate for + both leaf and directory makefiles. + ( make/main.cfg ) + + personality modules specified by the customization file for: + compiler ( make/compilers/??.cfg ) + + + generic rules file + ------------------ + + [ make/main.cfg ] + included by leaf.cfg or directory.cfg. + + This file contains some standard rules and variable assignments + that all Makefiles need. + + It also includes the FORCEIT: pseudo target. + + + OS config file for host machine + ------------------------------- + + [ make/os/OS-NAME.cfg ] + included by main.cfg + + Figures out the target architecture and specifies command names + for the OS tools including RCS/CVS (but NOT for the compiler tools). + + + Compiler configuration for the target + ------------------------------------- + + [ compilers/COMPILER-NAME.cfg ] + included by leaf.cfg + + Specifies the names of tools for compiling programs. + Names in here should be fully qualified, and NOT depend on $PATH. + + Also specifies compiler flags to be used to generate optimized, + debugging versions, as well as rules to compile + assembly language and make makefile dependencies. + + + Configuration Variables + ----------------------- + + Variables you have to set in the environment or in your Makefile. + Note: the RTEMS module files set RTEMS_ROOT and RTEMS_CUSTOM + for you. + + Makefile Variables + ------------------ + + RTEMS_BSP -- name of your 'bsp' eg: pc386, mvme136 + + RTEMS_CPU -- CPU architecture e.g.: i386, m68k + + RTEMS_CPU_FAMILY -- CPU model e.g.: i486dx, m68020 + + RTEMS_ROOT -- The root of your source tree. + All other file names are derived from this. + [ eg: % setenv RTEMS_ROOT $HOME/work/RTEMS ] + + RTEMS_CUSTOM -- name of your config files in make/custom + Example: + $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg + + The value RTEMS_ROOT is used in the custom + files to generate the make(1) variables: + + PROJECT_RELEASE + PROJECT_BIN + PROJECT_INCLUDE + PROJECT_TOOLS + + etc., which are used within the make config files themselves. + (The files in make/*.cfg try to avoid use of word RTEMS so + they can be more easily shared by other projects) + + Preset variables + ---------------- + + Aside from command names set by the OS and compiler config files, + a number of MAKE variables are automatically set and maintained by + the config files. + + PROJECT_RELEASE + -- release/install directory + [ $(PROJECT_ROOT) ] + + PROJECT_BIN + -- directory for installed binaries + [ $(PROJECT_ROOT)/bin ] + + PROJECT_TOOLS + -- directory for build environment commands + [ eg: $(PROJECT_ROOT)/build-tools ] + + ARCH -- target sub-directory for object code + [ eg: o-optimize or o-debug ] + + VARIANTS -- full list of all possible values for $(ARCH); + used mainly for 'make clean' + [ eg: "o-optimize o-debug" ] + + VARIANT_VA -- Variant name. + Normally "", but for 'make debug' it is "debug". + + see make/leaf.cfg for more info. + + + Preset compilation variables + ---------------------------- + + This is a list of some of the compilation variables. + Refer to the compiler config files for the complete list. + + CFLAGS_OPTIMIZE_V -- value of optimize flag for compiler + [ eg: -O ] + + CFLAGS_DEBUG_V -- value of debug flag for compiler + [ eg: -g ] + + CFLAGS_DEBUG + CFLAGS_OPTIMIZE -- current values for each depending + on make variant. + + LDFLAGS_STATIC_LIBRARIES_V + -- ld option for static libraries + -Bstatic or -dy (svr4) + + LDFLAGS_SHARED_LIBRARIES_V + -- ld option for dynamic libraries + -Bdynamic or -dn (svr4) + + Makefile Variables + ------------------ + + The following variables may be set in a typical Makefile. + + C_PIECES -- File names of your .c files without '.c' suffix. + [ eg: C_PIECES=main funcs stuff ] + + CC_PIECES -- ditto, except for .cc files + + S_PIECES -- ditto, except for .S files. + + LIB -- target library name in leaf library makefiles. + [ eg: LIB=${ARCH}/libmine.a ] + + H_FILES -- your .h files in this directory. + [ eg: H_FILES=stuff.h extra.h ] + + DEFINES -- cc -D items. Included in CPPFLAGS. + leaf Makefiles. + [ eg: DEFINES += -DUNIX ] + + CPPFLAGS -- -I include directories. + leaf Makefiles. + [ eg: CPPFLAGS += -I../include ] + + LD_PATHS -- arguments to -L for ld. + Will be prefixed with '-L' or '-L ' as appropriate + and included in LDFLAGS. + + LDFLAGS -- -L arguments to ld; more may be ADDed. + + LD_LIBS -- libraries to be linked in. + [ eg: LDLIBS += ../libfoo/${ARCH}/libfoo.a ] + + XCFLAGS -- "extra" CFLAGS for special needs. Pre-pended + to CFLAGS. + Not set or used by Makefiles. + Can be set on command line to pass extra flags + to the compiler. + + XCPPFLAGS -- ditto for CPPFLAGS + Can be set on command line to pass extra flags + to the preprocessor. + + XCCPPFLAGS -- same as XCPPFLAGS for C++. + + XCCFLAGS -- same as XCFLAGS for C++. + + SUBDIRS -- list of sub directories for make recursion. + directory Makefiles only. + [ eg: SUBDIRS=cpu bsp ] + + CLEAN_ADDITIONS + -- list of files or directories that should + be deleted by 'make clean' + [ eg: CLEAN_ADDITIONS += y.tab.c ] + + See 'leaf.cfg' for the 'clean:' rule and its + default deletions. + + CLOBBER_ADDITIONS + -- list of files or directories that should + be deleted by 'make clobber' + Since 'make clobber' includes 'make clean', + you don't need to duplicate items in both. + + Command names + ------------- + + The following commands should only be called + as make variables: + + MAKE,INSTALL,INSTALL_VARIANT,SHELL + + ECHO,CAT,CP,MV,LN,MKDIR,CHMOD + + SED + + CC,CPP,AS,AR,LD,NM,SIZE,RANLIB,MKLIB, + YACC,LEX,LINT,CTAGS,ETAGS + + In addition, the following commands specifically support + the installation of libraries, executables, header files, + and other things that need to be installed: + + INSTALL_CHANGE - set to host "install" program by default + + INSTALL_VARIANT - set to host "install" program by default + + Special Directory Makefile Targets + ---------------------------------- + + all_WRAPUP + clean_WRAPUP + install_WRAPUP + clean_WRAPUP + clobber_WRAPUP + depend_WRAPUP + -- Specify additional commands for recursive + (directory level) targets. + + This is handy in certain cases where you need + to do bit of work *after* a recursive make. + + make/Templates + -------------- + + This directory contains Makefile and source file templates that + should help in creating or converting makefiles. + + Makefile.leaf + Template leaf Makefiles. + + Makefile.lib + Template leaf library Makefiles. + + Makefile.dir + Template "directory" makefile. + + + + diff --git a/make/compilers/gcc-target-default.cfg b/make/compilers/gcc-target-default.cfg new file mode 100644 index 0000000000..813bd5c2c4 --- /dev/null +++ b/make/compilers/gcc-target-default.cfg @@ -0,0 +1,189 @@ +# +# Shared compiler for all GNU tools configurations +# + +## +# CFLAGS_OPTIMIZE_V, CFLAGS_DEBUG_V are the values we +# would want the corresponding macros to be set to. +# +# CFLAGS_OPTIMIZE, CFLAGS_DEBUG are set in the leaf +# Makefiles by the 'debug:' targets to their _V values. +# + +# default flags +# XCPPFLAGS, XCFLAGS, XCXXFLAGS, XASFLAGS +# are used to add flags from the shell +# cf. make.info ("Implicit rules/variables" for details) + +# NOTE: Should these go to CPPFLAGS ? +CFLAGS_DEFAULT=-Wall + +# NOTE: CPU_CFLAGS should probably be renamed to CPU_CPPFLAGS +# NOTE: CPU_DEFINES should probably be merged with CPU_CFLAGS +CPPFLAGS += $(CPU_DEFINES) $(CPU_CFLAGS) $(DEFINES) $(XCPPFLAGS) +CFLAGS = $(CFLAGS_DEFAULT) $(XCFLAGS) +CXXFLAGS = $(CFLAGS_DEFAULT) $(XCXXFLAGS) +ASFLAGS = $(CPU_ASFLAGS) $(XASFLAGS) + +# NOTE: GCCSPECS probably belongs to CPPFLAGS +GCCSPECS_OPTIMIZE_V = +GCCSPECS_DEBUG_V = + +GCCSPECS = -B$(PROJECT_RELEASE)/lib/ -specs bsp_specs -qrtems +GCCSPECS += $(GCCSPECS_$(VARIANT_V)_V) + +CC += $(GCCSPECS) +CXX += $(GCCSPECS) + +CPPFLAGS += + +# Define this to yes if C++ is included in the development environment. +# This requires that at least the GNU C++ compiler and libg++ be installed. +ifeq ($(HAS_CPLUSPLUS),yes) +CPLUS_LD_LIBS += $(PROJECT_RELEASE)/lib/librtems++$(LIBSUFFIX_VA) +endif + +# debug flag; +CFLAGS_DEBUG_V ?= -O0 -g +CXXFLAGS_DEBUG_V ?= $(CFLAGS_DEBUG_V) + +# when debugging, optimize flag: typically empty +# some compilers do allow optimization with their "-g" +CFLAGS_OPTIMIZE_V ?= -O2 -g +CXXFLAGS_OPTIMIZE_V ?= $(CFLAGS_OPTIMIZE_V) + +ifndef AUTOMAKE +CPPFLAGS_$(VARIANT)=$(CPPFLAGS_$(VARIANT)_V) +CFLAGS_$(VARIANT) =$(CFLAGS_$(VARIANT)_V) +CXXFLAGS_$(VARIANT)=$(CXXFLAGS_$(VARIANT)_V) +endif + +ifndef AUTOMAKE +CPPFLAGS += $(CPPFLAGS_OPTIMIZE) $(CPPFLAGS_DEBUG) +CFLAGS += $(CFLAGS_OPTIMIZE) $(CFLAGS_DEBUG) +CXXFLAGS += $(CXXFLAGS_OPTIMIZE) $(CXXFLAGS_DEBUG) +endif + +# List of library paths without -L +LD_PATHS= $(PROJECT_RELEASE)/lib + +# ld flag for incomplete link +LDFLAGS_INCOMPLETE = -r + +# LDFLAGS=$(LDFLAGS_DEBUG) $(LD_PATHS:%=-L%) +LDFLAGS += $(LDFLAGS_DEBUG) + +# +# Stuff to clean and clobber for the compiler and its tools +# + +CLEAN_CC = a.out *.o *.BAK +CLOBBER_CC = + +# +# Client compiler and support tools +# + +# CPP command to write file to standard output with warnings suppressed +CPP=$(CC) -E -w + +# egrep regexp to ignore symbol table entries in ar archives. +# Only used to make sure we skip them when coalescing libraries. +# skip __.SYMDEF and empty names (maybe bug in ranlib??). +AR_SYMBOL_TABLE="HIGHLY-UNLIKELY-TO-CONFLICT" +ARFLAGS=ruv + +# +# How to compile stuff into ${ARCH} subdirectory +# + +${ARCH}/%.o: %.c + ${COMPILE.c} $(AM_CPPFLAGS) $(AM_CFLAGS) -o $@ $< + +${ARCH}/%.o: %.cc + ${COMPILE.cc} $(AM_CPPFLAGS) $(AM_CXXFLAGS) -o $@ $< + +${ARCH}/%.o: %.cpp + ${COMPILE.cc} $(AM_CPPFLAGS) $(AM_CXXFLAGS) -o $@ $< + +${ARCH}/%.o: %.cxx + ${COMPILE.cc} $(AM_CPPFLAGS) $(AM_CXXFLAGS) -o $@ $< + +${ARCH}/%.o: %.C + ${COMPILE.cc} $(AM_CPPFLAGS) $(AM_CXXFLAGS) -o $@ $< + +${ARCH}/%.o: %.S + ${COMPILE.S} $(AM_CPPFLAGS) -DASM -o $@ $< + +# Make foo.rel from foo.o +${ARCH}/%.rel: ${ARCH}/%.o + ${make-rel} + +# create $(ARCH)/pgm from pgm.sh +${ARCH}/%: %.sh + $(RM) $@ + $(CP) $< $@ + $(CHMOD) +x $@ + +# Dependency files for use by gmake +# NOTE: we don't put them into $(ARCH) +# so that 'make clean' doesn't blow it away + +DEPEND=Depends-${ARCH} + +CLEAN_DEPEND=$(DEPEND).tmp +CLOBBER_DEPEND=$(DEPEND) + +# We deliberately don't have anything depend on the +# $(DEPEND) file; otherwise it will get rebuilt even +# on 'make clean' +# + +depend-am: $(C_FILES) $(CC_FILES) $(S_FILES) +ifneq ($(words $(C_FILES) $(CC_FILES) $(S_FILES)), 0) +# Use gcc -M to generate dependencies +# Replace foo.o with $(ARCH)/foo.o +# Replace $(ARCH) value with string $(ARCH) +# so that it will for debug cases + $(COMPILE.c) $(AM_CPPFLAGS) $(AM_CFLAGS) -M $^ | \ + $(SED) -e 's?^\(.*\)\.o[ ]*:?$$(ARCH)/\1.o:?' \ + -e 's?$(ARCH)/?$$(ARCH)/?' >$(DEPEND).tmp + $(MV) $(DEPEND).tmp $(DEPEND) +endif +depend: depend-am + +# spell out all the LINK_FILE's, rather than using -lbsp, so +# that $(LINK_FILES) can be a dependency + +# +# NOTE: a rule to link an rtems' application should look similar to this +# (cf. "make-exe" in make/custom/*.cfg): +# +# gcc28: +# $(PGM): $(LINK_FILES) +# $(CC) $(CFLAGS) -o $@ $(LINK_OBJS) $(LINK_LIBS) +# + +LINK_OBJS =\ + $(CONSTRUCTOR) \ + $(OBJS) + +LINK_FILES =\ + $(CONSTRUCTOR) \ + $(OBJS) \ + $(PROJECT_RELEASE)/lib/librtemsbsp$(LIBSUFFIX_VA) \ + $(PROJECT_RELEASE)/lib/librtemscpu$(LIBSUFFIX_VA) + +LINK_LIBS += $(LD_LIBS) + +# +# Allow user to override link commands (to build a prom image, perhaps) +# +ifndef LINKCMDS +LINKCMDS=$(PROJECT_RELEASE)/lib/linkcmds +endif + +define make-rel + $(LINK.c) $(CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) \ + -qnolinkcmds -nostdlib -Wl,-r $(XLDFLAGS) -o $@ $^ +endef diff --git a/make/directory.cfg b/make/directory.cfg new file mode 100644 index 0000000000..83ea0ecde3 --- /dev/null +++ b/make/directory.cfg @@ -0,0 +1,57 @@ +# make/directory.cfg +# +# Make(1) configuration file include'd by all directory-level Makefile's. +# +# See also make/main.cfg +# + +# This is a simplified variant of automake-1.4's rule for handling +# subdirectories +$(RECURSE_TARGETS): + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed -e s/-recursive// -e s/debug_// `; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + local_target="$$target"; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" + + +# mostlyclean-recursive maintainer-clean-recursive: +clean-recursive \ +distclean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ + rev="$$subdir $$rev"; \ + test "$$subdir" = "." && dot_seen=yes; \ + done; \ + test "$$dot_seen" = "no" && rev=". $$rev"; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" + +clean-am: clean-generic +distclean-am: distclean-generic clean-am + +preinstall: preinstall-recursive +.PHONY: preinstall preinstall-am preinstall-recursive + +distclean: distclean-recursive + -$(RM) config.status + +.PHONY: distclean distclean-am distclean-recursive + +clean: clean-recursive +.PHONY: clean clean-am clean-recursive + diff --git a/make/host.cfg b/make/host.cfg new file mode 100644 index 0000000000..890a2d2ee2 --- /dev/null +++ b/make/host.cfg @@ -0,0 +1,48 @@ +# OS-specific configuration +# +# Derived from rtems/c/make/os/*.cfg in previous RTEMS version. +# + +# +# Stuff to clean and clobber for the OS +# + +CLEAN_OS = +CLOBBER_OS = *~ *.bak TAGS tags + +SHELL=sh +ECHO=echo + +CAT=cat +CP=cp +MV=mv +LN=ln +MKDIR=mkdir +CHMOD=chmod +SED=sed + +# Global tools + +ifndef BIN2C +BIN2C=rtems-bin2c +endif + +ifndef INSTALL_CHANGE +INSTALL_CHANGE=install +endif +ifndef INSTALL_VARIANT +INSTALL_VARIANT=install +endif + +# ksh (or bash) is used by some shell scripts; ref build-tools/scripts/Makefile +# +# Must have shell functions. Some ksh's core dump mysteriously and +# unreliably on RTEMS shell scripts. bash appears to be the most +# reliable but late model ksh's are usually OK. +KSH=bash + +INSTBINFLAGS = -m 0755 +INSTDATAFLAGS = -m 0644 +INSTLIBFLAGS = -m 0644 +INSTDIRFLAGS = -m 0755 -d +INSTINCFLAGS = -m 0644 diff --git a/make/lib.cfg b/make/lib.cfg new file mode 100644 index 0000000000..c4a2c679d5 --- /dev/null +++ b/make/lib.cfg @@ -0,0 +1,15 @@ +# make/lib.cfg +# +# Make(1) configuration file include'd by all "library" Makefile +# Assumes $(LIB) is set to $(ARCH)/libfoo.a +# + +include $(PROJECT_ROOT)/make/leaf.cfg + +define make-library +$(RM) $@ +$(AR) $(ARFLAGS) $@ $(OBJS) +$(RANLIB) $@ +endef + +.PRECIOUS: $(LIB) diff --git a/spec/build/bsps/arm/altera-cyclone-v/abi.yml b/spec/build/bsps/arm/altera-cyclone-v/abi.yml new file mode 100644 index 0000000000..a3a710c97d --- /dev/null +++ b/spec/build/bsps/arm/altera-cyclone-v/abi.yml @@ -0,0 +1,21 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +actions: +- get-string: null +- split: null +- env-append: null +build-type: option +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +default: +- -march=armv7-a +- -mthumb +- -mfpu=neon +- -mfloat-abi=hard +- -mtune=cortex-a9 +default-by-variant: [] +description: | + ABI flags +enabled-by: true +links: [] +name: ABI_FLAGS +type: build diff --git a/spec/build/bsps/arm/altera-cyclone-v/bspalteracyclonev.yml b/spec/build/bsps/arm/altera-cyclone-v/bspalteracyclonev.yml new file mode 100644 index 0000000000..abe3d7f490 --- /dev/null +++ b/spec/build/bsps/arm/altera-cyclone-v/bspalteracyclonev.yml @@ -0,0 +1,142 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +arch: arm +bsp: altcycv_devkit +build-type: bsp +cflags: [] +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +cppflags: [] +enabled-by: true +family: altera-cyclone-v +includes: [] +install: +- destination: ${BSP_INCLUDEDIR} + source: + - bsps/arm/altera-cyclone-v/include/bsp.h + - bsps/arm/altera-cyclone-v/include/tm27.h +- destination: ${BSP_INCLUDEDIR}/bsp + source: + - bsps/arm/altera-cyclone-v/include/bsp/alt_16550_uart.h + - bsps/arm/altera-cyclone-v/include/bsp/alt_address_space.h + - bsps/arm/altera-cyclone-v/include/bsp/alt_cache.h + - bsps/arm/altera-cyclone-v/include/bsp/alt_clock_group.h + - bsps/arm/altera-cyclone-v/include/bsp/alt_clock_manager.h + - bsps/arm/altera-cyclone-v/include/bsp/alt_dma.h + - bsps/arm/altera-cyclone-v/include/bsp/alt_dma_common.h + - bsps/arm/altera-cyclone-v/include/bsp/alt_dma_program.h + - bsps/arm/altera-cyclone-v/include/bsp/alt_generalpurpose_io.h + - bsps/arm/altera-cyclone-v/include/bsp/alt_hwlibs_ver.h + - bsps/arm/altera-cyclone-v/include/bsp/alt_i2c.h + - bsps/arm/altera-cyclone-v/include/bsp/alt_interrupt_common.h + - bsps/arm/altera-cyclone-v/include/bsp/alt_mpu_registers.h + - bsps/arm/altera-cyclone-v/include/bsp/alt_qspi_private.h + - bsps/arm/altera-cyclone-v/include/bsp/alt_reset_manager.h + - bsps/arm/altera-cyclone-v/include/bsp/hwlib.h + - bsps/arm/altera-cyclone-v/include/bsp/i2cdrv.h + - bsps/arm/altera-cyclone-v/include/bsp/irq.h +- destination: ${BSP_INCLUDEDIR}/bsp/socal + source: + - bsps/arm/altera-cyclone-v/include/bsp/socal/alt_acpidmap.h + - bsps/arm/altera-cyclone-v/include/bsp/socal/alt_clkmgr.h + - bsps/arm/altera-cyclone-v/include/bsp/socal/alt_dmanonsecure.h + - bsps/arm/altera-cyclone-v/include/bsp/socal/alt_dmasecure.h + - bsps/arm/altera-cyclone-v/include/bsp/socal/alt_gpio.h + - bsps/arm/altera-cyclone-v/include/bsp/socal/alt_i2c.h + - bsps/arm/altera-cyclone-v/include/bsp/socal/alt_l3.h + - bsps/arm/altera-cyclone-v/include/bsp/socal/alt_qspi.h + - bsps/arm/altera-cyclone-v/include/bsp/socal/alt_qspidata.h + - bsps/arm/altera-cyclone-v/include/bsp/socal/alt_rstmgr.h + - bsps/arm/altera-cyclone-v/include/bsp/socal/alt_sdr.h + - bsps/arm/altera-cyclone-v/include/bsp/socal/alt_sysmgr.h + - bsps/arm/altera-cyclone-v/include/bsp/socal/alt_uart.h + - bsps/arm/altera-cyclone-v/include/bsp/socal/hps.h + - bsps/arm/altera-cyclone-v/include/bsp/socal/socal.h +- destination: ${BSP_LIBDIR} + source: + - bsps/arm/altera-cyclone-v/start/linkcmds + - bsps/arm/altera-cyclone-v/start/linkcmds.altcycv +links: +- role: build-dependency + uid: abi +- role: build-dependency + uid: objsmp +- role: build-dependency + uid: opta9periphclk +- role: build-dependency + uid: optcachedata +- role: build-dependency + uid: optcacheinst +- role: build-dependency + uid: optclkfastidle +- role: build-dependency + uid: optconcfg +- role: build-dependency + uid: optconuart1 +- role: build-dependency + uid: optfdtcpyro +- role: build-dependency + uid: optfdten +- role: build-dependency + uid: optfdtmxsz +- role: build-dependency + uid: optfdtro +- role: build-dependency + uid: optfdtuboot +- role: build-dependency + uid: opti2cspeed +- role: build-dependency + uid: optnoi2c +- role: build-dependency + uid: optresetvec +- role: build-dependency + uid: optuartbaud +- role: build-dependency + uid: optuartirq +- role: build-dependency + uid: ../grp +- role: build-dependency + uid: ../start +- role: build-dependency + uid: ../../obj +- role: build-dependency + uid: ../../objirq +- role: build-dependency + uid: ../../opto2 +- role: build-dependency + uid: ../../bspopts +source: +- bsps/arm/altera-cyclone-v/console/console-config.c +- bsps/arm/altera-cyclone-v/contrib/hwlib/src/hwmgr/alt_16550_uart.c +- bsps/arm/altera-cyclone-v/contrib/hwlib/src/hwmgr/alt_address_space.c +- bsps/arm/altera-cyclone-v/contrib/hwlib/src/hwmgr/alt_clock_manager.c +- bsps/arm/altera-cyclone-v/contrib/hwlib/src/hwmgr/alt_dma.c +- bsps/arm/altera-cyclone-v/contrib/hwlib/src/hwmgr/alt_dma_program.c +- bsps/arm/altera-cyclone-v/contrib/hwlib/src/hwmgr/alt_generalpurpose_io.c +- bsps/arm/altera-cyclone-v/contrib/hwlib/src/hwmgr/alt_i2c.c +- bsps/arm/altera-cyclone-v/contrib/hwlib/src/hwmgr/alt_qspi.c +- bsps/arm/altera-cyclone-v/contrib/hwlib/src/hwmgr/alt_reset_manager.c +- bsps/arm/altera-cyclone-v/i2c/i2cdrv-config.c +- bsps/arm/altera-cyclone-v/i2c/i2cdrv.c +- bsps/arm/altera-cyclone-v/rtc/rtc.c +- bsps/arm/altera-cyclone-v/start/bspclean.c +- bsps/arm/altera-cyclone-v/start/bspgetworkarea.c +- bsps/arm/altera-cyclone-v/start/bspreset.c +- bsps/arm/altera-cyclone-v/start/bspstart.c +- bsps/arm/altera-cyclone-v/start/bspstarthooks.c +- bsps/arm/altera-cyclone-v/start/mmu-config.c +- bsps/arm/shared/cache/cache-l2c-310.c +- bsps/arm/shared/clock/clock-a9mpcore.c +- bsps/arm/shared/cp15/arm-cp15-set-exception-handler.c +- bsps/arm/shared/cp15/arm-cp15-set-ttb-entries.c +- bsps/arm/shared/irq/irq-gic.c +- bsps/arm/shared/start/bsp-start-memcpy.S +- bsps/shared/dev/btimer/btimer-stub.c +- bsps/shared/dev/getentropy/getentropy-cpucounter.c +- bsps/shared/dev/rtc/rtc-support.c +- bsps/shared/dev/serial/console-termios-init.c +- bsps/shared/dev/serial/console-termios.c +- bsps/shared/irq/irq-default-handler.c +- bsps/shared/start/bsp-fdt.c +- bsps/shared/start/sbrk.c +- bsps/shared/start/stackalloc.c +type: build diff --git a/spec/build/bsps/arm/altera-cyclone-v/objsmp.yml b/spec/build/bsps/arm/altera-cyclone-v/objsmp.yml new file mode 100644 index 0000000000..bf0c99d21f --- /dev/null +++ b/spec/build/bsps/arm/altera-cyclone-v/objsmp.yml @@ -0,0 +1,16 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +build-type: objects +cflags: [] +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +cppflags: [] +cxxflags: [] +enabled-by: +- RTEMS_SMP +includes: [] +install: [] +links: [] +source: +- bsps/arm/altera-cyclone-v/start/bspsmp.c +- bsps/arm/shared/start/arm-a9mpcore-smp.c +type: build diff --git a/spec/build/bsps/arm/altera-cyclone-v/opta9periphclk.yml b/spec/build/bsps/arm/altera-cyclone-v/opta9periphclk.yml new file mode 100644 index 0000000000..e67ddc129b --- /dev/null +++ b/spec/build/bsps/arm/altera-cyclone-v/opta9periphclk.yml @@ -0,0 +1,15 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +actions: +- get-boolean: null +- define-condition: null +build-type: option +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +default: false +default-by-variant: [] +description: | + define to set ARM Cortex-A9 MPCore PERIPHCLK clock frequency in Hz, otherwise alt_clk_freq_get() is used +enabled-by: true +links: [] +name: BSP_ARM_A9MPCORE_PERIPHCLK +type: build diff --git a/spec/build/bsps/arm/altera-cyclone-v/optcachedata.yml b/spec/build/bsps/arm/altera-cyclone-v/optcachedata.yml new file mode 100644 index 0000000000..77dac09116 --- /dev/null +++ b/spec/build/bsps/arm/altera-cyclone-v/optcachedata.yml @@ -0,0 +1,15 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +actions: +- get-boolean: null +- define-condition: null +build-type: option +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +default: true +default-by-variant: [] +description: | + enable data cache +enabled-by: true +links: [] +name: BSP_DATA_CACHE_ENABLED +type: build diff --git a/spec/build/bsps/arm/altera-cyclone-v/optcacheinst.yml b/spec/build/bsps/arm/altera-cyclone-v/optcacheinst.yml new file mode 100644 index 0000000000..a59db43f31 --- /dev/null +++ b/spec/build/bsps/arm/altera-cyclone-v/optcacheinst.yml @@ -0,0 +1,15 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +actions: +- get-boolean: null +- define-condition: null +build-type: option +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +default: true +default-by-variant: [] +description: | + enable instruction cache +enabled-by: true +links: [] +name: BSP_INSTRUCTION_CACHE_ENABLED +type: build diff --git a/spec/build/bsps/arm/altera-cyclone-v/optclkfastidle.yml b/spec/build/bsps/arm/altera-cyclone-v/optclkfastidle.yml new file mode 100644 index 0000000000..b800b20428 --- /dev/null +++ b/spec/build/bsps/arm/altera-cyclone-v/optclkfastidle.yml @@ -0,0 +1,18 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +actions: +- get-boolean: null +- define-condition: null +build-type: option +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +default: false +default-by-variant: +- value: true + variants: + - arm/.*qemu +description: | + This sets a mode where the time runs as fast as possible when a clock ISR occurs while the IDLE thread is executing. This can significantly reduce simulation times. +enabled-by: true +links: [] +name: CLOCK_DRIVER_USE_FAST_IDLE +type: build diff --git a/spec/build/bsps/arm/altera-cyclone-v/optconcfg.yml b/spec/build/bsps/arm/altera-cyclone-v/optconcfg.yml new file mode 100644 index 0000000000..635697cc8a --- /dev/null +++ b/spec/build/bsps/arm/altera-cyclone-v/optconcfg.yml @@ -0,0 +1,15 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +actions: +- get-boolean: null +- define-condition: null +build-type: option +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +default: true +default-by-variant: [] +description: | + configuration for console (UART 0) +enabled-by: true +links: [] +name: CYCLONE_V_CONFIG_CONSOLE +type: build diff --git a/spec/build/bsps/arm/altera-cyclone-v/optconuart1.yml b/spec/build/bsps/arm/altera-cyclone-v/optconuart1.yml new file mode 100644 index 0000000000..f5c588a330 --- /dev/null +++ b/spec/build/bsps/arm/altera-cyclone-v/optconuart1.yml @@ -0,0 +1,15 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +actions: +- get-boolean: null +- define-condition: null +build-type: option +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +default: true +default-by-variant: [] +description: | + configuration for UART 1 +enabled-by: true +links: [] +name: CYCLONE_V_CONFIG_UART_1 +type: build diff --git a/spec/build/bsps/arm/altera-cyclone-v/optfdtcpyro.yml b/spec/build/bsps/arm/altera-cyclone-v/optfdtcpyro.yml new file mode 100644 index 0000000000..c26b1ae051 --- /dev/null +++ b/spec/build/bsps/arm/altera-cyclone-v/optfdtcpyro.yml @@ -0,0 +1,15 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +actions: +- get-boolean: null +- define-condition: null +build-type: option +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +default: true +default-by-variant: [] +description: | + copy the FDT blob into the read-only load area via bsp_fdt_copy() +enabled-by: true +links: [] +name: BSP_FDT_BLOB_COPY_TO_READ_ONLY_LOAD_AREA +type: build diff --git a/spec/build/bsps/arm/altera-cyclone-v/optfdten.yml b/spec/build/bsps/arm/altera-cyclone-v/optfdten.yml new file mode 100644 index 0000000000..f2fc473967 --- /dev/null +++ b/spec/build/bsps/arm/altera-cyclone-v/optfdten.yml @@ -0,0 +1,15 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +actions: +- get-boolean: null +- define-condition: null +build-type: option +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +default: true +default-by-variant: [] +description: | + define if FDT is supported +enabled-by: true +links: [] +name: BSP_FDT_IS_SUPPORTED +type: build diff --git a/spec/build/bsps/arm/altera-cyclone-v/optfdtmxsz.yml b/spec/build/bsps/arm/altera-cyclone-v/optfdtmxsz.yml new file mode 100644 index 0000000000..14af766230 --- /dev/null +++ b/spec/build/bsps/arm/altera-cyclone-v/optfdtmxsz.yml @@ -0,0 +1,16 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +actions: +- get-integer: null +- define: null +build-type: option +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +default: 262144 +default-by-variant: [] +description: | + maximum size of the FDT blob in bytes +enabled-by: true +format: '{}' +links: [] +name: BSP_FDT_BLOB_SIZE_MAX +type: build diff --git a/spec/build/bsps/arm/altera-cyclone-v/optfdtro.yml b/spec/build/bsps/arm/altera-cyclone-v/optfdtro.yml new file mode 100644 index 0000000000..a61bb2924b --- /dev/null +++ b/spec/build/bsps/arm/altera-cyclone-v/optfdtro.yml @@ -0,0 +1,15 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +actions: +- get-boolean: null +- define-condition: null +build-type: option +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +default: true +default-by-variant: [] +description: | + place the FDT blob into the read-only data area +enabled-by: true +links: [] +name: BSP_FDT_BLOB_READ_ONLY +type: build diff --git a/spec/build/bsps/arm/altera-cyclone-v/optfdtuboot.yml b/spec/build/bsps/arm/altera-cyclone-v/optfdtuboot.yml new file mode 100644 index 0000000000..5805e912ff --- /dev/null +++ b/spec/build/bsps/arm/altera-cyclone-v/optfdtuboot.yml @@ -0,0 +1,15 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +actions: +- get-boolean: null +- define-condition: null +build-type: option +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +default: true +default-by-variant: [] +description: | + copy the U-Boot provided FDT to an internal storage +enabled-by: true +links: [] +name: BSP_START_COPY_FDT_FROM_U_BOOT +type: build diff --git a/spec/build/bsps/arm/altera-cyclone-v/opti2cspeed.yml b/spec/build/bsps/arm/altera-cyclone-v/opti2cspeed.yml new file mode 100644 index 0000000000..ee8097aa3b --- /dev/null +++ b/spec/build/bsps/arm/altera-cyclone-v/opti2cspeed.yml @@ -0,0 +1,16 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +actions: +- get-integer: null +- define: null +build-type: option +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +default: 100000 +default-by-variant: [] +description: | + speed for I2C0 in HZ +enabled-by: true +format: '{}' +links: [] +name: CYCLONE_V_I2C0_SPEED +type: build diff --git a/spec/build/bsps/arm/altera-cyclone-v/optnoi2c.yml b/spec/build/bsps/arm/altera-cyclone-v/optnoi2c.yml new file mode 100644 index 0000000000..2d36d5f930 --- /dev/null +++ b/spec/build/bsps/arm/altera-cyclone-v/optnoi2c.yml @@ -0,0 +1,15 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +actions: +- get-boolean: null +- define-condition: null +build-type: option +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +default: true +default-by-variant: [] +description: | + Number of configured I2C buses. Note that each bus has to be configured in an apropriate i2cdrv_config array. +enabled-by: true +links: [] +name: CYCLONE_V_NO_I2C +type: build diff --git a/spec/build/bsps/arm/altera-cyclone-v/optresetvec.yml b/spec/build/bsps/arm/altera-cyclone-v/optresetvec.yml new file mode 100644 index 0000000000..efd1ea2b2a --- /dev/null +++ b/spec/build/bsps/arm/altera-cyclone-v/optresetvec.yml @@ -0,0 +1,15 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +actions: +- get-boolean: null +- define-condition: null +build-type: option +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +default: false +default-by-variant: [] +description: | + reset vector address for BSP start +enabled-by: true +links: [] +name: BSP_START_RESET_VECTOR +type: build diff --git a/spec/build/bsps/arm/altera-cyclone-v/optuartbaud.yml b/spec/build/bsps/arm/altera-cyclone-v/optuartbaud.yml new file mode 100644 index 0000000000..b5f577ffc3 --- /dev/null +++ b/spec/build/bsps/arm/altera-cyclone-v/optuartbaud.yml @@ -0,0 +1,16 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +actions: +- get-integer: null +- define: null +build-type: option +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +default: 115200 +default-by-variant: [] +description: | + baud for UARTs +enabled-by: true +format: '{}' +links: [] +name: CYCLONE_V_UART_BAUD +type: build diff --git a/spec/build/bsps/arm/altera-cyclone-v/optuartirq.yml b/spec/build/bsps/arm/altera-cyclone-v/optuartirq.yml new file mode 100644 index 0000000000..152668b2d9 --- /dev/null +++ b/spec/build/bsps/arm/altera-cyclone-v/optuartirq.yml @@ -0,0 +1,15 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +actions: +- get-boolean: null +- define-condition: null +build-type: option +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +default: true +default-by-variant: [] +description: | + enable usage of interrupts for the UART modules +enabled-by: true +links: [] +name: BSP_USE_UART_INTERRUPTS +type: build diff --git a/spec/build/bsps/arm/atsam/abi.yml b/spec/build/bsps/arm/atsam/abi.yml new file mode 100644 index 0000000000..7a95742c36 --- /dev/null +++ b/spec/build/bsps/arm/atsam/abi.yml @@ -0,0 +1,20 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +actions: +- get-string: null +- split: null +- env-append: null +build-type: option +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +default: +- -mthumb +- -mcpu=cortex-m7 +- -mfpu=fpv5-d16 +- -mfloat-abi=hard +default-by-variant: [] +description: | + ABI flags +enabled-by: true +links: [] +name: ABI_FLAGS +type: build diff --git a/spec/build/bsps/arm/atsam/bspatsam.yml b/spec/build/bsps/arm/atsam/bspatsam.yml new file mode 100644 index 0000000000..f0aaa17cf7 --- /dev/null +++ b/spec/build/bsps/arm/atsam/bspatsam.yml @@ -0,0 +1,411 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +arch: arm +bsp: atsamv +build-type: bsp +cflags: [] +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +cppflags: [] +enabled-by: true +family: atsam +includes: +- bsps/arm/atsam/contrib/libraries/libboard +- bsps/arm/atsam/contrib/libraries/libboard/include +- bsps/arm/atsam/contrib/libraries/libchip +- bsps/arm/atsam/contrib/libraries/libchip/include +- bsps/arm/atsam/include/libchip +- bsps/arm/atsam/include/libchip/include +install: +- destination: ${BSP_INCLUDEDIR} + source: + - bsps/arm/atsam/include/bsp.h + - bsps/arm/atsam/include/tm27.h +- destination: ${BSP_INCLUDEDIR}/bsp + source: + - bsps/arm/atsam/include/bsp/atsam-clock-config.h + - bsps/arm/atsam/include/bsp/atsam-i2c.h + - bsps/arm/atsam/include/bsp/atsam-spi.h + - bsps/arm/atsam/include/bsp/i2c.h + - bsps/arm/atsam/include/bsp/iocopy.h + - bsps/arm/atsam/include/bsp/irq.h + - bsps/arm/atsam/include/bsp/pin-config.h + - bsps/arm/atsam/include/bsp/power.h + - bsps/arm/atsam/include/bsp/sc16is752.h + - bsps/arm/atsam/include/bsp/spi.h +- destination: ${BSP_INCLUDEDIR}/libchip + source: + - bsps/arm/atsam/include/libchip/chip.h + - bsps/arm/atsam/include/libchip/compiler.h +- destination: ${BSP_INCLUDEDIR}/libchip/include + source: + - bsps/arm/atsam/include/libchip/include/acc.h + - bsps/arm/atsam/include/libchip/include/adc.h + - bsps/arm/atsam/include/libchip/include/aes.h + - bsps/arm/atsam/include/libchip/include/afe_dma.h + - bsps/arm/atsam/include/libchip/include/afec.h + - bsps/arm/atsam/include/libchip/include/chip.h + - bsps/arm/atsam/include/libchip/include/dac_dma.h + - bsps/arm/atsam/include/libchip/include/efc.h + - bsps/arm/atsam/include/libchip/include/exceptions.h + - bsps/arm/atsam/include/libchip/include/flashd.h + - bsps/arm/atsam/include/libchip/include/gmac.h + - bsps/arm/atsam/include/libchip/include/gmacd.h + - bsps/arm/atsam/include/libchip/include/hsmci.h + - bsps/arm/atsam/include/libchip/include/icm.h + - bsps/arm/atsam/include/libchip/include/isi.h + - bsps/arm/atsam/include/libchip/include/iso7816_4.h + - bsps/arm/atsam/include/libchip/include/mcan.h + - bsps/arm/atsam/include/libchip/include/mcid.h + - bsps/arm/atsam/include/libchip/include/mediaLB.h + - bsps/arm/atsam/include/libchip/include/mpu.h + - bsps/arm/atsam/include/libchip/include/pio.h + - bsps/arm/atsam/include/libchip/include/pio_capture.h + - bsps/arm/atsam/include/libchip/include/pio_it.h + - bsps/arm/atsam/include/libchip/include/pmc.h + - bsps/arm/atsam/include/libchip/include/pwmc.h + - bsps/arm/atsam/include/libchip/include/qspi.h + - bsps/arm/atsam/include/libchip/include/qspi_dma.h + - bsps/arm/atsam/include/libchip/include/rstc.h + - bsps/arm/atsam/include/libchip/include/rtc.h + - bsps/arm/atsam/include/libchip/include/rtt.h + - bsps/arm/atsam/include/libchip/include/sdramc.h + - bsps/arm/atsam/include/libchip/include/smc.h + - bsps/arm/atsam/include/libchip/include/spi.h + - bsps/arm/atsam/include/libchip/include/spi_dma.h + - bsps/arm/atsam/include/libchip/include/ssc.h + - bsps/arm/atsam/include/libchip/include/supc.h + - bsps/arm/atsam/include/libchip/include/tc.h + - bsps/arm/atsam/include/libchip/include/timetick.h + - bsps/arm/atsam/include/libchip/include/trace.h + - bsps/arm/atsam/include/libchip/include/trng.h + - bsps/arm/atsam/include/libchip/include/twi.h + - bsps/arm/atsam/include/libchip/include/twid.h + - bsps/arm/atsam/include/libchip/include/uart.h + - bsps/arm/atsam/include/libchip/include/uart_dma.h + - bsps/arm/atsam/include/libchip/include/usart.h + - bsps/arm/atsam/include/libchip/include/usart_dma.h + - bsps/arm/atsam/include/libchip/include/usbhs.h + - bsps/arm/atsam/include/libchip/include/video.h + - bsps/arm/atsam/include/libchip/include/wdt.h + - bsps/arm/atsam/include/libchip/include/xdma_hardware_interface.h + - bsps/arm/atsam/include/libchip/include/xdmac.h + - bsps/arm/atsam/include/libchip/include/xdmad.h +- destination: ${BSP_INCLUDEDIR}/libchip/include/same70 + source: + - bsps/arm/atsam/include/libchip/include/same70/same70.h + - bsps/arm/atsam/include/libchip/include/same70/same70j19.h + - bsps/arm/atsam/include/libchip/include/same70/same70j20.h + - bsps/arm/atsam/include/libchip/include/same70/same70j21.h + - bsps/arm/atsam/includ |