-
Notifications
You must be signed in to change notification settings - Fork 35
/
common.mk
43 lines (34 loc) · 1.15 KB
/
common.mk
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
# Common definition shared by all workloads
OUTPUT_LOG=output.log
EXPECTED_LOG=ref_output
DIFF_LOG=diff.log
help:
@echo " USAGE: make [OPTIONS] <TARGET>"
@echo ""
@echo " Valid <TARGET> are:"
@echo " all: build all binaries"
@echo " run: run application"
@echo " verify: verify application"
@echo " clean: clean up generated files"
@echo ""
@echo " Check documents for supported [OPTIONS]"
reset_generated_dir:
@if [ -n "${GENERATED_DIRS}" ]; then \
rm -rf ${GENERATED_DIRS}; \
mkdir ${GENERATED_DIRS}; \
fi
run: ${TARGET} reset_generated_dir
@if [ -n "${TARGET}" ]; then \
echo "Running ${TARGET}, output in ${OUTPUT_LOG}"; \
./${TARGET} ${RUN_ARGS} ${PERF_ARGS} > ${OUTPUT_LOG} 2>&1; \
fi
verify:
@echo "VERIFY-run [${TARGET}]"
@-make clean;
@echo "ReCompile with options: OUTPUT=1 VERIFY=1";
@-make OUTPUT=1 VERIFY=1 all;
@echo "Running...";
@./${TARGET} ${RUN_ARGS} > ${OUTPUT_LOG} 2>&1;
@${ROOT}/scripts/compare.sh ${OUTPUT_LOG} ${EXPECTED_LOG} ${DIFF_LOG}
clean:
@-/bin/rm -rf ${ALL_TARGETS} ${GENERATED_DIRS} *.o *~ core core.* ${OUTPUT_LOG} ${DIFF_LOG}