Commit Graph

1263 Commits

Author SHA1 Message Date
Gustavo Henrique Nihei
7f7416278d build: Deprecate NUTTXNAME variable
NUTTXNAME is used only as an alias for "nuttx", not actually a
configuration property. Its definition might erroneously imply that the
name of binary image may be configurable, which is not the case.
2021-02-06 07:18:46 -08:00
Abdelatif Guettouche
0e8cce4dee tools/esp32: Remove some duplicated output.
Redirect the first check of esptool to /dev/null as it will be printed
twice when esptool is called to convert the binary.

Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-02-03 19:19:07 -08:00
Gustavo Henrique Nihei
053a560aa1 esp32: Make esp32 boards share a common Config.mk with POSTBUILD command 2021-02-03 18:15:56 -03:00
Gustavo Henrique Nihei
afad13dfaa esp32: Refactor QEMU image generation on POSTBUILD 2021-02-03 18:15:56 -03:00
Matias N
c33040f0cf License/authorship handling scripts 2021-01-27 10:06:37 -05:00
Alin Jerpelea
a1378e7f21 tools: flash_writer.py: replace licenses with Apache 2.0
This change is a license change to Apache 2.0 license.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-01-25 04:34:41 -08:00
YAMAMOTO Takashi
c3a3fa7715 tools/esp32/backtrace.gdbscript: Add comments 2021-01-21 10:28:45 +01:00
Matias N
a150e03e24 gdbinit: add support for reporting total and used stack size
This checks if the required function is defined (when stack coloration
is enabled) and, if so, calls it to get used stack. Otherwise it just
reports zero used stack.
2021-01-16 21:33:42 -08:00
Alan C. Assis
0c5f71c849 boards/stm32f4discovery: Add a LWL board profile and improve the README.txt 2021-01-16 16:16:46 -08:00
Alan C. Assis
f62ff8d938 Move LWL python script to tools/lwl and add README.txt 2021-01-16 08:00:48 -06:00
Abdelatif Guettouche
f40389b359 tools/esp32/btdecode.sh: Script to decode the Xtensa backtrace. 2021-01-16 09:50:03 -03:00
YAMAMOTO Takashi
21c091f903 esp32: Add a gdb script to show backtrace
Just for my convenience. Hopefully useful for others too.
2021-01-14 09:23:36 +01:00
YAMAMOTO Takashi
fc7cddee39 Deal with "sed -i" portability
An empty extension for sed -i is not widely available.

* Where it isn't available (eg. macOS's sed) "sed -i -e" will
  create a backup file with the "-e" suffix.

* Even GNU sed documentation says it's "not recommended".

This commit deals with it by:

* Replace it with a more appropriate tool (kconfig-tweak)

* Or, specify the extension (.bak)
2021-01-11 08:38:19 +01:00
liuhaitao
82ff5b52f0 configure.sh: fix '/configure.sh -e board:config menuconfig' build break
If boardconfig changed, '/configure.sh -e board:config menuconfig'
would finally call 'make distclean menuconfig' which results in
build break. It also applies to nconfig and qconfig.

Change-Id: I44c06718cbda948932c667b9f2d1339913c9ba37
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2021-01-05 22:52:02 +01:00
kzhioki
223dd0dc8f tools/version.sh: Fix the version retrieved from git-tag
Fix an issue the wrong version could be retrieved from a private tag.
2021-01-03 03:04:11 -06:00
ligd
9ee04b5c53 tools/mkdeps.c: increase MAX_BUFFER to 8192
Change-Id: I0221194a647ff5083c951d682289793430e4268a
Signed-off-by: ligd <liguiding1@xiaomi.com>
2020-12-21 20:10:47 -08:00
Masayuki Ishikawa
39aa172957 tools: Fix version.sh
Summary:
- The latest version.sh retrieves version information from git tag
- However, if a repository contains private tags, it will fail
- This commit fixes this issue

Impact:
- version.sh only

Testing:
- Tested with https://github.com/masayuki2009/incubator-nuttx

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>>
2020-12-18 04:29:36 -06:00
Abdelatif Guettouche
076d89907f tools/version.sh: Fix the version retrieved from GIT.
Use the branch's tag if one exist otherwise use the most recent one.

Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2020-12-17 10:14:37 -08:00
John Bampton
ba12c6c0cf Fix spelling 2020-12-12 19:18:08 +01:00
John Bampton
7a5f7d470f Remove unneeded semicolons from Python files 2020-12-10 06:38:10 -06:00
liuhaitao
2bbb1f28d5 configure.c: add custom board path build support too
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-12-01 01:59:26 -06:00
liuhaitao
b044ec5a86 configure.sh: support custom board build with absolute path
Also add custom board build with absolute path support in addtion
to relative path.

Change-Id: I01bcb0b79db9e245484540c714036c64234b3656
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-12-01 01:59:26 -06:00
Matias N
88f1cdb915 build system: add missing --obj-path to MKDEP 2020-11-28 09:59:56 -06:00
chao.an
e5f5f6657d style/script: remove unnecessary trailing whitespace
N/A

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-28 12:20:30 +01:00
chao.an
c56785bd0d style/Makefile: remove unnecessary trailing whitespace
N/A

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-28 12:20:30 +01:00
Masayuki Ishikawa
03d461f7e2 tools: Add 'handle SIGUSR1' to nuttx-gdbinit for the NuttX sim SMP
Summary:
- The NuttX sim SMP uses SIGUSR1 for IPI
- However, gdb traps the signal by default
- With this commit, gdb just ignores this signal

Impact:
- NuttX sim SMP only

Testing:
- Tested with sim:smp

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-11-26 19:26:44 -08:00
Matias N
36088e8d21 Config.mk: fix CATFILE macro to work when file list is empty (Linux) 2020-11-26 17:35:04 +01:00
Brennan Ashton
b021375f2c Update checkrelease script for readme.md inread of .txt
Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
2020-11-26 02:25:32 -08:00
Masayuki Ishikawa
3c11825cda tools: Fix nuttx-gdbinit for armv7-m with FPU
Summary:
- Brennan reported the script does not work with nucleo-h743zi:otg_fs_host
- Actually, the config uses FPU but the script did not detect it
- The script assumed that the nuttx contains fpuconfig symbol
- However, this assumption was incorrect
- This commit fixes this issue by detecting FPU with tcb->xcp.regs

Impact:
- Cortex-M targets

Testing:
- Tested with lm3s6965-ek:discover (Cortex-M3)
- Tested with spresense:wifi_smp (Cortex-M4F)
- Tested with sim:smp (x86_64)

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-11-22 16:13:22 -08:00
Matias N
d5b6ec450f Parallelize depend file generation 2020-11-22 09:02:59 -03:00
Alin Jerpelea
48e6f2051d audio: libsamplerate: add initial audio Sample Rate Converter
Add audio sample rate conversion library from
http://www.mega-nerd.com/SRC/index.html

Source:
https://github.com/libsndfile/libsamplerate

Add needed patches for NuttX OS and embedded boards.

NOTE:
We must use master branch until next stable release
2020-11-19 18:05:47 -08:00
YAMAMOTO Takashi
5dd5174722 testbuild.sh: Add -C option to skip tree cleanness check
Build-testing a dirty tree is convenient during development.
2020-11-10 18:07:51 -08:00
YAMAMOTO Takashi
954115e097 nxstyle: Add more inttypes.h stuff to the whitelist 2020-11-05 15:19:31 +01:00
Alan C. Assis
30f862f651 Avoid messing the final binary nuttx.(bin,hex,...) compilation msg 2020-11-04 18:08:55 -08:00
Xiang Xiao
9208176f60 build: Move __NuttX__ definition to tools/Config.mk
ensure this critical macro get defined in all projects

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-11-02 13:22:39 -03:00
YAMAMOTO Takashi
1184502661 Retire CONFIG_WCHAR_BUILTIN
wchar_t is always a builtin type for C++.

Note: boards/arm/stm32/nucleo-f4x1re/scripts/Make.defs was broken.
(missing -)
2020-11-01 18:19:13 -08:00
Brennan Ashton
e56a7146c2 build: Fix testbuild.sh artifact copy on macOS
xargs for macOS does not support the '-a/--file-arg' flag so
build artifacts were not getting stored.  This change passes it in
via stdin which is more portable.

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
2020-10-29 00:14:19 -07:00
Brennan Ashton
162da1169e CI: Store artifacts durring build
Add new option -A is added to tools/testbuild.sh that will take the
created build executable and store it in a folder for the config
that generated it under $ARTIFACTDIR which can be set via an
environment variable or defaulted to $(TOPDIR)/buildartifacts

This is also helpful for local testing because you can now run
tools/testbuild.sh -A sim.dat and have all of the simulation
targets generated without having to rebuild along the way.

In the GitHub Actions workflow the artifacs are uploaded
two two bundles one for macOS and one for Linux

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
2020-10-28 11:32:21 -07:00
Alin Jerpelea
bc8ea75580 tools: cxd56: mkspk: automate mkspk build
the mkspk tool will automaticaly be built if CONFIG_CXD56_BINARY
is set.

Test:
nuttx.spk was succesfully generated

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2020-10-28 12:50:02 +01:00
Xiang Xiao
7901ad6959 tools/testbuild.sh: Support regular expression in blacklist
and prepend 'uname -s' to config for filtering config by host

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-10-28 00:18:03 -07:00
Xiang Xiao
1aed34182a tools/testbuild.sh: Don't support to change size_t type in datlist
since it doesn't need anymore with the follow patch:
commit e7d9260014
Author: Xiang Xiao <xiaoxiang@xiaomi.com>
Date:   Mon Feb 17 20:19:25 2020 +0800

    arch: Customize the typedef of size_t instead of intptr_t

    To ensure size_t same as toolchain definition in the first place and
    rename CXX_NEWLONG to ARCH_SIZET_LONG.  The change also check whether
    __SIZE_TYPE__ exist before CONFIG_ARCH_SIZET_LONG so our definition
    can align with toolchain(gcc/clang) definition automatically.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-10-26 21:45:11 -07:00
