Blame view

RIOT/dist/tools/desvirt/Makefile.desvirt 1.57 KB
a752c7ab   elopes   add first test an...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
  TOOL_NAME=desvirt
  TOOL_URL=https://github.com/des-testbed/desvirt.git
  TOOL_VERSION=master
  TOOL_DIR=$(RIOTBASE)/dist/tools/$(TOOL_NAME)/$(TOOL_NAME)
  
  .PHONY: desvirt-check desvirt-check-topo-file desvirt-check-topo-args desvirt-clean \
          desvirt-distclean desvirt-define desvirt-undefine desvirt-start desvirt-stop desvirt-list
  
  desvirt-check:
  
      ifeq ($(wildcard $(TOOL_DIR)),)
  	    git clone $(TOOL_URL) $(TOOL_DIR)
  	    cd $(TOOL_DIR) && git reset --hard $(TOOL_VERSION)
      endif
  
  desvirt-check-topo-file: desvirt-check
  
      ifndef TOPO
  	    $(error TOPO is not set)
      endif
  
  desvirt-check-topo-args: desvirt-check
  
      ifndef TOPO_TYPE
  	    $(error TOPO_TYPE is not set)
      endif
      ifndef TOPO_SIZE
  	    $(error TOPO_SIZE is not set)
      endif
  
  desvirt-define: desvirt-check-topo-file
  	cd $(TOOL_DIR) && ./vnet -d $(TOOL_DIR)/.desvirt/ -n $(basename $(TOPO))
  
  desvirt-undefine: desvirt-check-topo-file
  	cd $(TOOL_DIR) && ./vnet -u $(TOOL_DIR)/.desvirt/ -n $(basename $(TOPO))
  
  desvirt-start: desvirt-check-topo-file
  	cd $(TOOL_DIR) && ./vnet -s -n $(basename $(TOPO))
  
  desvirt-stop: desvirt-check-topo-file
  	cd $(TOOL_DIR) && ./vnet -q -n $(basename $(TOPO))
  
  desvirt-topology: desvirt-check-topo-args all
  	cd $(TOOL_DIR) && \
  	./topology_creator -e $(ELFFILE) -n riot_native -r ieee802154 -s$(TOPO_SIZE) -t$(TOPO_TYPE) -f $(TOPO_TYPE)$(TOPO_SIZE)
  
  desvirt-list: desvirt-check
  	cd $(TOOL_DIR) && ./vnet -l
  
  desvirt-clean::
  
      ifneq ($(wildcard $(TOOL_DIR)),"")
  	    cd $(TOOL_DIR) && git clean -x -f && git reset --hard $(TOOL_VERSION)
      endif
  
  desvirt-distclean::
  	rm -rf $(TOOL_DIR)