time for crab
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

52 lines
1.4 KiB

  1. .PHONY: all test clean upload submit stage-test ccis-test ccis-clean
  2. SOURCES=Makefile router README.md $(shell find . -path ./build -prune -o -iname '*.rkt' -print)
  3. TESTS_DIR=build
  4. CONTAINER_DIR=$(TESTS_DIR)/container
  5. TEST_SIM_PKG=https://course.ccs.neu.edu/cs3700sp20/archive/bgp-sim.tar.gz
  6. CCIS_TEAM_NAME=hash-lang-uwu
  7. CCIS_PROJECT_NAME=project2
  8. CCIS_SERVER=login.ccs.neu.edu
  9. CCIS_PATH=CS3700/$(CCIS_PROJECT_NAME)/
  10. CCIS_FMT_CHECK=/course/cs3700sp20/code/project2/project2_format_check.py
  11. CCIS_TURNIN=/course/cs3700sp20/bin/turnin
  12. all:
  13. @echo "This recipe intentionally left blank"
  14. clean:
  15. sudo $(RM) -r $(TESTS_DIR)
  16. $(TESTS_DIR):
  17. mkdir -p $(TESTS_DIR)
  18. cd $(TESTS_DIR) && wget -O bgp-sim.tar.gz $(TEST_SIM_PKG)
  19. cd $(TESTS_DIR) && tar xf bgp-sim.tar.gz
  20. $(CONTAINER_DIR):
  21. mkdir -p $(TESTS_DIR)
  22. sudo ./scripts/nspawn-support.sh create $(CONTAINER_DIR)
  23. test: $(TESTS_DIR) $(CONTAINER_DIR)
  24. sudo ./scripts/nspawn-support.sh boot $(CONTAINER_DIR)
  25. upload: $(SOURCES)
  26. @rsync -avzzR --progress $^ $(CCIS_SERVER):$(CCIS_PATH)
  27. @ssh $(CCIS_SERVER) -t -- "tput bold; $(CCIS_FMT_CHECK) $(CCIS_PATH); tput sgr0"
  28. stage-test: upload
  29. ssh $(CCIS_SERVER) -t -- "cd $(CCIS_PATH); make ccis-test && make ccis-clean"
  30. submit: upload
  31. ssh $(CCIS_SERVER) -t -- "cd $(CCIS_PATH); make ccis-clean; $(CCIS_TURNIN) $(CCIS_PROJECT_NAME) ."
  32. ccis-test: $(TESTS_DIR)
  33. cd $(TESTS_DIR) && ./sim --router ../router all
  34. ccis-clean:
  35. $(RM) -r $(TESTS_DIR)