CS3700-project4/Makefile

37 lines
912 B
Makefile

.PHONY: all test run
SOURCES=$(shell git ls-tree -r master --name-only)
CCIS_TEAM_NAME=hash-lang-uwu
CCIS_PROJECT_NAME=project4
CCIS_SERVER=login.ccs.neu.edu
CCIS_PATH=CS3700/$(CCIS_PROJECT_NAME)/
CCIS_FMT_CHECK=/course/cs3700sp20/code/project4/project4_format_check.py
CCIS_TURNIN=/course/cs3700sp20/bin/turnin
all: .setup
raco setup smol-http
raco make webcrawler
test: .setup
raco test -p smol-http
run:
ifndef FB_USERNAME
$(error "Provide FB_USERNAME variable")
endif
ifndef FB_PASSWORD
$(error "Provide FB_PASSWORD variable")
endif
./webcrawler -d $(FB_USERNAME) $(FB_PASSWORD)
.setup:
raco pkg install smol-http/
@touch $@
upload: $(SOURCES)
@rsync -avzzR --progress $^ $(CCIS_SERVER):$(CCIS_PATH)
@ssh $(CCIS_SERVER) -t -- "tput bold; $(CCIS_FMT_CHECK) $(CCIS_PATH); tput sgr0"
submit: upload
ssh $(CCIS_SERVER) -t -- "cd $(CCIS_PATH); make clean; $(CCIS_TURNIN) $(CCIS_PROJECT_NAME) ."