-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (43 loc) · 1.21 KB
/
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
BUILD_DIR := build
RESULT_DIR := results
HISTOGRAM_PATH := ./histogram
NAME ?= waddoups
build: build_
cmake --build ${BUILD_DIR}
.PHONY: build_
build_: build_dir
cd $(BUILD_DIR); cmake ..
# Generates a build directory
.PHONY: build_dir
build_dir:
@mkdir -p $(BUILD_DIR);
# Cleans all build files
.PHONY: clean
clean:
@echo "Removing build directory (${BUILD_DIR})..."
@rm -rf ${BUILD_DIR}
@rm -f ${HISTOGRAM_PATH}
@rm -rf .cache
# Zips all data together for submitting to canvas
.PHONY: submission
submission:
@echo "Zipping together project files..."
cd ..; \
tar --exclude='build*' --exclude='.cache*' --exclude='.venv*' \
--exclude-vcs -cvzf ${NAME}_hw2.tar.gz -C ${CURDIR} .
# Builds the project and symlinks ./build/cli to ./histogram
.PHONY: histogram
histogram: build
@echo "Adding ./histogram symlink..."
@rm -f ${HISTOGRAM_PATH}
@ln -s ${CURDIR}/${BUILD_DIR}/cli ${HISTOGRAM_PATH}
# Builds the project and runs the automated tests
.PHONY: test
test: build
@./${BUILD_DIR}/test
# Builds the project and running the timing analysis
.PHONY: log
log: build
@echo "Running timing analysis, this will take some time to complete..."
@mkdir -p ${RESULT_DIR}
@./${BUILD_DIR}/auto > ${RESULT_DIR}/log.csv