Makefile 2.25 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
17
	$(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

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

####################################
# Tools in this repo
30
31

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

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

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

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

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

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

netsim_common/libnetsim_common.a:
50
51
52
53
54
55
56
57
58
59
60
61
62
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
	$(MAKE) -C netsim_common/


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

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

gem5:
	git clone git@github.com:nicklijl/gem5.git gem5

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