Makefile 2.49 KB
Newer Older
1
2
REPO_BASE= $(dir $(abspath $(lastword $(MAKEFILE_LIST))))

3
4
5
all: \
	corundum/corundum_verilator \
	corundum_bm/corundum_bm \
6
	i40e_bm/i40e_bm \
7
8
9
10
	net_tap/net_tap \
	net_wire/net_wire

clean:
11
12
	$(MAKE) -C corundum/ clean
	$(MAKE) -C corundum_bm/ clean
13
	$(MAKE) -C i40e_bm/ clean
14
15
16
17
18
	$(MAKE) -C dummy_nic/ clean
	$(MAKE) -C net_tap/ clean
	$(MAKE) -C net_wire/ clean
	$(MAKE) -C nicsim_common/ clean
	$(MAKE) -C netsim_common/ clean
19
	$(MAKE) -C libnicbm/ clean
20

21
22
23
24
25
26
27
28
29
help:
	@echo "Targets:"
	@echo "  all: builds all the tools directly in this repo"
	@echo "  clean: cleans all the tool folders in this repo"
	@echo "  build-images: prepare prereqs for VMs (images directory)"
	@echo "  external: clone and build our tools in external repos "
	@echo "            (qemu, gem5, ns-3)"
	@echo "  run-experiments: run all experiments (experiments directory,"
	@echo "                   implies all, build-images, external)"
30
31
32

####################################
# Tools in this repo
33
34

corundum/corundum_verilator: nicsim_common/libnicsim_common.a
35
	$(MAKE) -C corundum/ all
36

37
corundum_bm/corundum_bm: nicsim_common/libnicsim_common.a libnicbm/libnicbm.a
38
39
	$(MAKE) -C corundum_bm/ all

40
41
42
i40e_bm/i40e_bm: nicsim_common/libnicsim_common.a libnicbm/libnicbm.a
	$(MAKE) -C i40e_bm/ all

43
44
dummy_nic/dummy_nic: nicsim_common/libnicsim_common.a
	$(MAKE) -C dummy_nic all
45
46

net_tap/net_tap: netsim_common/libnetsim_common.a
47
	$(MAKE) -C net_tap/
48
49

net_wire/net_wire: netsim_common/libnetsim_common.a
50
	$(MAKE) -C net_wire/
51
52

nicsim_common/libnicsim_common.a:
53
	$(MAKE) -C nicsim_common/
54
55

netsim_common/libnetsim_common.a:
56
57
	$(MAKE) -C netsim_common/

58
59
libnicbm/libnicbm.a:
	$(MAKE) -C libnicbm
60
61
62
63
64
65
66

####################################
# External dependencies

external: gem5/ready qemu/ready ns-3/ready

gem5:
67
	git clone git@github.com:FreakyPenguin/gem5-cosim.git gem5
68
69
70
71
72
73
74
75
76

gem5/ready: gem5
	+cd gem5 && scons build/X86/gem5.opt -j`nproc`
	touch gem5/ready

qemu:
	git clone git@github.com:FreakyPenguin/qemu-cosim.git qemu

qemu/ready: qemu
77
	+cd qemu && ./configure \
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
	    --target-list=x86_64-softmmu \
	    --disable-werror \
	    --extra-cflags="-I$(REPO_BASE)/proto" \
	    --enable-cosim-pci && \
	  $(MAKE)
	touch qemu/ready

ns-3:
	git clone git@github.com:FreakyPenguin/ns-3-cosim.git ns-3

ns-3/ready: ns-3 netsim_common/libnetsim_common.a
	+cd ns-3 && COSIM_PATH=$(REPO_BASE) ./cosim-build.sh configure
	touch ns-3/ready

####################################
# External dependencies

run-experiments: all build-images external
	$(MAKE) -C experiments

build-images:
	$(MAKE) -C images