Commit Graph

77 Commits

Author SHA1 Message Date
Matias N
88f1cdb915 build system: add missing --obj-path to MKDEP 2020-11-28 09:59:56 -06: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
Matias N
d5b6ec450f Parallelize depend file generation 2020-11-22 09:02:59 -03: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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
YAMAMOTO Takashi
e67062fd88 Config.mk: Provide the default MODULESTRIP
Similarly to MODULECC/MODULELD.
2020-04-16 16:04:11 -06: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
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
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
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
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
Xiang Xiao
adbff7de81 tools/Config.mk: add DEFINE macro like INCDIR 2020-02-03 15:06:11 -06:00
Xiang Xiao
bb6c70bdcc Fix the comment header style in tools folder
Change-Id: I189a0e8b86f3af682111668ccdad64a52b48dcb4
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-01-20 08:04:21 -06:00
Xiang Xiao
8ffa77b167 tools/mkexport.sh: Should export full content for flat build even with CONFIG_BUILD_LOADABLE. 2019-10-03 14:08:32 -06:00
Gregory Nutt
8471da9dec tools/Config.mk: Update comments to indicate how to use the single-file compilation options. 2019-10-03 08:23:22 -06:00
Xiang Xiao
37ef3c1cbc tools/Config.mk: Support the ability to change the CFLAGS for the compilation of a single file. Set special compiler options as follows the rule:
sourcefile + fixed suffix "_[A|C|CPP|CXX]FLAGS"

apps/examples/hello/Makefile:
  $(SRCDIR)/hello_main.c_CFLAGS = -DTEST
2019-10-03 06:49:17 -06:00
Gregory Nutt
03fc3a2218 Fix a typo I introducted in the last commit. My bad. 2019-09-15 11:14:47 -06:00
Xiang Xiao
bf84868360 tools/Config.mk and Makefile.unix: Support the incremental build for configuration change. 2019-09-15 10:56:26 -06:00
anchao
7ce51e66b9 tools/Config.mk: Eliminate use of the built-in implicit rules. 2019-09-15 08:48:25 -06:00
Nathan Hartman
366053e464 Fix typos, 1 in a #define, others in comments. This changes one definition: _MQ_TIMEDRECIEVE is changed to _MQ_TIMEDRECEIVE. It appears this symbol is not used anywhere. 2019-09-11 08:56:56 -06:00
Nathan Hartman
ce8fb54d07 Fix various typos 2019-09-03 17:00:22 -06:00
Anatol Ivanov
e748bb8cd3 tools/Config.mk and tools/Makefile.win: Force use 'cmd' for shell with windows native build 2018-11-06 06:34:00 -06:00