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

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

clean:
10
11
12
13
14
15
16
	$(MAKE) -C corundum/ clean
	$(MAKE) -C corundum_bm/ clean
	$(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
17
	$(MAKE) -C libnicbm/ clean
18

19
20
21
22
23
24
25
26
27
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)"
28
29
30

####################################
# Tools in this repo
31
32

corundum/corundum_verilator: nicsim_common/libnicsim_common.a
33
	$(MAKE) -C corundum/ all
34

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

dummy_nic/dummy_nic: nicsim_common/libnicsim_common.a
	$(MAKE) -C dummy_nic all
40
41

net_tap/net_tap: netsim_common/libnetsim_common.a
42
	$(MAKE) -C net_tap/
43
44

net_wire/net_wire: netsim_common/libnetsim_common.a
45
	$(MAKE) -C net_wire/
46
47

nicsim_common/libnicsim_common.a:
48
	$(MAKE) -C nicsim_common/
49
50

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

53
54
libnicbm/libnicbm.a:
	$(MAKE) -C libnicbm
55
56
57
58
59
60
61

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

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

gem5:
62
	git clone git@github.com:FreakyPenguin/gem5-cosim.git gem5
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94

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
	cd qemu && ./configure \
	    --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