"sgl-kernel/csrc/vscode:/vscode.git/clone" did not exist on "32cc66efa586af348b7c51f21a68e4771db7219c"
rules.mk 3.21 KB
Newer Older
Antoine Kaufmann's avatar
Antoine Kaufmann committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Copyright 2021 Max Planck Institute for Software Systems, and
# National University of Singapore
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

23
24
25
26
include mk/subdir_pre.mk

QEMU_IMG := $(d)qemu/build/qemu-img
QEMU := $(d)qemu/build/qemu-system-x86_64
27
GEM5_VARIANT ?= fast
28

29
30
EXTERNAL_SIMS_DIR := $(d)

31
32
$(eval $(call subdir,simics))

Antoine Kaufmann's avatar
Antoine Kaufmann committed
33
external: $(d)gem5/ready $(d)qemu/ready $(d)ns-3/ready $(d)femu/ready
34
.PHONY: external gem5-clean qemu-clean ns-3-clean femu-clean
35
36

$(d)gem5:
37
	git clone https://github.com/simbricks/gem5.git $@
38
39

$(d)gem5/ready: $(d)gem5
40
41
42
43
44
	cd $< && \
		CCFLAGS_EXTRA="-I$(abspath $(lib_dir))" \
		LIBRARY_PATH="$(abspath $(lib_dir))" \
		scons build/X86/gem5.$(GEM5_VARIANT) \
		--ignore-style -j`nproc`
45
46
	touch $@

47
48
49
50
gem5-clean:
	-cd $(EXTERNAL_SIMS_DIR)gem5 && scons --clean build/X86/gem5.$(GEM5_VARIANT)
	rm -f $(EXTERNAL_SIMS_DIR)gem5/ready

51
52

$(d)qemu:
53
	git clone https://github.com/simbricks/qemu.git $@
54
55
56
57
58

$(d)qemu/ready: $(d)qemu
	+cd $< && ./configure \
	    --target-list=x86_64-softmmu \
	    --disable-werror \
59
	    --with-pkgversion=SimBricks \
60
	    --extra-cflags="-I$(abspath $(lib_dir))" \
61
62
	    --extra-ldflags="-L$(abspath $(lib_dir))" \
	    --enable-simbricks \
63
	    --enable-simbricks-pci && \
64
65
66
67
68
69
70
71
72
	  $(MAKE)
	touch $@

$(QEMUG_IMG): $(d)qemu/ready
	touch $@

$(QEMU): $(d)qemu/ready
	touch $@

73
74
75
76
qemu-clean:
	-+cd $(EXTERNAL_SIMS_DIR)qemu && $(MAKE) clean
	rm -f $(EXTERNAL_SIMS_DIR)qemu/ready

77
78

$(d)ns-3:
79
	git clone https://github.com/simbricks/ns-3.git $@
80

81
$(d)ns-3/ready: $(d)ns-3 $(lib_netif)
Marvin Meiers's avatar
Marvin Meiers committed
82
	+cd $< && SIMBRICKS_PATH=$(abspath $(base_dir)) ./simbricks-build.sh configure
83
84
	touch $@

85
ns-3-clean:
Marvin Meiers's avatar
Marvin Meiers committed
86
	-cd $(EXTERNAL_SIMS_DIR)ns-3 && ./ns3 clean
87
88
	rm -f $(EXTERNAL_SIMS_DIR)ns-3/ready

Antoine Kaufmann's avatar
Antoine Kaufmann committed
89
$(d)femu:
90
	git clone https://github.com/simbricks/femu.git $@
Antoine Kaufmann's avatar
Antoine Kaufmann committed
91
92

$(d)femu/ready: $(d)femu $(lib_nicif)
93
94
95
	cd $< && make EXTRA_LDFLAGS="-L$(abspath $(lib_dir))/simbricks/nicif/ \
	      -L$(abspath $(lib_dir))/simbricks/pcie/ \
	      -L$(abspath $(lib_dir))/simbricks/base/ "\
Antoine Kaufmann's avatar
Antoine Kaufmann committed
96
97
98
	    EXTRA_CPPFLAGS=-I$(abspath $(lib_dir))
	touch $@

99
100
101
102
femu-clean:
	-+cd $(EXTERNAL_SIMS_DIR)femu && $(MAKE) clean
	rm -f $(EXTERNAL_SIMS_DIR)femu/ready

103
DISTCLEAN := $(d)gem5 $(d)qemu $(d)ns-3 $(d)femu
104
EXTERNAL_CLEAN_TASKS := gem5-clean qemu-clean ns-3-clean femu-clean
105
include mk/subdir_post.mk