Add writing to existing files and overwriting cp
This commit is contained in:
+39
@@ -310,3 +310,42 @@ custom_target(
|
||||
command: ['objcopy', '-O', 'binary', '@INPUT@', '@OUTPUT@'],
|
||||
build_by_default: true,
|
||||
)
|
||||
|
||||
cp_start = custom_target(
|
||||
'cp_start',
|
||||
input: 'src/user/start.asm',
|
||||
output: 'cp_start.o',
|
||||
command: [nasm, '-f', 'elf64', '-o', '@OUTPUT@', '@INPUT@'],
|
||||
)
|
||||
|
||||
cp_syscall = custom_target(
|
||||
'cp_syscall',
|
||||
input: 'src/user/syscall.asm',
|
||||
output: 'cp_syscall.o',
|
||||
command: [nasm, '-f', 'elf64', '-o', '@OUTPUT@', '@INPUT@'],
|
||||
)
|
||||
|
||||
cp_elf = executable(
|
||||
'cp.elf',
|
||||
sources: [cp_start, cp_syscall, lib_sources, 'src/user/app/cp/cp.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(
|
||||
'cp',
|
||||
input: cp_elf,
|
||||
output: 'cp',
|
||||
command: ['objcopy', '-O', 'binary', '@INPUT@', '@OUTPUT@'],
|
||||
build_by_default: true,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user