Commit Graph

16 Commits

Author SHA1 Message Date
Masahiro Yamada
cd51878e34 tools: fix define2mk.sed to not add quotes around negative integers
The sed script, tools/scripts/define2mk.sed, converts config defines
from C headers into include/autoconf.mk for the use in Makefiles.

I found the tool adds quotes around negative integer values.

For example, at the point of the v2016.07-rc1 tag,
include/configs/microblaze-generic.h defines
  #define CONFIG_BOOTDELAY         -1     /* -1 disables auto-boot */

Because it is an integer option, it should be converted to:
  CONFIG_BOOTDELAY=-1

But, the script actually converts it to:
  CONFIG_BOOTDELAY="-1"

This is a fatal problem for the tools/moveconfig.py because it parses
include/autoconf.mk for the config defines from the board headers.
CONFIG_BOOTDELAY="-1" is considered as a string type option and it
is dropped due to the type mismatch from the entry in Kconfig.

This commit fixes the script so that the tools/moveconfig.py can
correctly convert integer options with a negative value.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2016-06-13 07:46:29 +09:00
Masahiro Yamada
6a44d80634 kbuild: move asm-offsets.h rules to ./Kbuild
Generate include/generated/generic-asm-offsets.h and
include/generated/asm-offsets.h in ./Kbuild.

This commit also changes the include guard.

Before this commit, __ASM_OFFSETS_H__ was used for both of them.
So we could not include generic-asm-offsets.h and asm-offsets.h
at the same time.

This commit renames the include guard of the former to
__GENERIC_ASM_OFFSETS_H__.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-25 11:01:28 -05:00
Masahiro Yamada
901d0ea1fc tools: move kermit files to tools/kermit directory
The script files, define2mk.sed and make-asm-offsets
are used to create autoconf.mk and asm-offsets.h
while build.

Whereas README, dot.kermrc, flash_param, send_cmd, send_image
are files useful for kermit.

We should not put files which have the totally different purpose
into the same directory.

This commit creates a new directory, tools/kermit,
and move kermit files into it.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Wolfgang Denk <wd@denx.de>
2014-01-24 16:59:07 -05:00
Masahiro Yamada
26d2857485 cosmetic: tools/scripts/README: insert only one space between words
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-01-24 16:59:07 -05:00
Wolfgang Denk
93e1459641 Coding Style cleanup: replace leading SPACEs by TABs
Signed-off-by: Wolfgang Denk <wd@denx.de>
[trini: Drop changes for PEP 4 following python tools]
Signed-off-by: Tom Rini <trini@ti.com>
2013-10-14 16:06:54 -04:00
Wolfgang Denk
3765b3e7bd Coding Style cleanup: remove trailing white space
Signed-off-by: Wolfgang Denk <wd@denx.de>
2013-10-14 16:06:53 -04:00
Wolfgang Denk
1a4596601f Add GPL-2.0+ SPDX-License-Identifier to source files
Signed-off-by: Wolfgang Denk <wd@denx.de>
[trini: Fixup common/cmd_io.c]
Signed-off-by: Tom Rini <trini@ti.com>
2013-07-24 09:44:38 -04:00
Benoît Thébaudeau
2979b26323 autoconfig.mk: Make it possible to define configs from other configs
Give more flexibility to define configs that can be interpreted by make, e.g. to
define fallback values of configs like in the example below.

Before this change, the config lines:
 #define CONFIG_SPL_MAX_SIZE	2048
 #define CONFIG_SPL_PAD_TO	CONFIG_SPL_MAX_SIZE
would have been changed in autoconfig.mk into:
 CONFIG_SPL_MAX_SIZE=2048
 CONFIG_SPL_PAD_TO="CONFIG_SPL_MAX_SIZE"

Hence, a make recipe using as an argument to $(OBJCOPY):
 --pad-to=$(CONFIG_SPL_PAD_TO)
would have issued:
 --pad-to="CONFIG_SPL_MAX_SIZE"
which means nothing for $(OBJCOPY) and makes it fail.

