nuttx/boards/misoc/lm32/misoc
chao.an b88561299b make/expression: improving up asm/C/C++ compile times
In the current compilation environment, the recursive assignment(=) for compile
flags will be delayed until every file is actually need to be compile.

For example:
--------------------------------------------------------------------------------
arch/arm/src/Makefile:

INCLUDES += ${shell $(INCDIR) "$(CC)" $(ARCH_SRCDIR)$(DELIM)chip}
INCLUDES += ${shell $(INCDIR) "$(CC)" $(ARCH_SRCDIR)$(DELIM)common}
INCLUDES += ${shell $(INCDIR) "$(CC)" $(ARCH_SRCDIR)$(DELIM)$(ARCH_SUBDIR)}
INCLUDES += ${shell $(INCDIR) "$(CC)" $(TOPDIR)$(DELIM)sched}

CPPFLAGS += $(INCLUDES) $(EXTRAFLAGS)
CFLAGS += $(INCLUDES) $(EXTRAFLAGS)
CXXFLAGS += $(INCLUDES) $(EXTRAFLAGS)
AFLAGS += $(INCLUDES) $(EXTRAFLAGS)
--------------------------------------------------------------------------------

All compilation options will be included recursively,
which will be delayed until the compilation options are actually used:

tools/Config.mk:

--------------------------------------------------------------------------------
define COMPILE
  @echo "CC: $1"
  $(Q) $(CC) -c $(CFLAGS) $($(strip $1)_CFLAGS) $1 -o $2
endef
--------------------------------------------------------------------------------

All compile flags to be reexecuted $(INCDIR) as long as one file needs to be compiled,
but in fact, the compilation options have not changed in the current directory.

So the we recommand to change the syntax of assignment
From
    Recursive (=)
To
    Simple    (:=)

In this way, we can ensure that all compilation options are expanded only once and reducing repeated works.

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-02 07:53:53 -08:00
..
configs libc/stdio: Allocate file_struct dynamically 2020-09-11 17:58:17 +08:00
include Merged in alinjerpelea/nuttx (pull request #971) 2019-08-09 13:22:39 +00:00
scripts make/expression: improving up asm/C/C++ compile times 2020-11-02 07:53:53 -08:00
src build: Remove the empty variable assignment 2020-05-24 08:24:13 -06:00
Kconfig Merged in alinjerpelea/nuttx (pull request #967) 2019-08-07 20:49:39 +00:00
README.txt Change all 'Nuttx' to 'NuttX' 2020-10-20 01:45:06 -07:00

Misoc README
============

  This README applies to a port to NuttX running on a Qemu LM32 system.  You
  can find the Qemu setup at https://bitbucket.org/key2/qemu

  This initial release supports two UARTs, but does not have a system timer
  or other peripherals.  More to come.

Buildroot Toolchain
===================

  A GNU GCC-based toolchain is assumed.  The PATH environment variable should
  be modified to point to the correct path to the LM32 GCC toolchain (if
  different from the default in your PATH variable).

  If you have no LM32 toolchain, one can be cloned from the NuttX
  Bitbucket GIT repository (https://bitbucket.org/nuttx/buildroot).
  This GNU toolchain builds and executes in the Linux or Cygwin environment.

  1. You must have already configured NuttX in <some-dir>/nuttx.

     tools/configure.sh misoc:<sub-dir>
     make oldconfig context

  2. Clone the latest buildroot package into <some-dir>/buildroot

       git clone git@bitbucket.org:nuttx/buildroot.git <some-dir>/buildroot

     or

       git clone https://patacongo@bitbucket.org/nuttx/buildroot.git <some-dir>/buildroot

  3. cd <some-dir>/buildroot

  4. cp lm32-elf-defconfig-6.1.0 .config

  5. make oldconfig

  6. make

  7. By default, the tools will be at the absolute path:

       <some-dir>/buildroot/build_lm32/staging_dir/bin

     Or the NuttX relative path:

       ../buildroot/build_lm32/staging_dir/bin

     Make sure that he PATH variable includes the path to the newly built
     binaries.

  See the file boards/README.txt in the buildroot source tree.  That has more
  detailed PLUS some special instructions that you will need to follow if you
  are building a LM32 toolchain for Cygwin under Windows.  Also included in
  that README file is a FAQ of frequent build issues that their work-arounds.

  In order to use the buildroot toolchain, you also must set the following
  in your .config file:

    CONFIG_LM3S_TOOLCHAIN_BUILDROOT=y

boards/misoc/lm32/misoc/include/generated
===============================

  In order to build this configuration, you must provide the
  boards/misoc/lm32/misoc/include/generated directory.  It contains the generated
  Misoc files and may be a symbolic link.  The base configuration will NOT
  build without this directory!

  There is a sample generated directory at boards/misoc/include/generated-sample.
  If you want to do a test build without generating the architecture, then
  you can simply link this sample directory like:

    $ ln -s boards/misoc/lm32/misoc/include/generated-sample boards/misoc/lm32/misoc/include/generated

  That should permit a test build.