New build script, and now building mininet from source (#69)
* moved basic exercise to new run script * forgot some files * CLI output now goes to logs * typo, and forgot topo file * fixed net.stop() bug * added temporary change to makefile * typos hard
This commit is contained in:
committed by
Robert Soule
parent
37d1632865
commit
bce45ca8e6
32
P4D2_2017_Fall/utils/Makefile
Normal file
32
P4D2_2017_Fall/utils/Makefile
Normal file
@@ -0,0 +1,32 @@
|
||||
BUILD_DIR = build
|
||||
PCAP_DIR = pcaps
|
||||
LOG_DIR = logs
|
||||
|
||||
TOPO = topology.json
|
||||
P4C = p4c-bm2-ss
|
||||
RUN_SCRIPT = ../../utils/run_exercise.py
|
||||
|
||||
source := $(wildcard *.p4)
|
||||
outfile := $(source:.p4=.json)
|
||||
|
||||
compiled_json := $(BUILD_DIR)/$(outfile)
|
||||
|
||||
all: run
|
||||
|
||||
run: build
|
||||
sudo python $(RUN_SCRIPT) -t $(TOPO) -j $(compiled_json)
|
||||
|
||||
stop:
|
||||
sudo mn -c
|
||||
|
||||
build: dirs $(compiled_json)
|
||||
|
||||
$(BUILD_DIR)/%.json: %.p4
|
||||
$(P4C) --p4v 16 -o $@ $<
|
||||
|
||||
dirs:
|
||||
mkdir -p $(BUILD_DIR) $(PCAP_DIR) $(LOG_DIR)
|
||||
|
||||
clean: stop
|
||||
rm -f *.pcap
|
||||
rm -rf $(BUILD_DIR) $(PCAP_DIR) $(LOG_DIR)
|
||||
Reference in New Issue
Block a user