54 lines
1.3 KiB
Makefile
54 lines
1.3 KiB
Makefile
.PHONY: all clean test c t netsim-shell pat upload submit debug-build release-build
|
|
|
|
SOURCES=$(shell git ls-tree -r master --name-only)
|
|
CCIS_TEAM_NAME=hash-lang-uwu
|
|
CCIS_PROJECT_NAME=project3
|
|
CCIS_SERVER=login.ccs.neu.edu
|
|
CCIS_PATH=CS3700/$(CCIS_PROJECT_NAME)/
|
|
CCIS_FMT_CHECK=/course/cs3700sp20/code/project3/project3_format_check.py
|
|
CCIS_TURNIN=/course/cs3700sp20/bin/turnin
|
|
|
|
all: release-build
|
|
|
|
debug-build:
|
|
cargo build
|
|
cp ./target/debug/hptp-recv ./3700recv
|
|
cp ./target/debug/hptp-send ./3700send
|
|
|
|
release-build:
|
|
cargo build --release
|
|
cp ./target/release/hptp-recv ./3700recv
|
|
cp ./target/release/hptp-send ./3700send
|
|
|
|
clean:
|
|
cargo clean
|
|
rm -f 3700send 3700recv
|
|
|
|
test:
|
|
cargo test
|
|
|
|
c: clean
|
|
|
|
t: test
|
|
|
|
.netsim:
|
|
mkdir $@
|
|
curl -Ss https://course.ccs.neu.edu/cs3700sp20/archive/tcp-sim.tgz | tar xzf - -C $@
|
|
sed -i '/.usr.bin.sudo/d' .netsim/netsim
|
|
cd .netsim; ln -s ../3700send .; ln -s ../3700recv .
|
|
cd /usr/include; h2ph -d $(HOME)/perl5/lib/perl5/ -a sys/syscall.h
|
|
|
|
netsim-shell: .netsim
|
|
cp scripts/grade scripts/grade2 .netsim/
|
|
./scripts/create-net-ns.sh
|
|
|
|
pat:
|
|
cat scripts/data.txt
|
|
|
|
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) ."
|