Matias N
04e8207e20 Add $(OBJS) and $(BIN) to CLEAN macro to clean objects also in subdirectories 2020-10-25 08:28:33 -07:00
liuhaitao
f2d9f5c43a configure.sh: update custom board config build
If Make.defs not found under boardconfig dir, then try
scripts/Make.defs.

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-10-22 11:12:10 -03:00
Xiang Xiao
897b61b057 build: Change .external_dummy to dummy
to better align with the arch, boards and drivers naming convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-10-20 10:26:17 -03:00
Sara Souza
fde7c2bc19 xtensa/tools: Updated makefile to download the IDF stable version 2020-10-20 13:36:43 +01:00
Xiang Xiao
eb4121ce38 Change all 'Nuttx' to 'NuttX'
Unify the naming convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-10-20 01:45:06 -07:00
liuhaitao
d5c6bfe6cf arch: Add custom arch chip build support
Just like custom board build support, add custom arch chip build
support.

Change-Id: I71c87e6b2195501a1b1d728b71d7cbe344951057
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-10-20 14:48:16 +08:00
Xiang Xiao
a49a3eae51 tools: Remove the special handle for Ubuntu under Windows 10
since the Native Linux support could be reused for this case:
https://lists.apache.org/thread.html/r315682ed20bbeb2f1403cf592f892ef009274423189ffc5b3841a6a9%40%3Cdev.nuttx.apache.org%3E

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-10-18 11:48:19 -07:00
Abdelatif Guettouche
609a5fa4f0 arch/: Add the ARCH_SRC directory to the context and clean_context
targets

Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2020-10-17 22:46:27 +09:00
Xiang Xiao
1e94367eb2 tools/Config.mk: Don't set HOSTEXEEXT to .exe for Ubuntu on Windows
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-10-16 18:03:38 +01:00
Fotis Panagiotopoulos
3eee887d87 Typo fix. 2020-10-06 19:44:56 -03:00
Xiang Xiao
09a2c37daf tools/parsecallstack: Fix the style issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-09-27 11:10:49 -07:00
qiaowei
0d761b6db1 tools/parsecallstack.py: A tool to parse the callstack
Signed-off-by: qiaowei <qiaowei@xiaomi.com>
Change-Id: Ieb13cdf6ca36c0858f66c79629f2a96d8845612e
2020-09-27 11:10:49 -07:00
liuhaitao
8685dcbfc5 [WIP] do DIRUNLINK in clean_context instead of in disctclean
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-09-27 08:20:35 -06:00
Xiang Xiao
6a84d96bca tools/mkdeps: Fix EOVERFLOW returned by stat when CONFIG_SIM_M32=y
by define _FILE_OFFSET_BITS to 64 described here:
https://man7.org/linux/man-pages/man2/stat.2.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I19c079294b79a541fbcc0bf5acbf7377067acf98
2020-09-25 20:41:22 -03:00
Masayuki Ishikawa
a92e394884 tools: Fix nuttx-gdbinit for armv7-m without FPU
Summary:
- I noticed that call stack for Cortex-M3 was incorrect
- This commit fixes this issue

Impact:
- Affects nuttx-gdbinit for armv7-m without FPU

Testing:
- Tested with lm3s6965-ek:discover (qemu)
- Tested with spresense:wifi
- Tested with sim

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-09-23 02:58:33 -07:00
Gregory Nutt
5ffb1c6a0b Fix Cygwin build broken by commit 34b34e2d45
Commit 34b34e2d45 uses the full path to libapps.a and introduced the use of the Make notdir command.  That command breaks the Cygwin build because when a native Windows toolchain is used, the full path to libapps.a is a Windows-sytle path and the Make notdir command (like most other GNU Make commands) fails if it is passed a Windows-style path.  This commit replaces the Make notdir command with the Bash basename command which can handle Windows paths.
2020-09-22 17:12:00 -03:00
Matias N
c695a5924f configure.sh/sethost.sh: add set -e so that the script aborts on any error 2020-09-16 20:09:44 -07:00
Xiang Xiao
6b7180fe87 tools/Config.mk: Replace tab with space
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-09-16 10:13:25 -07:00
Matias N
9ce4de634d support building external code into the OS, similar to how "external" apps work
This works by having the build system look for nuttx/external/Kconfig
to determine whether this directory is present or not. nuttx/external
is gitignored in order to be added by the final user but not to be
commited into the repo. Tipically this will by a symbolic link, just like
apps/external.

Inside external/ a Makefile should be placed with the same structure
than any nuttx/ subdirectory (eg: nuttx/drivers/). The
nuttx/external/Kconfig will be sourced and any options defined there will
appear at the bottom of menuconfig (unless options are conditioned on
menus, in which case they will appear accordingly).

The purpose is to allow arch/board independent code, which for any
reason is not to be upstreamed (propietary, not relevant for mainline,
testing, etc), to be built into the OS during OS building stage. This
way the user does not need to fork the NuttX repo to do so. This feature
complements well with external apps and custom board support.
2020-09-15 21:14:46 -07:00
Matias N
166242c171 use "export" to expose TOPDIR to all child make instead of passing it around every time 2020-09-15 21:11:33 -07:00
Matias N
34b34e2d45 Fix: ensure archive files do not carry object files from prior builds
In some cases, when NuttX configuration changes and this makes the
object list used to build one of the .a libraries change as well,
since the command used to build it is "ar crs" and this simply appends
the list of object files, the library could still include object
files from prior builds. This commit modifies the ARCHIVE macro to
erase the .a file if it already exists.

Since in some cases this behavior was actually expected (object
files from a subdirectory were appended to a library created one
level above) I added a ARCHIVE_ADD which works as ARCHIVE did.

This change should greatly improve behavior of building after
configuration changes.
2020-09-14 15:54:18 +08:00
Matias N
7d16090d11 Fix testbuild.sh to actually fail when using -x. Leave -x out for CI
so that we detect all possible build errors for a job.
2020-09-13 10:29:13 -07:00
Xiang Xiao
b0797263ca libc/stdio: Allocate file_struct dynamically
1.Reduce the default size of task_group_s(~512B each task)
2.Scale better between simple and complex application

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ia872137504fddcf64d89c48d6f0593d76d582710
2020-09-11 17:58:17 +08:00
Masayuki Ishikawa
2c8aa8629e tools: Add nuttx-gdbinit for nuttx thread debugging
Summary:
- This commit enables nuttx thread debugging without openocd-nuttx
- To use this script, gdb must support python
- To show all thread, use 'info_nxthreads'
- To switch thread, use 'nxthread pid'
- To continue, use 'nxcontinue'

Impact:
- No impact

Testing:
- Tested with spresense (Cortex-M4F), sim (x86_64), lm3s6965-ek (Cortex-M3)
- Tested with GNU Tools for Arm Embedded Processors 9-2019-q4-major
- Tested with GNU gdb (Ubuntu 8.1-0ubuntu3.2) 8.1.0.20180409-git

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-09-10 08:53:15 +02:00
Johannes Schock
77b32a721d Removed -w option from MKEXPORT_ARGS. 2020-09-05 21:25:31 +08:00
Brennan Ashton
6d3269a69d CI: Fix check patch to handle renames / deletes
Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
2020-09-03 20:05:57 -03:00
Ouss4
7c83c63d8e tools/configure.sh: Add -L option to list all available
configurations.
Mention this option when Make is run on an unconfiugred project.
2020-09-02 17:19:34 -07:00
Xiang Xiao
528cfb8457 tools/mkexport.sh: Remove WINTOOL and related option
since it isn't used anymore after:
commit bd656888f2
Author: Xiang Xiao <xiaoxiang@xiaomi.com>
Date:   Mon May 18 22:18:15 2020 +0800

    build: Replace WINTOOL with CYGWIN_WINTOOL Kconfig

    so the correct value can be determinated by Kconfig system automatically

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-31 09:54:13 +02:00
Xiang Xiao
ae356001cf Change all files come from Xiaomi/Pinecone to Apache License 2.0
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-22 17:37:21 -06:00
Ouss4
f2af90d1bd tools/configure: Align the .c and the .sh versions. 2020-08-21 21:23:13 -05:00
Ouss4
1c295aff19 tools/configure.sh: Don't distclean if no config was already in place. 2020-08-21 21:23:13 -05:00
Gustavo Henrique Nihei
b90c8914f3 tools/configure.sh: Create -E command for distcleaning regardless of
configuration changes

According to the usage documentation, [-e] option should "enforce
distclean if already configured". This behavior was broken due to the -e
option being evaluated only if the current defconfig is different from
the backup defconfig. The new -E command inherits this behavior.
2020-08-20 15:53:16 +01:00
Xiang Xiao
d43bf7717e sched: Support config the argument passed to init
it is useful to pass the nonempty argument to change the init task behaviour

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I684e9c76b9eac54404d0e4e63ab78e51e039c9a8
2020-08-17 12:52:28 -06:00
Gustavo Henrique Nihei
c9748395f8 make/export: Fix mkexport silently failing on missing tools 2020-08-13 16:13:32 +01:00
Gregory Nutt
b256b2055f Add support to hard links to CROMFS
This will resolve numerous problems with the way that hard links, in particular "." and ".." are handled.  Instead of trying to fudge the stat flags, the correct implementation is to follow the hard link to the final link target node.  That is what must determine the attributes of the directory entry.
2020-08-11 07:48:08 -07:00
David Sidrane
562be9e4c7 gencromfs:Fix mode flags seperate code points for DIR LNK 2020-08-10 11:04:13 -06:00
Xiang Xiao
8807a52de6 tools/gencromfs: Change the generated code to Apache license
and ensure the code confirm the coding style

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-09 14:43:56 +01:00
Xiang Xiao
4de69080d0 tools/gencromfs: Call dump_nextline immediately after dump_hexbuffer
to handle the temporary file switch correctly

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-09 14:43:56 +01:00
David Sidrane
b6194bc0bf tools/gencromfs: partial fix coding standard violation
Remaining violation seem to be an issue with the
   tool parsing  outptr[- lit - 1] = lit - 1
2020-08-06 08:36:03 -05:00
David Sidrane
fbd5712761 Fix Breakage from 91ed14c6
PR 1372 vfs/stat: Make the flag defintion more confirm POSIX
   standard. Silently broke the cromfs. This was due to the
   necessary replication of the S_xxxx flags of the NuttX
   sys/stat.h. The unfortunate outcome was most likely caused by
   fact, that a grep of S_xxxx did not match the tools/gencromfs.c

   To insure this sort of thing does not happen again, comments
   have been added the will match search.
2020-08-06 08:36:03 -05:00
Ouss4
e79298bc34 tools/Config.mk: Unquote the custom board path before using it in
Makefile functions.
2020-07-30 00:10:29 -05:00
Ouss4
708daf2c3d tools/Config.mk: Remove CONFIG_ARCH_BOARD from BOARD_DIR when using a
custom board.

