summaryrefslogtreecommitdiff
path: root/rtl/gfx/firmware/mod.mk
blob: 087aadca59d90cde8a215d3d4e7d3d8e58c8f92e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
cores := gfx_bootrom gfx_firmware

define core/gfx_bootrom
  $(this)/cross := riscv32-none-elf-
  $(this)/hooks := cc objcopy makehex obj

  $(this)/cc_files := gfx_bootrom.S
  $(this)/cc_flags  = -g -march=rv32imc -mabi=ilp32
  $(this)/ld_flags := -nostartfiles -nostdlib
  $(this)/ld_binary := gfx_bootrom

  $(this)/objcopy_src := gfx_bootrom
  $(this)/objcopy_obj := gfx_bootrom.bin

  $(this)/makehex_src := gfx_bootrom.bin
  $(this)/makehex_obj := gfx_bootrom.hex
endef

define core/gfx_firmware
  $(this)/cross := riscv32-none-elf-
  $(this)/hooks := cc objcopy bin2rel obj

  $(this)/obj_deps := /$(here)link.ld

  $(this)/cc_files := start.S main.c
  $(this)/cc_flags  = -g -O3 -march=rv32imc -mabi=ilp32
  $(this)/ld_flags := -nostartfiles -nostdlib -T$(here)link.ld
  $(this)/ld_binary := gfx_fw

  $(this)/objcopy_src := gfx_fw
  $(this)/objcopy_obj := gfx_fw.bin

  $(this)/bin2rel_src := gfx_fw.bin
  $(this)/bin2rel_obj := gfx_fw_payload.o
endef