Debian Codegraph @

applications/bed/starch/test/nested_and_duplicate_elements/makefile

raw
1 #
2 # makefile
3 #
4
5 TMP = /tmp
6 USER := $(shell whoami)
7 THIS_DIR := ${shell pwd}
8 RESULTS = ${TMP}/${USER}/starch_regression_test/results/nested_and_duplicate_elements
9 SRC = ${THIS_DIR}/src
10 BED_INPUT = ${THIS_DIR}/data/test_input.bed
11 STARCH_BZIP2 = ${RESULTS}/test_output.bz2starch
12 STARCH_GZIP = ${RESULTS}/test_output.gzstarch
13 PLATFORM := ${shell uname}
14 BIN_DIR = ${THIS_DIR}/../binaries
15 LINUX_BINDIR = ${BIN_DIR}/linux
16 OSX_BINDIR = ${BIN_DIR}/osx
17 VERSION = v2.2
18 VERSIONP = 2p2p0
19
20 all: archives tests
21
22 archives:
23 if [ ! -d ${RESULTS} ]; then mkdir -p ${RESULTS}; fi
24 @echo "[STARCH] making bzip2-starch archive with v2.2 or greater metadata..."
25 ifeq (${PLATFORM},Linux)
26 if [ ! -s ${STARCH_BZIP2} ]; then ${LINUX_BINDIR}/${VERSION}/bin/starch --bzip2 ${BED_INPUT} > ${STARCH_BZIP2}; fi
27 endif
28 ifeq (${PLATFORM},Darwin)
29 if [ ! -s ${STARCH_BZIP2} ]; then ${OSX_BINDIR}/${VERSION}/bin/starch --bzip2 ${BED_INPUT} > ${STARCH_BZIP2}; fi
30 endif
31 @echo "[STARCH] making gzip-starch archive with v2.2 or greater metadata..."
32 ifeq (${PLATFORM},Linux)
33 if [ ! -s ${STARCH_GZIP} ]; then ${LINUX_BINDIR}/${VERSION}/bin/starch --gzip ${BED_INPUT} > ${STARCH_GZIP}; fi
34 endif
35 ifeq (${PLATFORM},Darwin)
36 if [ ! -s ${STARCH_GZIP} ]; then ${OSX_BINDIR}/${VERSION}/bin/starch --gzip ${BED_INPUT} > ${STARCH_GZIP}; fi
37 endif
38 @echo "[STARCH] made archives!"
39
40 tests: nested_tests duplicate_tests
41 @echo "[STARCH] nested- and duplicate-element tests passed!"
42
43 nested_tests: nested_tests_bzip2 nested_tests_gzip
44 @echo "[STARCH] nested element tests passed!"
45
46 nested_tests_bzip2:
47 @echo "[STARCH] testing (bzip2-starch) nested elements..."
48 ifeq (${PLATFORM},Linux)
49 @${SRC}/hasNestedElements.py ${LINUX_BINDIR}/${VERSION}/bin/unstarch ${STARCH_BZIP2}
50 endif
51 ifeq (${PLATFORM},Darwin)
52 @${SRC}/hasNestedElements.py ${OSX_BINDIR}/${VERSION}/bin/unstarch ${STARCH_BZIP2}
53 endif
54 @echo "[STARCH] (bzip2-starch) nested element tests passed!"
55
56 nested_tests_gzip:
57 @echo "[STARCH] testing (gzip-starch) nested elements..."
58 ifeq (${PLATFORM},Linux)
59 @${SRC}/hasNestedElements.py ${LINUX_BINDIR}/${VERSION}/bin/unstarch ${STARCH_GZIP}
60 endif
61 ifeq (${PLATFORM},Darwin)
62 @${SRC}/hasNestedElements.py ${OSX_BINDIR}/${VERSION}/bin/unstarch ${STARCH_GZIP}
63 endif
64 @echo "[STARCH] (gzip-starch) nested element tests passed!"
65
66 duplicate_tests: duplicate_tests_bzip2 duplicate_tests_gzip
67 @echo "[STARCH] duplicate element tests passed!"
68
69 duplicate_tests_bzip2:
70 @echo "[STARCH] testing (bzip2-starch) duplicate elements..."
71 ifeq (${PLATFORM},Linux)
72 @${SRC}/hasDuplicateElements.py ${LINUX_BINDIR}/${VERSION}/bin/unstarch ${STARCH_BZIP2}
73 endif
74 ifeq (${PLATFORM},Darwin)
75 @${SRC}/hasDuplicateElements.py ${OSX_BINDIR}/${VERSION}/bin/unstarch ${STARCH_BZIP2}
76 endif
77 @echo "[STARCH] (bzip2-starch) duplicate element tests passed!"
78
79 duplicate_tests_gzip:
80 @echo "[STARCH] testing (gzip-starch) duplicate elements..."
81 ifeq (${PLATFORM},Linux)
82 @${SRC}/hasDuplicateElements.py ${LINUX_BINDIR}/${VERSION}/bin/unstarch ${STARCH_GZIP}
83 endif
84 ifeq (${PLATFORM},Darwin)
85 @${SRC}/hasDuplicateElements.py ${OSX_BINDIR}/${VERSION}/bin/unstarch ${STARCH_GZIP}
86 endif
87 @echo "[STARCH] (gzip-starch) duplicate element tests passed!"
88
89 clean:
90 @echo "[STARCH] cleaning up intermediate starch archives..."
91 @rm -rf ${RESULTS}
92 @echo "[STARCH] all clean!"