Commit Graph

869 Commits

Author SHA1 Message Date
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