Custom boards don't set CONFIG_ARCH_BOARD since the full path is given
during configuration.
Furthermore this creates problems when when referencing other
folders using BOARD_DIR because a trailing DELIM will be present.
2020-07-30 00:10:29 -05:00
Xiang Xiao
6be8dd420c tools/incdir: Fix the memory leak
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I9bf57071b5e967a3db55c7e473e84a8bad44cd2a
2020-07-23 15:49:08 +01:00
YAMAMOTO Takashi
9f8d52830f tools/incdir: Assume GCC compatibility for unknown compilers
A use case:
    intercept-build --override-compiler make CC=intercept-cc
    cf. https://github.com/rizsotto/scan-build
2020-07-23 00:55:24 -05:00
Nakamura, Yuuichi
376786288e Create wrapper library for system call instrumentation 2020-07-22 12:01:40 -05:00
Xiang Xiao
5ce84693d3 tools/mksyscall: Fix warning: '__builtin_strncpy' specified bound 256 equals destination size
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-20 17:10:37 +01:00
Xiang Xiao
17bd5f3d1a tools/checkrelease.sh: auto import KEYS from the release server
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-18 11:29:27 -07:00
Xiang Xiao
ac7e5de5ae libxx: Integrate uClibc++ latest official release
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I05377a0a7674f1cbe461ce67960bd3dc62729337
2020-07-17 21:40:34 +01:00
Ouss4
34bcf39c68 tools/configure.c: Don't redirect the output of make. 2020-07-17 10:14:42 -05:00
Xiang Xiao
4910d43ab0 build: Move the toolchain library setting to the common place
so all boards support C++ automatically
2020-07-16 15:38:08 -03:00
liuhaitao
fc2e785165 testbuild.sh: suppress logs from configure stage in testbuild.sh
Since testbuild.sh called by nightly build and check build, it should
suppress logs from configure stage to keep all output clean.

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-07-16 15:40:46 +01:00
liuhaitao
67589adfb7 sethost.sh: always print logs to ease identify problem in configure phase
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-07-16 15:40:46 +01:00
Xiang Xiao
ee875b2a26 boards: Move HOSTCC/HOSTCFLAGS to tools/Config.mk
Make.defs under board folder can still overwrite the default as needed

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I1c300a8ace4b54d475ef8d398661ed65ca273a2e
2020-07-15 19:14:58 +01:00
Adam Feuer
11a8c3e035 checkrelease.sh now tries to build sim:nsh
Squashed commit of the following:

commit 2b7e2ef927462f492b94ce0f8f1ae248a4ff1609
Author: Adam Feuer <adam@starcat.io>
Date:   Wed Jul 15 10:15:37 2020 -0700

    remove duplicate method from bad merge

