-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (38 loc) · 1008 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
.ONESHELL:
GCC_FLAGS = -Wall -fopenmp
GCC_L = -lOpenCL
ASSIGNMENT_GROUP=B
ASSIGNMENT_NUMBER=05
ASSIGNMENT_TITLE=pvs$(ASSIGNMENT_NUMBER)-grp$(ASSIGNMENT_GROUP)
KERNEL=1
.PHONY: build
build: matmult
.PHONY: debug
debug: GCC_FLAGS += -g
debug: build
.PHONY: matmult
matmult:
g++ $(GCC_FLAGS) matmult.cpp -o matmult $(GCC_L) -DKERNEL=$(KERNEL)
.PHONY: test
test: build
./matmult
.PHONY: clean
clean:
rm matmult
.PHONY: codeformat
codeformat:
clang-format -i *.[ch]pp
PDF_FILENAME=$(ASSIGNMENT_TITLE).pdf
.PHONY: pdf
pdf:
pandoc pvs.md -o $(PDF_FILENAME) --from markdown --template ~/.pandoc/eisvogel.latex --listings
FILES=Makefile README.md *.[ch]pp $(PDF_FILENAME)
ASSIGNMENT_DIR=$(ASSIGNMENT_TITLE)
TARBALL_NAME=$(ASSIGNMENT_TITLE)-piekarski-wichmann-ruckel.tar.gz
.PHONY: tarball
tarball: pdf
[ -z "$(TARBALL_NAME)" ] || rm $(TARBALL_NAME)
mkdir $(ASSIGNMENT_DIR)
for f in $(FILES); do cp $$f $(ASSIGNMENT_DIR); done
tar zcvf $(TARBALL_NAME) $(ASSIGNMENT_DIR)
rm -fr $(ASSIGNMENT_DIR)