CS3700-project3/Makefile

54 lines
1.3 KiB
Makefile
Raw Normal View History

2020-03-14 22:08:58 +00:00
.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
2020-02-21 21:51:19 +00:00
all: release-build
2020-03-09 16:41:41 +00:00
debug-build:
2020-02-21 21:51:19 +00:00
cargo build
cp ./target/debug/hptp-recv ./3700recv
cp ./target/debug/hptp-send ./3700send
2020-02-21 21:51:19 +00:00
2020-03-09 16:41:41 +00:00
release-build:
cargo build --release
cp ./target/release/hptp-recv ./3700recv
cp ./target/release/hptp-send ./3700send
2020-02-21 21:51:19 +00:00
clean:
cargo clean
2020-03-09 16:41:41 +00:00
rm -f 3700send 3700recv
2020-02-21 21:51:19 +00:00
test:
cargo test
c: clean
t: test
2020-03-11 03:21:47 +00:00
.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
2020-03-11 03:57:53 +00:00
cd .netsim; ln -s ../3700send .; ln -s ../3700recv .
2020-03-11 03:53:51 +00:00
cd /usr/include; h2ph -d $(HOME)/perl5/lib/perl5/ -a sys/syscall.h
2020-03-11 03:21:47 +00:00
netsim-shell: .netsim
2020-03-14 19:07:00 +00:00
cp scripts/grade scripts/grade2 .netsim/
2020-03-11 03:21:47 +00:00
./scripts/create-net-ns.sh
2020-03-11 03:32:08 +00:00
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
2020-03-14 22:08:58 +00:00
ssh $(CCIS_SERVER) -t -- "cd $(CCIS_PATH); make clean; $(CCIS_TURNIN) $(CCIS_PROJECT_NAME) ."