commit 31846cfcb5c61804ede3a31159c58dc9e627761e
Author: Adam Feuer <adam@starcat.io>
Date:   Tue Jul 14 14:20:36 2020 -0700

    fix --dir option by doing cp "$DIRECTORY"/* .

    - instead of cp "$DIRECTORY" .

commit 01d23a1a0bbaaf74f26c0589705b1f4a41c755bf
Author: Adam Feuer <adam@adamfeuer.com>
Date:   Tue Jul 7 15:08:59 2020 -0700

    changes from xiaoxiang781216

    - remove verbose option
    - simplify

commit 3db107e6fdebfbf9b2afa16bfe89c846d1ec7352
Author: Adam Feuer <adam@starcat.io>
Date:   Tue Jul 14 10:39:42 2020 -0700

    simplify wget invocation; add slash to all URLS

commit fa6b14a649cd311e8316368992a709460823e756
Author: Adam Feuer <adam@starcat.io>
Date:   Tue Jul 14 10:19:26 2020 -0700

    quitting directly after unknown argument

    - with usage
    - also removed unneeded echo
    - as per PR feedback

commit bfda65a347a85959d516f05ba579b5539e953816
Author: Adam Feuer <adam@starcat.io>
Date:   Mon Jul 13 13:44:42 2020 -0700

    streamline argument processing as per PR feedback

commit b6a8d77ef8000a9be71d044aa929b309e8baca72
Author: Adam Feuer <adam@starcat.io>
Date:   Thu Jul 9 21:47:51 2020 -0700

    PR feedback changes

    - many

commit abf89d2ec28b0386d3dc4117e449c2f5893fca54
Author: Adam Feuer <adam@adamfeuer.com>
Date:   Tue Jul 7 18:22:20 2020 -0700

    added --gpg-output / -G flag

    - to see GPG output

commit f0711df27e5eca2d1b9499d8c7532fc75cb0bc39
Author: Adam Feuer <adam@adamfeuer.com>
Date:   Tue Jul 7 18:13:14 2020 -0700

    quiet wget; check URL exists before downloading

commit 9bc97e7c0dfe0d392e39f11419081cf48db3b8fd
Author: Adam Feuer <adam@adamfeuer.com>
Date:   Tue Jul 7 15:08:59 2020 -0700

    checkrelease.sh script now builds sim:nsh

    Squashed commit of the following:

    commit 80d270b4d50ec10d912e7a67a0e86efe8ca95e98
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Tue Jul 7 15:06:48 2020 -0700

        checkrelease script can use url, release, or dir

    commit 6a7e8e3210d671d6aa2c60bd8a50701839924cf4
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Tue Jul 7 11:06:28 2020 -0700

        try to build sim:nsh

    commit 2cf777e062b99c8b3cb7184f55d1f82769c8f989
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Tue Jul 7 10:21:31 2020 -0700

        improved success and error messaging
2020-07-15 12:50:40 -05:00
Xiang Xiao
d32e9c38df boards: Move the C/C++ search path to the common place
so all boards support uClibc++/libc++ automatically

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ibe6fafbec57f7acb26ea6188a3e9923ea82295c5
2020-07-13 15:11:12 -03:00
Xiang Xiao
cfc58d1913 nxstyle: Add some unwind name to the white list
we can't change the case because it is defined by ARM

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-11 10:34:22 -07:00
Ouss4
1a523e5519 tools/zipme.sh: Remove the option to exclude patterns based on the VCS'
"ignore" file.
2020-07-06 20:11:13 -07:00
Adam Feuer
b994d1f0b6 fixing problem with trap not removing tempdir
- needs to be in original dir to work
2020-07-06 21:24:19 -05:00
Adam Feuer
1076b748a2 changed header comment filename to match current 2020-07-06 21:24:19 -05:00
Adam Feuer
dbc025bb88 add examples to usage info
- as per PR feedback
2020-07-06 21:24:19 -05:00
Adam Feuer
ef3ba54c9c cleanup unneeded cd and rm commands 2020-07-06 21:24:19 -05:00
Adam Feuer
5fb9356eca changing script name to match checkpatch.sh
- as per PR feedback
2020-07-06 21:24:19 -05:00
Adam Feuer
407c5db66b check-release-candidate.sh script
Squashed commit of the following:

commit 40b788f8a0e79aa90734813a557c17f90fb9cdbe
Author: Adam Feuer <adam@adamfeuer.com>
Date:   Sat Jul 4 14:45:13 2020 -0700

    updated license header to APL 2.0; updated usage

commit 81984aeeb503d90f30cb1d0c62a888e2a23235ed
Author: Adam Feuer <adam@adamfeuer.com>
Date:   Thu Jul 2 18:32:05 2020 -0700

move tar.gz files to current dir

- for convenience, so user can untar them and build

commit e1a3100402e39703ea08daa16e2388d4572413dc
Author: Adam Feuer <adam@adamfeuer.com>
Date:   Wed Jul 1 13:17:37 2020 -0700

added trap; copyright header; can take release name

- instead of URL, optionally

commit e0109214c5b887b4b662120ce59c59520d8a5918
Author: Adam Feuer <adam@adamfeuer.com>
Date:   Wed Jul 1 12:54:54 2020 -0700

trap and remove tempfile; set -e to catch errors

commit 196dc4ca4285b821cce644561296a2034e9a671e
Author: Adam Feuer <adam@adamfeuer.com>
Date:   Wed Jul 1 12:15:01 2020 -0700

using wget recursive and cut-dir to download files

- as per PR feedback

commit 127c22bbc14cabe2a59b238b75c21711b000e41b
Author: Adam Feuer <adam@adamfeuer.com>
Date:   Wed Jul 1 11:35:01 2020 -0700

intial addition
2020-07-06 21:24:19 -05:00
chao.an
9d7856192b make/POSTBUILD: make BIN directory configurable
enhance the post build can support configurable BIN directory

Change-Id: I64f286b6eb5ed77e91b67a27d815d62c345ac589
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-07-02 12:29:16 +01:00
chao.an
30d2b6c89c make/export: export post build script
post build processing is also necessary for import compilation

Change-Id: Ie27e25b84e2212e9c86358c30ca1a5b7c2adffc5
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-07-02 12:29:16 +01:00
chao.an
628a352973 make/export: use LDNAME instead of LDSCRIPT
use LDNAME instead of LDSCRIPT to avoid invalid native path
exported to the import build

Change-Id: I1ba3cfdbfca02447941dc32a292fe4d76c1ced04
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-07-02 12:29:16 +01:00
chao.an
b8e5755568 make/version: correct the version generation
incorrect version generation by commit 3ec12a84c2

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-30 14:51:18 +02:00
chao.an
b896da25c7 make/export: copy incdir.c for export build
export build break by commit 5555070fc3

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-30 10:28:56 +02:00
Xiang Xiao
23e0134954 mksyscall: Fix warning "variable 'i' is used uninitialized"
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-06-29 14:12:58 +01:00
Alin Jerpelea
294fdd80a9 tools: cxd56: nxstyle fixes
nxstyle fixes to pass the CI checks

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2020-06-29 13:36:18 +01:00
Alin Jerpelea
5de436b872 tools: cxd56: mkspk: fix out of tree MAC build
The local copy of elf headers is needed for the MAC systems which miss the ELF headers.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2020-06-29 13:36:18 +01:00
Xiang Xiao
b2f3a4b5f9 tools/nxstyle: Support the white list
and add _Exit to the white list

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-06-28 21:07:57 +01:00
chao.an
fd3be9eb37 make/export: support export extra library
Change-Id: Iaab5dc8fd61b55888dad59d9b1d8380d7bd44a58
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-27 22:45:41 +01:00
chao.an
41f434015b make/export: do not extract object from librarys
To avoid overriding of objects with duplicate file name

Change-Id: I83c964d161d23942cd3fc29eb738da44775cfc10
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-27 22:45:41 +01:00
chao.an
e82a9e0f48 make/export: copy mkdeps.c for export build
Change-Id: Ic1aa04d5d4dd2332cf4a13ec51c76cdb7d90736c
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-27 22:45:41 +01:00
chao.an
98f0b0afb5 build/export: correct the export path
Change-Id: Ia2e19f30d32154c3329f46c5d8362fafd6b7e274
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-27 22:45:41 +01:00
Xiang Xiao
f3c046175d tools/version.sh: Make it invokable from everywhere
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-06-23 00:49:27 -07:00
Xiang Xiao
8b9876830e tools/zipme.sh: Add executable bit
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-06-23 00:49:27 -07:00
Xiang Xiao
9bf4b55073 tools/zipme.sh: Don't move the directory to nuttx/Documentation
and remove the redundancy of "cd ${TRUNKDIR}"

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-06-23 00:49:27 -07:00
Xiang Xiao
062373af20 tools/zipme.sh: Fix the typo error
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-06-23 00:49:27 -07:00
David Sidrane
3ec12a84c2 Makefile.unix:versioning insure it is a .git dir
An out-of-tree build may have a .git file that is from a
  submodule. Once we find a .git file check if this is
  really a working dir.
2020-06-18 10:29:51 +08:00
Xiang Xiao
dde25b0f80 tools/nxstyle: Fix AddressSanitizer error
=================================================================
==2474==ERROR: AddressSanitizer: stack-buffer-underflow on address 0x7fffb7e59b5f at pc 0x561fffec79f6 bp 0x7fffb7e59ac0 sp 0x7fffb7e59ab0
READ of size 1 at 0x7fffb7e59b5f thread T0
    #0 0x561fffec79f5 in block_comment_width /home/xiaoxiang/mirtos/nuttx/tools/nxstyle.c:355

Address 0x7fffb7e59b5f is located in stack of thread T0 at offset 31 in frame
    #0 0x561fffec7b90 in get_line_width /home/xiaoxiang/mirtos/nuttx/tools/nxstyle.c:419

  This frame has 1 object(s):
    [32, 544) 'line' (line 420) <== Memory access at offset 31 underflows this variable
HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork
      (longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-buffer-underflow /home/xiaoxiang/mirtos/nuttx/tools/nxstyle.c:355 in block_comment_width
Shadow bytes around the buggy address:
  0x100076fc3310: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100076fc3320: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100076fc3330: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100076fc3340: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100076fc3350: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x100076fc3360: 00 00 00 00 00 00 00 00 f1 f1 f1[f1]00 00 00 00
  0x100076fc3370: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100076fc3380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100076fc3390: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100076fc33a0: 00 00 00 00 00 00 00 00 00 00 00 00 f3 f3 f3 f3
  0x100076fc33b0: f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==2474==ABORTING

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ie7dee3cdfdbbd04ea9cdb58e227afef07073cecd
2020-06-16 09:56:22 -06:00
Brennan Ashton
0430c6ccc8 Add problem matching for gcc and nxstyle to github actions 2020-06-11 00:52:55 +08:00
YAMAMOTO Takashi
44585eeaf8 mkdeps: Use %zu/%zd printf format instead of casts 2020-06-03 18:30:36 +08:00
YAMAMOTO Takashi
16884407eb mkdeps: Quote CFLAGS to be safe with the shell
mkdeps uses system() thus a shell to execute cc.
it doesn't work if you have something like

    CFLAGS   += -DMBEDTLS_USER_CONFIG_FILE="<mbedtls/user_config.h>"

because the shell interprets "<" as a redirect.

to fix it, we should do either

    * make it shell-quote arguments

    * or, stop using system()

this commit implements the former.

some platforms provide easy ways to do the former.
eg. https://netbsd.gw.com/cgi-bin/man-cgi?shquote++NetBSD-current
but unfortunately none of them seems available widely.

i guess the latter approach is more common.
eg. 4464250282/usr.bin/mkdep/mkdep.c (L137-L154)
but i might be a burden for windows. (i don't know)
2020-06-03 18:30:36 +08:00
Gregory Nutt
0da3400009 ez80: Fix ez80 build problems.
arch/z80/src/Makefile:  Correct inclusion of non-existent file.  This was not a problem before because there was '-' before the include.  Problem revealed with '-' removed.

arch/z80/src/ez80/Toolchain.defs:  Apparently there are not too many '"' in path definition.

tools/incdir.c:  No space between -usrinc:  or -sysinc:  and the list of paths.
2020-06-02 13:20:51 -03:00
Gregory Nutt
18e4ab99cb Makefile: Build the tools/incdir binary immediately.
Before any other Make logic can be used, we must immediately build the tools/incdir binary.  It will be used as soon as Make.defs is included and will generate errors otherwise.

Remove the other locations in the tools/incdir binary was being build from tools/Makefile.unix and tools/Makefile.win
2020-05-31 15:05:23 +01:00
Ouss4
e018309e47 tools/Makefile*: Clean tools binaries at the end of distclean. 2020-05-31 15:05:23 +01:00
Gregory Nutt
e92c91cf09 tools/incdir.c: Various fixes to get a clean build
1. If config.c is compiled on any platform other than Cygwin, then the variable wintools is not used.
2. Add more debug output so we can see what is going on in the PR checks.
2020-05-30 01:05:34 +01:00
Gregory Nutt
5555070fc3 tools/: Hook incdir.c into build system.
incdir.c was added in PR 1148.  This PR hooks it into the build system.
2020-05-30 01:05:34 +01:00
Gregory Nutt
981734e577 tools/Makefile.host: Add incdir binary to Makefile.host
This was missed in PR 1148
2020-05-30 01:05:34 +01:00
Gregory Nutt
b111e135e0 tools/incdir.c: Add faster, C version of incdir.sh 2020-05-29 17:16:42 -03:00
liuhaitao
102c4c25e2 tools/testbuild.sh: Call makefunc with JOPTION directly
Also call configure.sh with JOPTION to enable parallel build

Change-Id: I32c4e77fb30c40d8d424159cc0871b8c3e3f10b6
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-05-28 20:01:45 +08:00
liuhaitao
b5dc83748c build: Update make dependency to enable 'configure.sh config' parallel build
Note that 'configure.sh config -jn' with parallel build could reduce configure stage
time.

Change-Id: I3d63f1e316a7bc3437fc6c6c2da13c5313e69694
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-05-28 20:01:45 +08:00
liuhaitao
954d251dfe build: make sure nuttx bins generated after both pass1 and pass2 built done
Create the final NuttX executables after pass1 user libs and pass2 nuttx
libs built finished.

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-05-27 06:28:05 -06:00
liuhaitao
6a9b3de0bb tools/testbuild.sh: fix testbuild.sh called without -e option fail issue
As in https://github.com/apache/incubator-nuttx/issues/1114 discuss, let
EXTRA_FLAGS="EXTRAFLAGS=" defaultly to avoid testbuild.sh called without
-e option fail issue. It also works well with -e "-Wno-cpp -Werror".

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-05-26 07:03:21 -06:00
liuhaitao
56e7a906e5 build: exit normaly once catch 'make depend' and 'make context' failure case
To be strict in check build, once any 'make depend' or 'make context' fails, exit normally.

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-05-26 15:39:34 +08:00
Xiang Xiao
8b20b97d26 build: Remove the dummy drivers folder under boards
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-24 20:20:12 +01:00
Xiang Xiao
e83c1400b6 build: Move BOARD_DIR definition to common place
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-24 20:20:12 +01:00
Xiang Xiao
7e5b0f81e9 build: Replace -I with INCDIR
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-24 20:20:12 +01:00
Xiang Xiao
dd61d3d9f9 build: Remve the unnecessary .gitignore
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-23 18:00:40 +01:00
Xiang Xiao
02e028a595 tools/mkdeps: Fix the nxstyle problem
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-23 09:27:36 -06:00
Xiang Xiao
d2bb9bf2b4 tools/mkdeps: Always look in the current directory
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-23 09:27:36 -06:00
Xiang Xiao
2a2ffe41dd build: incdir.sh shouldn't check whether the path exist
since compiler never complain that the path(by -I) doesn't exist

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-23 09:27:15 -06:00
liuhaitao
adc0c3e459 build: parallel clean and distclean subdir build
Use absolute path for APPDIR which could be used by apps clean
and distclean subdir build. Parallel clean and distclean subdir
could save more build time.

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-05-22 12:35:46 +01:00
Xiang Xiao
1a95cce1a3 build: Move .config check to the top Makefile
remove the workaround to handle the inexistence of .config/Make.defs

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-20 17:57:34 +01:00
Gregory Nutt
3b62765edd nxstyle: Fix distinction be source and header file for long lines.
For some unknow reason, long lines were reported as WARNING is header files, but as ERRORS in C source file.  There are errors where ever they occur.
2020-05-19 20:09:57 -04:00
YAMAMOTO Takashi
48da64f9c2 Redo "Fix make target dependencies"
Change-Id: I7180145d90913fd3acc94487b9f7b9753dcdc8da
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-05-19 19:23:54 +01:00
Xiang Xiao
7faf3c0254 build: replace ${TOPDIR} with $(TOPDIR) in Makefile
make the usage consistence

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-19 19:23:18 +01:00
Xiang Xiao
567962bd62 build: Move the extension definition to common place
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-19 19:23:18 +01:00
Xiang Xiao
5e7342bcf4 build: Move V definition to common place
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-19 19:23:18 +01:00
Xiang Xiao
8b42ee421a build: Move MKDEP definition to common place
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-19 19:23:18 +01:00
Xiang Xiao
9ec9431706 build: Move DIRLINK/DIRUNLINK definition to common place
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-19 19:23:18 +01:00
Xiang Xiao
6e94effeed build: Make all variables inside Configs.mk overwritable
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-19 19:23:18 +01:00
Xiang Xiao
6c4ef7b1db build: mkexport.sh copy Config.mk to tools folder too
to avoid the duplication in apps/imports/Make.defs

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-18 21:36:58 -06:00
Nathan Hartman
3334b40aef nxstyle: Allow Hz, KHz, GHz in identifiers
Per the coding standard, we allow MHz as one of the few allowed
exceptions to the identifier case rules.

However, because this exception specifically looked for "MHz" we
would generate undeserved nxstyle errors for Hz, KHz, GHz.

This change adds recognition of any Hz value by eliminating the
requirement for Hz to be preceded by M.

tools/nxstyle.c:

    * main(): Eliminate requirement for Hz to be preceded by M to
      match the rule for allowed mixed case identifier. Update
      relevant comments.

See:
https://cwiki.apache.org/confluence/display/NUTTX/Coding+Standard#macros

Mailing list discussion archived at:
https://lists.apache.org/thread.html/r481b9d145f439c24c8d70992081bf670bc0e893167149e0017519439%40%3Cdev.nuttx.apache.org%3E
2020-05-18 18:00:10 -06:00
Xiang Xiao
5eae32577e build: Move INCDIROPT to common place
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-18 15:02:55 -06:00
Xiang Xiao
bd656888f2 build: Replace WINTOOL with CYGWIN_WINTOOL Kconfig
so the correct value can be determinated by Kconfig system automatically

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-18 15:02:55 -06:00
Xiang Xiao
3f83d2da30 tools/refresh.sh: replace cmpconfig with diff
since we want to catch the order difference too

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-11 12:24:58 -06:00
Xiang Xiao
b4dceaa88c tools/refresh.sh: shouldn't redirect "make oldconfig" to /dev/null
since kconfig need interact with user to make the selection

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-11 12:24:58 -06:00
Xiang Xiao
a6c82a27db tools/mksyscall: Unify the fixed and variable arguments process
Signed-off-by: Xiang Xiao <iaoxiang@xiaomi.com>
2020-05-08 10:38:05 -06:00
Xiang Xiao
e7e81dd74d tools/LibTargets.mk: Remove # from the action of syscall
this typo error make libstub.a is compiled without __KERNEL__

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-08 10:38:05 -06:00
liuhaitao
2c9f91205f tools/pic32: update pic32 scripts to fix jobserver unavailable warning
Always build mkpichex to make sure it newest, also correct target name.

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-05-07 11:19:25 -03:00
Gregory Nutt
6906853f8e Improve proxy/stub parameter passing for variadic OS interfaces.
In the past a very low effort interface was used:

- All parmeters were treated as though they were type uinptr_t, and
- The maximum number of parmeters (6) was passed in all cases.

The first is potentially wrong and the second is very inefficient.  This commit improves this by:

- Making tools/mksyscall.c more intelligent, and
- Extending the syntax for variadic functions.

For example, in syscall.cvs, the open() API was represened like this:

    "open","fcntl.h","","int","const char*","int","..."

In reality, open may take only a single optional argument of type mode_t which is not the same size as uintptr_t.  And there is not reason to pass 6 parameters in that case.

And this has been extended to:

    "open","fcntl.h","","int","const char*","int","...","mode_t"

The existence of the "mode_t" tells tools/mksyscall that there is at most one optional parameter and, if present, it is of type mode_t.
2020-05-06 01:00:43 +01:00
YAMAMOTO Takashi
19cc84ed4a sim: Suppress no symbol warnings for macOS 2020-05-05 21:40:16 +08:00
Xiang Xiao
a2f657e4cb build: Move KDEFINE to a common place(tools/Config.mk)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-01 15:56:55 -06:00
Xiang Xiao
4b1dab84d1 tools/LibTargets.mk: Pass EXTRAFLAGS to all sub make
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-01 15:56:55 -06:00
Xiang Xiao
f2aba8d9b7 build: Remove 'u' prefix from userspace library
so user needn't link the different library because the build type change

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-01 15:56:55 -06:00
Xiang Xiao
eca7059785 Refine __KERNEL__ and CONFIG_BUILD_xxx usage in the code base
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-01 10:43:47 -03:00
liuhaitao
6b4cc3011c Remove the residual files in distclean
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-05-01 04:43:15 +01:00
liuhaitao
97afe1c402 tools/refresh.sh: restore BOARD_DIR when refresh with a different host
There is case as below:
When do testbuild under Linux host, such as './tools/configure.sh stmf4discovery:nsh',
arch/arm/src/board is a symlink to boards/arm/stm32/stm32f3discovery/src. Then do
'./tools/refresh.sh --silent stmf4discovery:nsh' after build, it would break the board
symlink with copydir.sh instead of link.sh since defconfig with Windows host config.
So call sethost.sh to restore BOARD_DIR. Or it results in 'make distclean' not correctly.

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-04-28 21:28:15 -07:00
Xiang Xiao
f2f1d4de85 toots/testbuild.sh: Remove .version manually after distclean
since distclean has to keep this file for the release package

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-28 21:28:15 -07:00
Xiang Xiao
ee9daea586 Remove the residual files in the distclean action
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-28 21:28:15 -07:00
Xiang Xiao
0932f08b93 tools/zipme.sh: Let major.minor.patch argument optional
since version.sh can generate this information for us

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-28 18:34:49 +01:00
Xiang Xiao
7ffccf738c Makefile: Remove KERNEL variable which isn't really used
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-28 09:01:58 -06:00
Gregory Nutt
100bd740cd tools/sethost.sh: Correct error in setting a different host.
In an older PR, the standard kconfig-tweak calls were replaced with sed edit.  This is an incorrect change and results in invalid configurations.  This change restores the use of kconfig-tweak and always generates correct configurations.

This change resolves issue #386

sed edits do not handle all of the dependencies correct and generates invalid configurations.  Most defconfig files specify Linux by default, so you will only see the effect of the corruped configuration when sethost changes changes to a different configuration.  Then, when 'make olddefconfig' is subsequentyly run, the corruption in the defconfig file is reflected by warnings such as:

   $ tools/configure.sh -c stm32f4discovery:nsh
      Copy files
      Select CONFIG_HOST_WINDOWS=y
      Select CONFIG_WINDOWS_CYGWIN=y
      Refreshing...
    .config:62:warning: override: reassigning to symbol HOST_WINDOWS
    .config:62:warning: override: HOST_WINDOWS changes choice state

Those warnings are eliminated by this changed.

Tested by repeatedly doing:

  tools/configure.sh -c stm32f4discovery:nsh
2020-04-27 21:26:21 +01:00
Gregory Nutt
e11c1e7cb3 tools/incdir.sh: Correct error in select of include path
Commit 3b9efc95a2 introduced an error in the generation of include file paths.  The logic that determined if cygpath should be called to create a Windows native path for the case of Cygwin using a native toolchain was incorrect.  This corrects this warning:

 ./tools/configure.sh -c sim:nsh
$ make
<CUT>
make[1]: Entering directory '/home/btashton/apache/apps'
make[2]: Entering directory '/home/btashton/apache/apps/builtin'
./exec_builtin.c:54:10: fatal error: builtin/builtin.h: No such file or directory
   54 | #include "builtin/builtin.h"
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
ERROR: cc failed: 1
       command: cc -MT ./exec_builtin.home.btashton.apache.apps.builtin.o  -M -Wall -Wstrict-prototypes -Wshadow -Wundef -g -fno-builtin -fno-common -I. -isystem /home/btashton/apache/nuttx/include -D__KERNEL__ -pipe -I C:\cygwin64\home\btashton\apache\apps\include ./exec_builtin.c
make[2]: *** [/home/btashton/apache/apps/Application.mk:224: .depend] Error 1
make[2]: Leaving directory '/home/btashton/apache/apps/builtin'
make[1]: *** [Makefile:67: /home/btashton/apache/apps/builtin_depend] Error 2

In this case a Cygwin POSIX toolchain is being used by the path in the CFLAGS to apps/include is incorrectly a Windows native path.  This error is corrected by this change to tools/incdir.sh
2020-04-27 16:11:26 +01:00
Gregory Nutt
6168f3ebf0 Remove tools/logparser.c
Remove tools/logparser.c.  This tool converted 'git log' output into the format used by the obsoleted ChangeLog files.  Since the ChangeLog files are obsoleted, the tool servers no purpose.
2020-04-24 20:55:08 +01:00
liuhaitao
fe0ba38580 fs/littlefs: upgrade littlefs to v2.2.1
Since littlefs is in active development, it's not a good idea to use its
source code files directly. So upgrade littlefs v2.2.1 by using the littlefs
tar.gz release package instead.

Change-Id: I16d9cf0b6bca700a54ca86ed11d7c8c7f27a898f
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-04-23 09:31:21 -06:00
Xiang Xiao
fc8522cc97 tools/testbuild.sh: check status after make distclean
ensure the distclean remove all generated stuff

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-21 16:15:48 -06:00
Xiang Xiao
816f624819 tools/Makefile.host: Initialize Q by inspecting V
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-20 07:07:32 -06:00
Xiang Xiao
95e5506637 tools/testbuild.sh: Verify nuttx/apps folder clean after build
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-20 07:07:32 -06:00
Xiang Xiao
48e6b97ca7 tools/testbuild.sh: Check defconfig in the canonical format
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-20 07:07:32 -06:00
Xiang Xiao
c153c31fbd tools/refresh.sh: Save defconfig and exit with 1 only when the difference exist
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-20 07:07:32 -06:00
Xiang Xiao
5c1497aeb1 tools: Remove the temp variable in checking program exit code
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-20 07:07:32 -06:00
Xiang Xiao
cf674ed51c checkpatch.sh: Simplify the code logic, no functional change
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-20 07:07:32 -06:00
Ouss4
2c58b11e50 tools/: Update version generation tools to account for the patch number. 2020-04-18 11:47:37 -07:00
Xiang Xiao
b5a2c7a304 Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-17 10:09:52 -06:00
Xiang Xiao
89ff9eb046 tools/cfgdefine.c: Remove some string config variable from the dequote list
since source code use these config as string constant not as variable name

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Iaee3d32b100beb8b77d68711728a1e874b45ae3a
2020-04-17 10:09:52 -06:00
YAMAMOTO Takashi
e67062fd88 Config.mk: Provide the default MODULESTRIP
Similarly to MODULECC/MODULELD.
2020-04-16 16:04:11 -06:00
liuhaitao
773f540d74 tools/checkpatch.sh: enhance added files judgement with +++ at the line beginning
In https://github.com/apache/incubator-nuttx-apps/pull/179, there is a
removed graphics/littlevgl/lv_symbol_def.patch file whose content would be
treated abnormally and results in errors.

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-04-16 17:12:57 +08:00
YAMAMOTO Takashi
ac18fc0216
Merge pull request #792 from liuguo09/testbuild
tools/testbuild.sh: update makefunc to hardcode make/extra flags opti…
2020-04-15 15:50:06 +09:00
Nakamura, Yuuichi
d9472bb625 Fix nxstyle to mksyscall.c 2020-04-15 14:43:05 +08:00
liuhaitao
ed7d1dc611 tools/testbuild.sh: update makefunc to hardcode make/extra flags options and redirection
Aim to let makefunc caller just pass in the target. So update makefunc to hardcode make/extra
flags options and redirection, meanwhile avoid the case in which makefunc would remove the quotes
for EXTRAFLAGS. Note that JOPTIONS should also hardcode once parallel build break finally fixed.

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-04-15 11:10:55 +08:00
liuhaitao
032a04f4d6 checkpatch: Update checkpatch readme and remove addition blank line
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-04-14 12:31:48 +08:00
Ouss4
e174f73010 tools/zipme.sh: Create the hashes unconditionally. 2020-04-12 07:54:32 -06:00
liuhaitao
2427febba9 tools/testbuild.sh: add -e option to append extra c/c++ flags build support
Call 'tools/testbuild.sh -e -Wno-cpp testlist' would pass "EXTRAFLAGS=-Wno-cpp"
to make command line. Then it could suppress the warnings with pre-processor
directive #warning in GCC.

Change-Id: I61e5f9b3774149f64bdd625677cc9aabaa2fea90
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-04-11 08:31:08 -06:00
liuhaitao
459ad99373 Use EXTRAFLAGS instead of EXTRADEFINES to be used by make via command line
So call 'make EXTRAFLAGS=-Wno-cpp' could suppress the warnings with pre-processor
directive #warning in GCC.

Change-Id: Iaa618238924c9969bf91db22117b39e6d2fc9bb6
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-04-11 08:31:08 -06:00
Abdelatif Guettouche
398175b2ae
tools/zipme.sh: Add the possibility to PGP sign the final tarballs. (#756)
* tools/zipme.sh: Add the possibility to PGP sign the final tarballs.
* tools/README.txt: Update the file to add zipme.sh's new commands.
2020-04-08 17:31:22 -06:00
hartmannathan
bfc153ca27
Fix typos in comments and documentation (#750)
* Fix typos in comments and documentation
2020-04-08 06:45:35 -06:00
Ouss4
13f0442b63 tools/zipme.sh: Improve the tool to make it usuable from a development repo
and for future Apache releases.

 - Rename the final tarball to add incubating and apache to their names

 - Make the tool usuable from a development repo.

 - Add a list of patterns(files and folders) to exclude and
a command line argument to pass aditional patterns.

 - Add a command to run silently.

 - If the build number was not provided let version.sh figure it out.
2020-04-07 11:14:18 -06:00
Gregory Nutt
58589db931 tools/nxstyle.c: Fix detection of long single line comments.
This resolves issue 718:  nxstyle line width check was ignoring the line width check for single line comments.

This turned out to be an artifact in parsing.  Usually when parsing character by character, the file character to be parsed was '/n'.  Howefver, in the case of parsing single line comments, the final character was the NUL terminator.  This means that the lenth check was not being performed in the case of single line comments.

NOTE:  Currently, I have suppressed error reports for single line right-hand comments.  My fear is that this will unmask more standard violations than we can cope with.  It is easy to re-enable and perhaps we should do that in the future:

          /* Check for long lines
           *
           * REVISIT:  Long line checks suppressed on right hand comments
           * for now.  This just prevents a large number of difficult-to-
           * fix complaints that we would have otherwise.
           */

          if (m > g_maxline && !rhcomment)  <-- remote the second condition
