1 # Path where things should be installed
5 _dummy
:= $(shell mkdir
-p
$B)
6 _dummy
:= $(shell mkdir
-p
$R/include/cava
)
8 # Object files for libcava.a
9 aobj
:= elf_loader.o insn.o shmfifo.o
10 aobj
:= $(addprefix $B/,$(aobj
))
12 # Object files for caveat not in libcava.a
13 cobj
:= main.o core.o fast_sim.o slow_sim.o ecall.o
14 cobj
:= $(addprefix $B/,$(cobj
))
16 # Include files for libcava.a
17 incf
:= opcodes.h insn.h caveat.h shmfifo.h
20 libs
:= $R/lib
/softfloat.a
-lrt
-lpthread
-lm
23 CFLAGS
:= -I..
/include -I
$R/include -I
$R/include/softfloat
-g
-O3
24 LDFLAGS
:= -Wl
,-Ttext
=70000000
27 #$(info $$aobj is [${aobj}])
28 #$(info $$cobj is [${cobj}])
33 all: $R/lib
/libcava.a
$B/caveat
36 -cp
$B/caveat
$R/bin
/caveat
37 -cp
$(incf
) $R/include/cava
41 rm -f decode_insn.h disasm_insn.h execute_insn.h ecall_nums.h opcodes.h opcodes_attr.h
*.o
*~ .
/#*#
45 # Emulator and library
47 $B/caveat
: $(cobj
) $R/lib
/libcava.a
48 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@
$^
$(libs
)
50 $R/lib
/libcava.a
: $(aobj
)
58 $B/slow_sim.o
$B/fast_sim.o
: sim_body.h execute_insn.h caveat_fp.h core.h
59 $B/ecall.o
: core.h ecall_nums.h
60 $B/insn.o
: decode_insn.h disasm_insn.h
63 $B/fast_sim.o
: fast_sim.c
64 $(CC
) $(CFLAGS
) -Ofast
-o
$@
-c
$<
66 $B/core.o
: core.c core.h
67 $(CC
) $(CFLAGS
) -o
$@
-c
$<
69 $B/elf_loader.o
: elf_loader.c
70 $(CC
) $(CFLAGS
) -o
$@
-c
$<
73 $(CC
) $(CFLAGS
) -o
$@
-c
$<
76 $(CC
) $(CFLAGS
) -o
$@
-c
$<
79 $(CC
) $(CFLAGS
) -o
$@
-c
$<
82 opcodes.h opcodes_attr.h decode_insn.h execute_insn.h disasm_insn.h constants.c
: crunch_isa.py Instructions.def
85 ecall.h
: ecall_nums.h opcodes.h insn.h core.h
87 ecall_nums.h
: make_ecall_tbl.py
88 python3 make_ecall_tbl.py