forked from pulp-platform/boot-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (37 loc) · 1.05 KB
/
Makefile
File metadata and controls
51 lines (37 loc) · 1.05 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
SRCS = boot_code.c
ASM_SRCS = crt0.S
BUILDDIR ?= $(CURDIR)/build
BOOTCODE = $(BUILDDIR)/bootcode
PULP_CC = riscv32-unknown-elf-gcc
PULP_LD = riscv32-unknown-elf-gcc
ifndef VERBOSE
V = @
endif
LDFLAGS += -Tlink.ld -nostdlib
CFLAGS += -Os -g -fno-jump-tables -I$(CURDIR)/include
OBJS += $(patsubst %.c,$(BUILDDIR)/%.o,$(SRCS))
OBJS += $(patsubst %.S,$(BUILDDIR)/%.o,$(ASM_SRCS))
all: $(BOOTCODE) stimuli
clean:
rm -rf $(BUILDDIR)
$(BUILDDIR)/%.o: %.c
@echo "CC $<"
$(V)mkdir -p `dirname $@`
$(V)$(PULP_CC) -c $< -o $@ -MMD -MP $(CFLAGS)
$(BUILDDIR)/%.o: %.S
@echo "CC $<"
$(V)mkdir -p `dirname $@`
$(V)$(PULP_CC) -c $< -o $@ -MMD -MP -DLANGUAGE_ASSEMBLY $(CFLAGS)
$(BOOTCODE): $(OBJS)
@echo "LD $@"
$(V)mkdir -p `dirname $@`
$(V)$(PULP_LD) -o $@ $^ -MMD -MP $(LDFLAGS)
stimuli.gvsoc:
./stim_utils.py \
--binary=$(BOOTCODE) \
--stim-bin=rom.bin \
--area=0x1a000000:0x01000000
stimuli.rtl:
objcopy --srec-len 1 --output-target=srec $(BOOTCODE) $(BOOTCODE).s19
./s19toboot.py $(BOOTCODE).s19 boot_code.cde pulp
stimuli: stimuli.gvsoc stimuli.rtl