2020-04-06 19:47:57 +01:00
raiden00pl
15242a65b6 tools/nxstyle.c: handle scientific notation with a negative exponent (eg. 9e-10) 2020-04-03 10:47:32 -06:00
Ouss4
765833546c tools/: Fix trivial typos. 2020-04-03 10:42:09 -06:00
YAMAMOTO Takashi
8851d3a7d3 testbuild.sh: Make the use of "git clean" optional
Also, update the list of command line options in the help text.
2020-04-03 12:43:05 +08:00
Gregory Nutt
65739a38fb tools/nxstyle.c: Alloc MHz in pre-processor variable names.
The sub-string MHz is used frequently is pre-processor variable definitions.  The section "Lowercase Exceptions" permits reasonable use of lowercase characters in pre-processor variable names and, given the frequency of the use of MHz (no pun intended), it certainly should qualify.
2020-04-02 20:29:26 +01:00
YAMAMOTO Takashi
27142b2e3c testbuild.sh: Use git clean instead of make distclean
As the former is considerably faster.
2020-04-02 13:40:05 +08:00
Gregory Nutt
a34e5fc043 tools/nxstyle.c: All Public Function Prototypes in C files
Allow "Public Function Prototypes" sections in .c files.  Per the coding standard, all public function prototypes belong in .c files.  However, there are some situations when the public function prototype is needed in a .c file and it shoudld, most correctly, be placed in a "Public Function Prototypes" section.
2020-04-01 22:57:51 +01:00
YAMAMOTO Takashi
03715743a3 testbuild.sh: Add an option to show the list of configs
This was useful for me when tweaking testlists.
2020-04-01 14:04:37 +08:00
Gregory Nutt
7f510a61b4 tools/nxstyle.c: Add fixedmath.h defines to white-listed prefixes
Checking for white-listed prefixes is also simpler now because the check is table driver.  New data structure:  g_white_prefix[] and new function white_prefix().
2020-03-31 19:26:26 +01:00
YAMAMOTO Takashi
4c0783353a tools/testbuild.sh: Make blacklist work on macOS
I couldn't find where "\b" was documented.
I guess it's a zero-width word boundary or something like that.
Anyway, it doesn't seem to work on macOS.
2020-03-29 09:39:11 +01:00
YAMAMOTO Takashi
35e1aa82cb tools/testbuild.sh: Allow spaces in comments 2020-03-28 11:23:42 -05:00
YAMAMOTO Takashi
18c574d66a Config.mk: Provide the default MODULECC/MODULELD
In some cases, a separate toolchain is necessary to
build modules.
E.g. the sim on macOS, where the native format is Mach-O.

