1 # Path where things should be installed
5 _dummy
:= $(shell mkdir
-p
$B)
7 # Object files for libcava.a
8 aobj
:= perfctr.o cache.o
9 aobj
:= $(addprefix $B/,$(aobj
))
11 # Object files for caveat not in libcava.a
12 cobj
:= pipesim.o fast_pipe.o trace_pipe.o count_pipe.o trace_count_pipe.o
13 cobj
:= $(addprefix $B/,$(cobj
))
15 # Include files for libcava.a
16 incf
:= perfctr.h cache.h lru_fsm_1way.h lru_fsm_2way.h lru_fsm_3way.h lru_fsm_4way.h
19 libs
:= -lrt
-lpthread
-lm
22 CFLAGS
:= -I
$R/include/cava
-g
-Ofast
23 #CFLAGS := -I$R/include/cava -g -O0
27 hdrs
:= opcodes.h insn.h shmfifo.h caveat.h
30 hdrs
:= $(addprefix $R/include/cava
/,$(hdrs
))
37 install: $B/pipesim
$R/lib
/libcava.a
$(incf
)
38 -cp
$B/pipesim
$R/bin
/pipesim
39 -cp
$(incf
) $R/include/cava
43 $R/lib
/libcava.a
: $(aobj
)
48 rm -f lru_fsm_?way.h
*.o
*~ .
/#*#
52 # Pipeline simulator and library
54 $B/pipesim
: $(cobj
) $R/lib
/libcava.a
55 $(CC
) $(CFLAGS
) -o
$@
$^
$(libs
)
60 $B/pipesim.o
$B/fast_pipe.o
$B/trace_pipe.o
$B/count_pipe.o
$B/trace_count_pipe.o
: pipesim.h cache.h perfctr.h
$(hdrs
) $(incf
)
61 $B/fast_pipe.o
$B/trace_pipe.o
$B/count_pipe.o
$B/trace_count_pipe.o
: mainloop.h
62 $B/perfctr.o
: perfctr.h
64 lru_fsm_1way.h
: make_cache
67 lru_fsm_2way.h
: make_cache
70 lru_fsm_3way.h
: make_cache
73 lru_fsm_4way.h
: make_cache
77 $(CC
) $(CFLAGS
) -o
$@
-c
$<