Thanks to this change, the config lines above are changed in autoconfig.mk into:
 CONFIG_SPL_MAX_SIZE=2048
 CONFIG_SPL_PAD_TO=$(CONFIG_SPL_MAX_SIZE)

Hence, the make recipe above now issues:
 --pad-to=2048
as expected from the defined config.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Reviewed-by: Tom Rini <trini@ti.com>
2013-04-12 07:55:06 +02:00
Wolfgang Denk
e4691f5ed1 make-asm-offsets: fix sed script
When copying the "sed" script to generate the asm-offsets.h file from
the Linux Kbuild script into the make-asm-offsets file I missed the
fact that the former runs in a "make" context and thus uses double
"$$" to escape a single "$", while the latter is a shell script, where
this must not be done.  Unfortunately the problem did not show up
during the initial tests on Power Architecture systems, but on ARM the
generated asm-offsets.h was not correct.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Tested-by: Heiko Schocher <hs@denx.de>
Tested-by: Ben Gardiner <bengardiner@nanometrics.ca>
2010-10-27 20:16:52 +02:00
Wolfgang Denk
16a354f920 include/asm-offsets.h: automatically generate assembler constants
A recurrent issue is that certain C level constructs like sizeof() or
offsetof() cannot be used in assembler files, which is inconvenient
when such constructs are used in the definition of macro names etc.

To avoid duplication of such definitions (and thus another cause of
problems), we adapt the Linux way to automatically generate the
respective definitions from the respective C header files.

In Linux, this is implemented in include/linux/kbuild.h, Kbuild, and
arch/*/kernel/asm-offsets.c; we adapt the code from the Linux v2.6.36
kernel tree.

We also copy the concept of the include/generated/ directory which can
be used to hold other automatically generated files as well.

We start with an architecture-independent lib/asm-offsets.c which
generates include/generated/generic-asm-offsets.h (included by
include/asm-offsets.h, which is what will be referred to in the actual
source code).  Later this may be extended by architecture-specific
arch/*/lib/asm-offsets.c files that will generate a
include/generated/asm-offsets.h.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Kumar Gala <galak@kernel.crashing.org>
2010-10-26 21:04:34 +02:00
Wolfgang Denk
2bad5df727 autoconfig.mk: avoid apostophes around hex values
When generating include/autoconfig.mk, hex numbers would be quoted.
This caused some false positives during automatic testing of the
builds, and is known to cause some real issues for some Blackfin
configurations. Don't use apostophes for decimal and hex numbers (nor
for octal numbers).

Signed-off-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-10-18 22:08:22 +02:00
Marcel Moolenaar
02409f8cf5 make define2mk.sed work on FreeBSD
In the thread "[1.3.2-rc1] MPC8548CDS/MPC8555CDS configs fails to link",
the define2mk.sed script was identified as the source of the link
failure on FreeBSD. The problem is that sed(1) does not always support
the '+' operator. It isn't on FreeBSD. The attach patch implements the
equivalent, using the '*' operator instead and should work everywhere.

Signed-off-by: Marcel Moolenaar <marcelm@juniper.net>
2008-02-22 21:27:01 +01:00
Grant Likely
2f155f6c0a [BUILD] Generate include/autoconf.mk from board config files
Use cpp and sed to postprocess config.h and import the defined values
into include/autoconf.mk.  autoconf.mk is then included by config.mk to
give 'make' access to the board configuration.

Doing this enables conditional compilation at the Makefile level instead
of by wrapping every .c file with #ifdef/#endif wrappers.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2007-11-20 22:33:38 -07:00
wdenk
8bde7f776c * Code cleanup:
- remove trailing white space, trailing empty lines, C++ comments, etc.
  - split cmd_boot.c (separate cmd_bdinfo.c and cmd_load.c)

* Patches by Kenneth Johansson, 25 Jun 2003:
  - major rework of command structure
    (work done mostly by Michal Cendrowski and Joakim Kristiansen)
2003-06-27 21:31:46 +00:00
wdenk
5b1d713721 Initial revision 2002-11-03 00:07:02 +00:00
wdenk
012771d88a Initial revision 2002-03-08 21:31:05 +00:00