-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
33 lines (23 loc) · 955 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
SUBMIT_TAR = lab2.tar.gz
SUBMISSION_SITE = "https://web.stanford.edu/class/cs240/labs/submission/"
GO := GOPATH="$(PWD)" go
# Recursive wildcard. Usage: $(call rwildcard,dir/,*.c)
rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d))
LIB_FILES := $(call rwildcard,src/mapreduce/,*.go)
all: wordcount invertedindex pagerank
wordcount: $(call rwildcard,src/wordcount/,*.go) $(LIB_FILES)
$(GO) build wordcount
invertedindex: $(call rwildcard,src/invertedindex/,*.go) $(LIB_FILES)
$(GO) build invertedindex
pagerank: $(call rwildcard,src/pagerank/,*.go) $(LIB_FILES)
$(GO) build pagerank
test:
@GOPATH="$(PWD)" ./test.sh
$(SUBMIT_TAR): $(call rwild,src/,*)
tar -czf $@ src/
submission: $(SUBMIT_TAR)
@echo "Your submission file "$^" was successfully created."
@echo "Submit it at $(SUBMISSION_SITE)."
clean:
rm -f wordcount invertedindex pagerank $(SUBMIT_TAR)
rm -f data/output/mr* data/output/diff*