mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
manually encode newlines on all printed commands
This way we group key value arguments: e.g.:
make \
-j 8 \
all
instead of:
make \
-j \
8 \
all
and reach CLI nirvana, while also subtly breaking several commands due to
lack of testing.
This commit is contained in:
@@ -11,10 +11,10 @@ class BaremetalComponent(common.Component):
|
||||
bootloader_obj = os.path.join(common.baremetal_build_lib_dir, 'bootloader{}'.format(common.obj_ext))
|
||||
common_obj = os.path.join(common.baremetal_build_lib_dir, 'common{}'.format(common.obj_ext))
|
||||
cflags = [
|
||||
'-ggdb3',
|
||||
'-mcpu={}'.format(common.mcpu),
|
||||
'-nostartfiles',
|
||||
'-O0',
|
||||
'-ggdb3', common.Newline,
|
||||
'-mcpu={}'.format(common.mcpu), common.Newline,
|
||||
'-nostartfiles', common.Newline,
|
||||
'-O0', common.Newline,
|
||||
]
|
||||
if args.prebuilt:
|
||||
gcc = 'arm-none-eabi-gcc'
|
||||
@@ -36,23 +36,23 @@ class BaremetalComponent(common.Component):
|
||||
os.makedirs(build_dir, exist_ok=True)
|
||||
os.makedirs(common.baremetal_build_lib_dir, exist_ok=True)
|
||||
common.run_cmd(
|
||||
[gcc] +
|
||||
[gcc, common.Newline] +
|
||||
cflags +
|
||||
[
|
||||
'-c',
|
||||
'-o', bootloader_obj,
|
||||
os.path.join(common.baremetal_src_lib_dir, '{}{}'.format(args.arch, common.asm_ext)),
|
||||
'-c', common.Newline,
|
||||
'-o', bootloader_obj, common.Newline,
|
||||
os.path.join(common.baremetal_src_lib_dir, '{}{}'.format(args.arch, common.asm_ext)), common.Newline,
|
||||
]
|
||||
)
|
||||
common.run_cmd(
|
||||
[gcc] +
|
||||
[gcc, common.Newline] +
|
||||
cflags +
|
||||
[
|
||||
'-c',
|
||||
'-D',
|
||||
'UART0_ADDR={:#x}'.format(uart_address),
|
||||
'-o', common_obj,
|
||||
os.path.join(common.baremetal_src_lib_dir, 'common' + common.c_ext),
|
||||
'-c', common.Newline,
|
||||
'-D', common.Newline,
|
||||
'UART0_ADDR={:#x}'.format(uart_address), common.Newline,
|
||||
'-o', common_obj, common.Newline,
|
||||
os.path.join(common.baremetal_src_lib_dir, 'common' + common.c_ext), common.Newline,
|
||||
]
|
||||
)
|
||||
self._build_dir(
|
||||
@@ -117,7 +117,7 @@ Build the baremetal examples with crosstool-NG.
|
||||
out_dir = os.path.join(common.baremetal_build_dir, subpath)
|
||||
os.makedirs(out_dir, exist_ok=True)
|
||||
if bootloader:
|
||||
bootloader_cmd = [bootloader_obj]
|
||||
bootloader_cmd = [bootloader_obj, common.Newline]
|
||||
else:
|
||||
bootloader_cmd = []
|
||||
for in_basename in os.listdir(in_dir):
|
||||
@@ -126,26 +126,26 @@ Build the baremetal examples with crosstool-NG.
|
||||
in_name = os.path.splitext(in_basename)[0]
|
||||
main_obj = os.path.join(common.baremetal_build_dir, subpath, '{}{}'.format(in_name, common.obj_ext))
|
||||
common.run_cmd(
|
||||
[gcc] +
|
||||
[gcc, common.Newline] +
|
||||
cflags +
|
||||
[
|
||||
'-c',
|
||||
'-o', main_obj,
|
||||
os.path.join(common.baremetal_src_dir, in_path),
|
||||
'-c', common.Newline,
|
||||
'-o', main_obj, common.Newline,
|
||||
os.path.join(common.baremetal_src_dir, in_path), common.Newline,
|
||||
]
|
||||
)
|
||||
common.run_cmd(
|
||||
[gcc] +
|
||||
[gcc, common.Newline] +
|
||||
cflags +
|
||||
[
|
||||
'-Wl,--section-start=.text={:#x}'.format(entry_address),
|
||||
'-o', os.path.join(common.baremetal_build_dir, subpath, in_name + common.baremetal_build_ext),
|
||||
'-T', os.path.join(common.baremetal_src_dir, 'link.ld'),
|
||||
'-Wl,--section-start=.text={:#x}'.format(entry_address), common.Newline,
|
||||
'-o', os.path.join(common.baremetal_build_dir, subpath, in_name + common.baremetal_build_ext), common.Newline,
|
||||
'-T', os.path.join(common.baremetal_src_dir, 'link.ld'), common.Newline,
|
||||
] +
|
||||
bootloader_cmd +
|
||||
[
|
||||
common_obj,
|
||||
main_obj,
|
||||
common_obj, common.Newline,
|
||||
main_obj, common.Newline,
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user