By default, just use CC/LD, which is appropriate for
the most of platforms.
2020-03-27 00:04:36 -05:00
Gregory Nutt
5c0e8e88b1 Revert "Makefile: move INCDIROPT to common place (#625)"
This reverts commit b9ace36fcc.

This change was added by PR 625 but has a serious logic flaw.  It removes all occurrences of INCDIROPT and replaces it with a definition in tools/Config.mk:

    else ifeq ($(WINTOOL),y)
      DEFINE = "$(TOPDIR)/tools/define.sh"
      INCDIR = "$(TOPDIR)/tools/incdir.sh" -w

This logic flaw is the Config.mk is included in all Make.defs files BEFORE WINTOOL is defined.  As a result, the definition is wrong in many places when building under Cygwin with a Windows native toolchain.
2020-03-26 08:50:29 -07:00
Xiang Xiao
b9ace36fcc
Makefile: move INCDIROPT to common place (#625) 2020-03-26 08:09:59 -06:00
liuhaitao
272a1460c5 Revert "tools/testbuild.sh: suppress lots of stdout log from configure.sh"
f6fc87bc36 commit silence configure.sh
make output defautly, so revert it.

This reverts commit f0267aff33.
2020-03-23 22:04:27 -05:00
Ouss4
f6fc87bc36 tools/sethost.sh & tools/configure.c: When no make argument is passed, silence the make output. 2020-03-23 19:56:11 -05:00
Xiang Xiao
e1385b1074 tools/Config.mk: CATFILE clear the existing file
To simplify the caller usage
2020-03-23 12:23:05 -06:00
Xiang Xiao
aaa32156df tools/Config.mk: implement a simple version of TESTANDREPLACEFILE for Windows 2020-03-23 12:22:50 -06:00
liuhaitao
f0267aff33 tools/testbuild.sh: suppress lots of stdout log from configure.sh
Redirect configure.sh stdout to /dev/null to suppress lots of log
since configure.sh behaviour updated.

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-03-21 22:45:02 -05:00
Miguel Herranz
d410a29693 Support to run NuttX on ESP32 QEMU 2020-03-21 14:03:07 -06:00
Gregory Nutt
652e152d66 tools/nxstyle: Ignore stub names that begin with STUB_*
The names use for stub functions follows a non-standard convention:  They begin with STUB_
2020-03-21 19:06:32 +01:00
Xiang Xiao
0456b70cd5 tools: Remove ; after break for all shell script
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-03-21 09:48:57 -07:00
Xiang Xiao
580364362c tools/refresh.sh: Support passing the multiple configuration
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Id3d4464e2d30871763b40067b3162b793e99c98f
2020-03-21 09:48:57 -07:00
Xiang Xiao
86e47534e6 tools: Remove -d option from configure.sh
since we can achieve the same effect by passing V=1 to make

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-03-21 09:48:57 -07:00
Xiang Xiao
a54a492dd2 tools/configure.sh: Support passing options to make
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I6c928ac4574721aacb87be27c979ca8ae146a4ce
2020-03-21 09:48:57 -07:00
Xiang Xiao
024024f468 tools: Sync Makefile.win with Makefile.unix
and fix the typo error and remove if/else nesting

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ife0c80d396417e8eb37e43d0883f272d4b9247a0
2020-03-21 09:48:57 -07:00
Xiang Xiao
76bfaecca6 tools/configure.c: Fix nxstyle issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-03-21 09:48:57 -07:00
Xiang Xiao
c4ea4e976d tools/configure.sh: Add -e option to invoke distclean if already configured
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I19eddc3d4e6650eace2482c3cce8fbb07aadc04b
2020-03-21 09:48:57 -07:00
Xiang Xiao
1653b29542 Revert "tools/configure.*: Add -s option to skip .config/Make.defs existence check."
This reverts commit bf3ffddf2f.

Change-Id: Ia858ca1aab79a6c599cf93d2701515951bdc7b80
2020-03-21 09:48:57 -07:00
Johannes Schock
898141300c Don't check position of comments right of code when separated by preprocessor line without comment. 2020-03-19 09:36:57 -06:00
Xiang Xiao
5d6d9eeb82 tools/refresh.sh: Invoke make with V=1 if receiving -d option 2020-03-19 07:55:25 -06:00
Xiang Xiao
6f3ef32feb tools/refresh.sh: Should detect Make.defs from config folder first 2020-03-19 07:55:10 -06:00
Xiang Xiao
6f9117eae2 tools/sethost.sh: Remove <config> argument
Since this argument generate the expanding(deprecated) defconfig
2020-03-19 07:54:57 -06:00
Xiang Xiao
b574ea8b73 tools/sethost.sh: Don't make clean_context explicitly
Since olddefconfig will do this automatically
2020-03-19 07:54:43 -06:00
Xiang Xiao
8a6d67d138 tools: Make sethost.sh can be invoke from any directory 2020-03-19 07:54:30 -06:00
Johanne Schock
cdf615855a Added assembly header detection. 2020-03-14 08:38:39 -06:00
Xiang Xiao
d06cacb2f7 tools/refresh.sh: ad --nocopy option to skip copy defconfig (#563)
So we can normalize and copy the current .config to defconfig
2020-03-13 09:45:20 -06:00
Johanne Schock
645cf6d547 Handling of struct initializers changed.
Break conditionals with || at the end.
2020-03-13 07:58:52 -06:00
Xiang Xiao
4686d7cf57 tools: Support invoke refresh.sh from any directory 2020-03-13 06:24:49 -06:00
johannes-nivus
45196cad17
tools/nxstyle.c: Check for missing space before closing comment faulty (#543)
*Addresses Issue #540, check for missing space before closing comment was faulty
2020-03-11 11:08:01 -06:00
David Sidrane
0db4529d8b Add some helpful documentation in checkpatch.sh. 2020-03-10 13:22:32 -05:00
liuhaitao
aa4052936c tools/nxstyle: clean up the no and unknown file extension info
Clean up the no and unknown file extension info since only .h and .c
files supported. Just ignore them quietly.

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-03-10 08:43:23 -06:00
Johanne Schock
0b4ffa20a8 Checks for multiline comments right of #el..., changes message for a certain case of a comment following a right of code comment 2020-03-10 07:06:35 -06:00
liuhaitao
842b0c54d4 checkpatch: add checkpatch.sh README and correct some typos
Change-Id: Ib917dae235dc42fa2fa29e40c925f8fd048131df
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-03-10 11:13:03 +01:00
Johanne Schock
f764947c73 Signal error for multiline comment right of #if 2020-03-09 10:00:26 -06:00
Johanne Schock
745e0a4ca9 Some more fine tuning
Handle #define different than other preprocessor lines
Ignore backslash at the end of a comment right of a preprocessor line
2020-03-09 10:00:26 -06:00
Johanne Schock
5e5b6c2069 Finetuning false positive 2020-03-09 10:00:26 -06:00
Johanne Schock
fbe65a2d7d Restrict check of right of code comments to #define in case of preprocessor lines 2020-03-09 10:00:26 -06:00
Johanne Schock
46b8347217 Style 2020-03-09 10:00:26 -06:00
Johanne Schock
b324596bac Formatting 2020-03-09 10:00:26 -06:00
Johanne Schock
574344c56e Changes to nxstyle which address issue #120 and add checks for column position of right of code comments 2020-03-09 10:00:26 -06:00
Johanne Schock
62c2b4aac7 nxstyle fixes
fixed coloumn number of error messages PR #487
fixed lineno_min = lineno_min
2020-03-08 07:29:30 -06:00
Johanne Schock
77d02e98a0 Implemented comment processing for preprocessor lines 2020-03-08 06:36:54 -06:00
Ouss4
9be72e0706 tools/pic32: Make the post build process depend on INTELHEX_BINARY, as
it converts a hex file.
Build the tool if it didn't exist.
2020-03-07 09:34:52 -06:00
Xiang Xiao
0d02168d28 toos/testbuild.sh: Remove the below warnning in nightly build
====================================================================================
Configuration/Tool: lm3s6432-s2e/nsh,CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL

Change-Id: I95cd6f0c00f68c68f9175574d44e75e24c41bc12
------------------------------------------------------------------------------------
  Cleaning...
  Configuring...
  Copy files
  Select CONFIG_HOST_LINUX=y
  Refreshing...
  Disabling CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL
  Enabling CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL
  Refreshing...
.config:1542:warning: override: reassigning to symbol ARMV7M_TOOLCHAIN_GNU_EABIL
  Building NuttX...
------------------------------------------------------------------------------------
2020-03-07 09:32:39 -06:00
Ouss4
9daa8441e3 tools/pic32: Add the Config.mk file to execute the post build script.
Update Make.defs and README.txt files in boards directory accordingly.
2020-03-07 08:35:20 -06:00
Ouss4
0d88073644 toos/pic32: Some cosmetic changes.
- Rename the folder to PIC32.
  - Rename the Makefile to Makefile.host
  - Run nxstyle on the C file.
  - Change licenses to ALv2.
2020-03-07 08:35:20 -06:00
David Sidrane
c5b4d9b628 nxstyle:nxstyle should pass nxstyle checks! 2020-03-07 08:31:36 -06:00
David Sidrane
8b1dc2825f Update nxstyle.c 2020-03-06 15:49:59 -06:00
Gregory Nutt
3ee1af5bcc Build System: Resolve CPU-specific logic in common build files
* tools/Config.mk - Add empty definition POSTBUILD
* tools/Makefile.unix/win - Replace CXD56xx specific logic with $(call POSTBUILD)
* boards/arm/cxd56xx/scripts/Config.mk - Add POSTBUILD definitions with logic removed from Makefile.unix/win
* boards/arm/cxd56xx/spresense/scripts/Make.defs - Include the CXD56xx Config.mk immediately after tools/Config.mk so that the empty POSTBUILD definition will be replaced with the correct one

NOTE: There is a precedent for this approach.  This is the way that other architecture-specific build options are implemented.  See, for example, tools/zds/Config.mk
2020-03-06 11:44:53 -06:00
YAMAMOTO Takashi
45a8edd227 nxstyle: Output line numbers when complaining on block comments length 2020-03-06 07:25:52 -06:00
YAMAMOTO Takashi
0715ab3132 Revert "tools/nxstyle: Back out part of last commit. Logic to avoid some false alarms was causing real style problems from being reported."
If we are going to use this tool for things like
git pre-commit hook or CI workflow, it's critical to
avoid false alarms.

This reverts commit de764af9aa.
2020-03-06 07:25:11 -06:00
YAMAMOTO Takashi
4879f2225e nxstyle: Don't complain on ELF things like Elf32_Hdr 2020-03-05 21:18:12 -06:00
YAMAMOTO Takashi
e5ea0ac32d nxstyle: Don't parse a file if its type is unknown 2020-03-05 20:18:11 -06:00
YAMAMOTO Takashi
aa205b3732 mkexport: Deal with ARCHSCRIPT containing multiple files
This fixes "make export" for esp32-core.
2020-03-03 08:10:06 -06:00
liuhaitao
58318bbc28 tools/testbuild.sh: prevent grep from exiting in case of nomatch
Prevent grep from exiting in case of nomatch for blacklist when testbuild.sh called
with -x option which set -e in bash.
2020-03-03 08:06:40 -06:00
YAMAMOTO Takashi
aa40e28862 Make it clear the timestamp of pass1 directory is not important 2020-02-26 10:20:10 -06:00
Xiang Xiao
852fc8b9d9 Revert "Fix make target dependencies"
This reverts commit 5f540d79a1.
2020-02-26 07:31:40 -06:00
YAMAMOTO Takashi
5f540d79a1 Fix make target dependencies
"all" and "depend" targets should not be made concurrently.
I occasionally see APPDIR build failures because of this.
2020-02-25 21:09:32 -06:00
YAMAMOTO Takashi
f01953d364 mksyscall: Suppress "'noreturn' function does return" warnings 2020-02-25 04:07:02 -06:00
Xiang Xiao
cec7949a39
tools/checkpatch.sh: Add code spell check to checkpatch.sh (#371) 2020-02-25 10:28:05 +01:00
Adam Feuer
7fa1486181 simulator network host route helper script and docs
Squashed commit of the following:

commit 685951b5385062035ac558df1112353c9441c910
Author: Adam Feuer <adam@starcat.io>
Date:   Mon Feb 24 16:33:00 2020 -0800

    fixed typo in readme

commit ad1d3289b48af0de3095e3f365429017e57278b3
Author: Adam Feuer <adam@starcat.io>
Date:   Mon Feb 24 16:07:48 2020 -0800

    simulator host route helper script and docs

    Squashed commit of the following:

    commit cf5cddcf55a155303cb5abb1aa026f6dcaf369ca
    Author: Adam Feuer <adam@starcat.io>
    Date:   Mon Feb 24 15:50:40 2020 -0800

        syslog on console to fix compile error

    commit def1bb73fcfbc8b115c55d9f4544b97d583807f2
    Author: Adam Feuer <adam@starcat.io>
    Date:   Mon Feb 24 15:46:13 2020 -0800

        formatting as per PR feedback; removed ping

    commit b179fd8831b77fbbe85527a4ab3161e1f1ca1e43
    Author: Adam Feuer <adam@starcat.io>
    Date:   Mon Feb 24 15:45:49 2020 -0800

        formatting as per PR feedback

    commit e3280bede9798d9a00b118e126c02ceab497e33a
    Author: Adam Feuer <adam@starcat.io>
    Date:   Mon Feb 24 13:56:50 2020 -0800

        add simhostroute.sh description to readme

    commit 09a6b0ca3bacf005c2a79102141ae8cc3eb91849
    Author: Adam Feuer <adam@starcat.io>
    Date:   Sun Feb 23 17:38:40 2020 -0800

        fixed error in simhostroute.sh usage docs

    commit d838582119d43ee2002ce3808051c82b23e98c58
    Author: Adam Feuer <adam@starcat.io>
    Date:   Sun Feb 23 17:28:35 2020 -0800

        added tcpblaster defconfig and updated docs

    commit af3d2d6591f12d1127027fdd363858052094e624
    Author: Adam Feuer <adam@starcat.io>
    Date:   Sun Feb 23 17:21:29 2020 -0800

        added info about capabilities and running as root

    commit 6359cfdfedefc818b169455401942d3d33a59f41
    Author: Adam Feuer <adam@starcat.io>
    Date:   Sun Feb 23 17:20:42 2020 -0800

        updated network linux readme

    commit 47feb08aa74e4b1fc6c802567bc777d31e7c9a83
    Author: Adam Feuer <adam@starcat.io>
    Date:   Sun Feb 23 17:09:04 2020 -0800

        initial addition
2020-02-24 20:20:25 -06:00
Adam Feuer
511e548613 Ethernet Over USB net helper script and docs
- for CDC ECM driver

Squashed commit of the following:

commit aa9a715498e15ad46d43318a663d296f38160cf8
Author: Adam Feuer <adam@starcat.io>
Date:   Mon Feb 24 16:42:52 2020 -0800

    code formatting; removed ping

commit 56520b7f7e2b7f03697eacc2f2b5450b0f7af676
Author: Adam Feuer <adam@starcat.io>
Date:   Mon Feb 24 16:42:32 2020 -0800

    add description of netusb.sh helper script

commit afee3d33b1e66138afb7e9713d86b765ceab55b0
Author: Adam Feuer <adam@starcat.io>
Date:   Mon Feb 24 16:41:40 2020 -0800

    readme formatting

commit 772e36021f4aee2ba1df408ad29d8b9adedeed9f
Author: Adam Feuer <adam@starcat.io>
Date:   Sun Feb 23 11:38:50 2020 -0800

    updated readme, removed redundant configs

commit 082785178aa6e0d1578034b4b163785fdcb61f22
Author: Adam Feuer <adam@starcat.io>
Date:   Sat Feb 22 17:40:05 2020 -0800

    README, defconfig, and helper script improvements
2020-02-24 20:13:31 -06:00
Gregory Nutt
90eed5c8f8 tools/zds/zdsar.c: Use shorter, relative paths
This tools needs to CD to directory holding the library because it requires that the library be in the current working directory when objects are inserted.  Previously, the tool did this by creating an absolute path to the object file itself.  So instead of the object file being in the current directory and the library in a directory at an absolute path, this tool used an abolte path to the object file with the library in the current directory.

For the most part, that worked fine.  However, in the apps directory the object file names are greatly extended in length.  In the object file name was extended to a full absolute path and these huge file names were were exceeding some internal limit within the ZDS-II librarian.  But useing shorter, relative paths, we were able to avoid hitting this limit and the entire build completed correctly.
2020-02-24 22:37:28 +01:00
Gregory Nutt
e6f545beab Extend revised ZDS-II support to z8 and z16f
* tools/zds/zds_Config.mk: Move  boards/z80/ez80/scripts/eZ80_Config.mk to tools/zds/zds_Config.mk where it can be shared by other ZDS-II platforms.
* boards/z16/z16f:  Duplicate changes for new ZDS-II support from ez80
* boards/z80/z8:  Duplicate changes for new ZDS-II support from ez80
* arch/z16/src/z16f/Toolchain.defs:  Create required Toolchain.defs file for Z16f
2020-02-24 22:37:28 +01:00
Gregory Nutt
d1a8a803e4 Build system: Get rid of the MOVEOBJ definition
Eliminate the MOVEOBJ definition from tools/Config.mk, Makefiles, and other locations.  The MOVEOBJ definition was used to work around the case where the object output of a compile or assemble is in a different directory than the source file.  The ZDS-II tools have no command line option to perform this move; MOVEOBJ handled the move as a post-compiler operation.

MOVEOBJ is no longer needed because this the ez80 COMPILE and ASSEMBLE definitions now handle all of the object file movement cases.
2020-02-24 22:37:28 +01:00
Gregory Nutt
75be4c5677 ZDS-II Object file relocations
tools/zds/zdsgen.c:  Remove this program.  It should have been a simpler way to manage ZDS-II compiler and assember differences.  However, the compiler arguments needed to pass through too many layers of bash command line modifications and, as a result, it was not possible to retain quotes on critical strings.  This approch was abandoned for an alternative approach.

boards/z80/ez80/scripts/eZ80_Config.mk:  Add definitions to move the object files as necessary.  This seems to work well and is implemented for both native and Cygwin Windows build -- but only for the Z20x.
2020-02-24 14:38:39 -03:00
Gregory Nutt
9cd188e3c7 tools/zds/zdsgen.c: WIP Compiler/Assembler Wrapper
And additional wrapper that is needed for the ZDS-II build is a wrapper for the compiler and assemble.  This is needed because the ZDS-II cannot control the name or location of the output of the output object file:  it is always in the same directory as the source file and with the same name as the source file except with the .obj extension.

This was handled in the past with the MOVEOBJ definition which was specifically called Makefiles to move the objects to the correct position.  However, now there is a new behavior:  Output object files may also be named differently with added decoration in the file name.  This is done in the current apps/ directory build.

There is currently some ugly implementation that includes a long sequence of Bash code to handle the moving and/or renaming.  There is nothing in place for the Windows native case.

This wrapper, when complete, will clean up the Makefiles, improve build performance, and provide a solution that is portable to both the Cywin/MSYS environment as well as to the Windows native environment.
2020-02-23 21:44:18 -06:00
Xiang Xiao
cde88cabcc Run codespell -w with the latest dictonary again
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-02-23 22:27:46 +01:00
Gregory Nutt
55a7dfc9a7 tools/zds/zdsar.c: Fix several errors
This zdsar librarian wrapper is code complete and has no known bugs.
However, there are still some build instabilities so perhaps there
are still some bug to be identified.  Or perhaps there are other
undiscovered bugs unrelated to zdsar which appears to be behaving
correctly in all cases.

It will take some additional testing know for sure.
2020-02-23 18:15:24 -03:00
Gregory Nutt
4bf2a1ee91 tools/zds/zdsar.c: Correct memory corruption bug
A pointer to a string in a memory buffer was losing its value.  The reason was that the buffer was occasionally being used for other purposes.  The fix is to strdup() the string so that there is a private, protected copy.
2020-02-23 13:18:27 +01:00
Gregory Nutt
738819b053 tools/zds: Add build tools to simplify ZDS-II tool usage
tools/zds:  A new tool sub-directory intended to hold tools for making life working with the ZDS-II toolchain less painful.

tools/zds/zdsar.c:  This is a wrapper around the ZDS_II librarian.  It simplifies the build scripts by replacing large sequences of complex Bash script that were added to the build files.  Not only does this clean up the build files but it also improves performance and, more importantly, provides a common solution for the Windows native build case.  This tool should work with all ZDS-II based platforms including z8, zNeo, and ez80.

tools/README.txt:  Add a brief description about the zds sub-directory.  Also re-ordered some tool descriptions.  They are supposed to be in alphabetical order, but this seems to have fallen apart.

boards/z80/ez80/scripts/eZ80_Config.mk:  Updated to use tools/zds/zdsar.exe.
2020-02-22 19:33:35 -03:00
Xiang Xiao
bd4e8e19d3 Run codespell -w against all files
and fix the wrong correction
2020-02-22 14:45:07 -06:00
Gregory Nutt
54be203107 boards/z80/ez80/scripts/eZ80_Config.mk: Fix ez80 build
This includes some fixes for the ez80 build including:

1. Ability to handle decorated object file names,
2. Ability to handle libraries described with absolute paths

This commit address only the POSIX build and needs to be updated
for the Windows native build.
2020-02-22 00:59:44 +01:00
Xiang Xiao
4d16eeb435 Make.defs: Fix flock: failed to execute @: No such file or directory
Remove $(Q) in ARCHIVE which is added back in commit fd3e2c5916 accidentally
2020-02-21 07:35:24 -06:00
Alan Carvalho de Assis
fd3e2c5916 Make.defs: Fix printed "|| { ar blablabla FAILED!" after $(Q) removed 2020-02-20 19:43:52 -06:00
Xiang Xiao
342f76a529 Makefile: Remove @echo from ARCHIVE
to avoid shell complain that @echo can't find if the variable expand in the compound
command(e.g. ARLOCK) and remove $(Q) before $AR so the result is almost same as before.
2020-02-20 08:32:09 -06:00
liuhaitao
ba265e90d6 tools/testbuild.sh: select size_t to different type by testlist
testbuild.sh select size_t to different type by testlist in which
CONFIG_ARCH_SIZET_LONG defined for ulong and -CONFIG_ARCH_SIZET_LONG
for uint.
2020-02-18 08:34:36 -06:00
Xiang Xiao
e7d9260014 arch: Customize the typedef of size_t instead of intptr_t
To ensure size_t same as toolchain definition in the first place and rename CXX_NEWLONG to ARCH_SIZET_LONG.  The change also check whether __SIZE_TYPE__ exist before CONFIG_ARCH_SIZET_LONG so our definition can align with toolchain(gcc/clang) definition automatically.
2020-02-18 07:15:19 -06:00
liuhaitao
05391da6b8 tools/checkpatch.sh: do full file check for commits and patches defaultly
Make 'checkpatch.sh -c commits' and 'checkpatch.sh -p patches' do full
file check as default, while 'checkpatch.sh -r -c commits' and 'checkpatch.sh
-r -p patches' do ranges check only.
2020-02-17 08:18:44 -06:00
Gregory Nutt
75e3af0985 tools/nxstyle: Allow mixed case system calls.
System calls have mixed case.  They begin with SYS_ but then are followed by the system function name in lower case.
2020-02-14 17:22:18 +01:00
YAMAMOTO Takashi
842392beda Makefile.host: Use generic name (cc) than GCC specific (gcc)
This makes it easier to use clang on ubuntu.
2020-02-13 15:25:15 +08:00
liuhaitao
7ec66ccf94 Get the full directory name of the testbuild.sh no matter where called from
Change-Id: I00cab8d97acb8e436622c0bdd4bc4bfe7374bca3
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-02-10 09:01:35 -06:00
Gregory Nutt
20f29e60e3 tools/testbuild.sh: Remove bad line from usage help. 2020-02-09 20:05:44 +01:00
liuhaitao
f4d8c184b0 tools/checkpatch.sh: make sure fail get the real return error value
Do not use pipeline way and make sure fail to record the real exit error value.
2020-02-09 07:51:27 -06:00
liuhaitao
48f1793a60 tools/testbuild.sh: make sure fail get the real return error value 2020-02-08 07:33:54 -06:00
Xiang Xiao
a8de37fbec Ensure all source code end with one and only one newline
by this command:
git ls-files -z | while IFS= read -rd '' f; do tail -c1 < "$f" | read -r _ || echo >> "$f"; done
2020-02-08 07:25:56 -06:00
liuhaitao
3b311ab895 tools/testbuild.sh: use function to call make and fail handle in common
Change-Id: I50cbc335254be0f2388b4bb6af8a874e74ba98c2
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-02-07 13:56:23 +01:00