2024-10-28 14:40:35 +00:00
|
|
|
# -*- makefile -*- : Force emacs to use Makefile mode
|
|
|
|
|
|
|
|
|
|
# Build a position-independent executable, with relocations required
|
|
|
|
|
# only for data values. Runtime relocations are applied by the
|
|
|
|
|
# prefix code.
|
|
|
|
|
#
|
|
|
|
|
CFLAGS += -mcmodel=medany -fpie
|
2025-05-06 14:53:29 +01:00
|
|
|
LDFLAGS += -pie --no-dynamic-linker -z combreloc
|
2024-10-28 14:40:35 +00:00
|
|
|
|
|
|
|
|
# Linker script
|
|
|
|
|
#
|
|
|
|
|
LDSCRIPT = arch/riscv/scripts/sbi.lds
|
|
|
|
|
|
|
|
|
|
# Media types
|
|
|
|
|
#
|
|
|
|
|
MEDIA += sbi
|
2025-05-13 12:51:53 +01:00
|
|
|
MEDIA += lkrn
|
2025-05-13 18:25:24 +01:00
|
|
|
|
|
|
|
|
# Padded flash device images (e.g. for QEMU's -pflash option)
|
|
|
|
|
#
|
|
|
|
|
NON_AUTO_MEDIA += pf32
|
|
|
|
|
%.pf32 : %.sbi $(MAKEDEPS)
|
|
|
|
|
$(Q)$(CP) $< $@
|
|
|
|
|
$(Q)$(TRUNCATE) -s 32M $@
|