cavatools: initialize repository
[cavatools.git] / cachesim / Makefile
1 # Path where things should be installed
2 R = $(HOME)
3 B = build
4
5 _dummy := $(shell mkdir -p $B)
6
7 # Dependent headers
8 hdrs := opcodes.h insn.h shmfifo.h caveat.h
9
10 # Text substitutions
11 hdrs := $(addprefix $R/include/cava/,$(hdrs))
12
13 aobj := tagonlycache.o container.o queues.o utilities.o
14 cobj := cachesim.o
15
16 # Text substitutions
17 aobj := $(addprefix $B/,$(aobj))
18 cobj := $(addprefix $B/,$(cobj))
19
20 CFLAGS = -I$R/include/cava -g -Ofast
21 LIBS = $R/lib/libcava.a -lrt -lpthread
22
23 $B/cachesim: $(cobj) $R/lib/libcava.a
24 $(CC) $(CFLAGS) -o $B/cachesim $^ $(LIBS)
25
26 $R/lib/libcava.a: $(aobj)
27 ar rs $@ $^
28
29 $B/cachesim.o: $(hdrs)
30
31 $B/%.o: %.c
32 $(CC) $(CFLAGS) -o $@ -c $<
33
34 install: $B/cachesim
35 cp $B/cachesim $R/bin/
36
37 clean:
38 rm -rf $B *~