2020-02-02 05:58:13 +00:00
|
|
|
.PHONY: all test clean upload submit stage-test ccis-test ccis-clean
|
2020-02-02 04:20:04 +00:00
|
|
|
|
|
|
|
SOURCES=Makefile router README.md $(shell find . -path ./build -prune -o -iname '*.rkt' -print)
|
2020-01-29 21:23:07 +00:00
|
|
|
|
|
|
|
TESTS_DIR=build
|
2020-02-02 04:20:04 +00:00
|
|
|
CONTAINER_DIR=$(TESTS_DIR)/container
|
2020-01-29 21:23:07 +00:00
|
|
|
TEST_SIM_PKG=https://course.ccs.neu.edu/cs3700sp20/archive/bgp-sim.tar.gz
|
|
|
|
|
2020-02-02 04:20:04 +00:00
|
|
|
CCIS_TEAM_NAME=hash-lang-uwu
|
|
|
|
CCIS_PROJECT_NAME=project2-milestone
|
|
|
|
CCIS_SERVER=login.ccs.neu.edu
|
|
|
|
CCIS_PATH=CS3700/$(CCIS_PROJECT_NAME)/
|
|
|
|
CCIS_FMT_CHECK=/course/cs3700sp20/code/project2/project2_format_check.py
|
|
|
|
CCIS_TURNIN=/course/cs3700sp20/bin/turnin
|
|
|
|
|
|
|
|
|
2020-01-29 21:23:07 +00:00
|
|
|
all:
|
2020-02-02 04:20:04 +00:00
|
|
|
@echo "This recipe intentionally left blank"
|
2020-01-29 21:23:07 +00:00
|
|
|
|
2020-02-02 04:20:04 +00:00
|
|
|
clean:
|
|
|
|
sudo $(RM) -r $(TESTS_DIR)
|
2020-01-30 23:40:35 +00:00
|
|
|
|
2020-02-02 04:20:04 +00:00
|
|
|
|
|
|
|
$(TESTS_DIR):
|
2020-01-30 23:40:35 +00:00
|
|
|
mkdir -p $(TESTS_DIR)
|
2020-01-29 21:23:07 +00:00
|
|
|
cd $(TESTS_DIR) && wget -O bgp-sim.tar.gz $(TEST_SIM_PKG)
|
|
|
|
cd $(TESTS_DIR) && tar xf bgp-sim.tar.gz
|
|
|
|
|
2020-02-02 04:20:04 +00:00
|
|
|
$(CONTAINER_DIR):
|
|
|
|
mkdir -p $(TESTS_DIR)
|
|
|
|
sudo ./scripts/nspawn-support.sh create $(CONTAINER_DIR)
|
|
|
|
|
|
|
|
test: $(TESTS_DIR) $(CONTAINER_DIR)
|
|
|
|
sudo ./scripts/nspawn-support.sh boot $(CONTAINER_DIR)
|
|
|
|
|
|
|
|
|
|
|
|
upload: $(SOURCES)
|
|
|
|
@rsync -avzzR --progress $^ $(CCIS_SERVER):$(CCIS_PATH)
|
|
|
|
@ssh $(CCIS_SERVER) -t -- "tput bold; $(CCIS_FMT_CHECK) $(CCIS_PATH); tput sgr0"
|
|
|
|
|
|
|
|
stage-test: upload
|
|
|
|
ssh $(CCIS_SERVER) -t -- "cd $(CCIS_PATH); make ccis-test && make ccis-clean"
|
|
|
|
|
|
|
|
submit: upload
|
|
|
|
ssh $(CCIS_SERVER) -t -- "cd $(CCIS_PATH); make ccis-clean; $(CCIS_TURNIN) $(CCIS_PROJECT_NAME) $(CCIS_PATH)"
|
|
|
|
|
|
|
|
ccis-test: $(TESTS_DIR)
|
|
|
|
cd $(TESTS_DIR) && ./sim --router ../router milestone
|
2020-01-29 21:23:07 +00:00
|
|
|
|
2020-02-02 04:20:04 +00:00
|
|
|
ccis-clean:
|
|
|
|
$(RM) -r $(TESTS_DIR)
|