Add file removal, rm
This commit is contained in:
+39
@@ -388,3 +388,42 @@ custom_target(
|
||||
command: ['objcopy', '-O', 'binary', '@INPUT@', '@OUTPUT@'],
|
||||
build_by_default: true,
|
||||
)
|
||||
|
||||
rm_start = custom_target(
|
||||
'rm_start',
|
||||
input: 'src/user/start.asm',
|
||||
output: 'rm_start.o',
|
||||
command: [nasm, '-f', 'elf64', '-o', '@OUTPUT@', '@INPUT@'],
|
||||
)
|
||||
|
||||
rm_syscall = custom_target(
|
||||
'rm_syscall',
|
||||
input: 'src/user/syscall.asm',
|
||||
output: 'rm_syscall.o',
|
||||
command: [nasm, '-f', 'elf64', '-o', '@OUTPUT@', '@INPUT@'],
|
||||
)
|
||||
|
||||
rm_elf = executable(
|
||||
'rm.elf',
|
||||
sources: [rm_start, rm_syscall, lib_sources, 'src/user/app/rm/rm.c'],
|
||||
c_args: [
|
||||
'-ffreestanding',
|
||||
'-nostdlib',
|
||||
'-fno-stack-protector',
|
||||
'-mcmodel=large',
|
||||
'-DVERSION="' + meson.project_version() + '"',
|
||||
],
|
||||
link_args: [
|
||||
'-T', meson.project_source_root() / 'src/user/linker.ld',
|
||||
'-nostdlib',
|
||||
],
|
||||
link_depends: 'src/user/linker.ld',
|
||||
)
|
||||
|
||||
custom_target(
|
||||
'rm',
|
||||
input: rm_elf,
|
||||
output: 'rm',
|
||||
command: ['objcopy', '-O', 'binary', '@INPUT@', '@OUTPUT@'],
|
||||
build_by_default: true,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user