Makefile 6.11 KB
Newer Older
Mikaël Salson's avatar
Mikaël Salson committed
1

2
COVERAGE=
Mathieu Giraud's avatar
Mathieu Giraud committed
3
VIDJIL_ALGO_SRC = algo/
4
VIDJIL_BROWSER_SRC = browser/
Mathieu Giraud's avatar
Mathieu Giraud committed
5 6
VIDJIL_SERVER_SRC = server/

7
ifeq (${COVERAGE},1)
Mikaël Salson's avatar
Mikaël Salson committed
8
	COVERAGE_OPTION=--coverage
9 10 11 12
else
	COVERAGE_OPTION=
endif

13 14
TEE = python tools/tee.py -v

15 16
test_browser: unit_browser functional_browser

17 18
test_server: unit_server

19
test_tools_if_python:
20
	@((python tools/check_python_version.py && $(MAKE) test_tools) || (python tools/check_python_version.py || echo "!!! Bad python version, we skip tools tests..."))
21

22
test_tools:
Mikaël Salson's avatar
Mikaël Salson committed
23
	$(MAKE) -C tools/tests
24

25
shouldvdj_generate:
26
	@echo
27
	rm -rf data/gen
28
	mkdir -p data/gen
29
	cd germline ; python generate-recombinations.py --random-deletions 8,4:3,1:5,3 --random-insertions 5,4 -e .01
30 31


32
### Browser tests
33

34
unit_browser:
Mikaël Salson's avatar
Mikaël Salson committed
35
	$(MAKE) -C browser/test unit
36 37

functional_browser:
Mikaël Salson's avatar
Mikaël Salson committed
38
	$(MAKE) -C browser/test functional
39 40

headless_browser:
Mikaël Salson's avatar
Mikaël Salson committed
41
	$(MAKE) -C browser/test headless
42

43
unit_server:
Mikaël Salson's avatar
Mikaël Salson committed
44
	$(MAKE) -C server/ unit
45

46 47
###

Mathieu Giraud's avatar
Mathieu Giraud committed
48 49 50 51
data:
	$(MAKE) -C algo/tests/data

germline browser server: %:
Mikaël Salson's avatar
Mikaël Salson committed
52
	$(MAKE) -C $@
Mikaël Salson's avatar
Mikaël Salson committed
53 54

cleanall: clean
Mathieu Giraud's avatar
Mathieu Giraud committed
55
	$(MAKE) -C algo/tests/data $^
Mikaël Salson's avatar
Mikaël Salson committed
56 57 58
	$(MAKE) -C germline $^
	$(MAKE) -C $(VIDJIL_ALGO_SRC) cleanall
	$(MAKE) -C server cleanall
Mikaël Salson's avatar
Mikaël Salson committed
59

Mikaël Salson's avatar
Mikaël Salson committed
60
.PHONY: all test should clean cleanall distrib data germline unit_coverage should_coverage coverage data germline browser server doc
Mikaël Salson's avatar
Mikaël Salson committed
61 62

RELEASE_TAG="notag"
Mathieu Giraud's avatar
Mathieu Giraud committed
63
RELEASE_H = $(VIDJIL_ALGO_SRC)/release.h
64
RELEASE_SOURCE = $(wildcard $(VIDJIL_ALGO_SRC)/*.cpp) $(wildcard $(VIDJIL_ALGO_SRC)/*.h)  $(wildcard $(VIDJIL_ALGO_SRC)/core/*.cpp) $(wildcard $(VIDJIL_ALGO_SRC)/core/*.hpp)  $(wildcard $(VIDJIL_ALGO_SRC)/tests/unit-tests/*.cpp) $(wildcard $(VIDJIL_ALGO_SRC)/core/*.h)  $(wildcard $(VIDJIL_ALGO_SRC)/tests/unit-tests/*.h)  $(wildcard $(VIDJIL_ALGO_SRC)/cgi/*.cpp) $(wildcard $(VIDJIL_ALGO_SRC)/tools/*.cpp) $(wildcard $(VIDJIL_ALGO_SRC)/tools/Makefile)  $(wildcard $(VIDJIL_ALGO_SRC)/lib/*.cpp) $(wildcard $(VIDJIL_ALGO_SRC)/lib/*.h) $(wildcard $(VIDJIL_ALGO_SRC)/lib/*.hpp) $(wildcard $(VIDJIL_ALGO_SRC)/lib/unbam/*.c)  $(wildcard $(VIDJIL_ALGO_SRC)/lib/unbam/*.h)  $(wildcard $(VIDJIL_ALGO_SRC)/lib/unbam/Makefile) $(wildcard $(VIDJIL_ALGO_SRC)/lib/unbam/LICENSE) $(wildcard tools/*.py)
65
RELEASE_MAKE = ./Makefile  $(VIDJIL_ALGO_SRC)/Makefile  $(VIDJIL_ALGO_SRC)/core/Makefile $(VIDJIL_ALGO_SRC)/tests/Makefile $(VIDJIL_ALGO_SRC)/lib/Makefile germline/Makefile data/Makefile tools/tests/Makefile doc/Makefile
66
RELEASE_TESTS =  doc/format-analysis.org data/get-sequences $(wildcard data/*.vidjil) $(wildcard data/*.analysis) $(wildcard data/*.g) $(wildcard data/*.fa) $(wildcard data/*.fq) $(wildcard data/*.bam) $(VIDJIL_ALGO_SRC)/tests/repseq_vdj.py   $(VIDJIL_ALGO_SRC)/tests/should-vdj-to-tap.py $(VIDJIL_ALGO_SRC)/tests/ansi.py $(wildcard $(VIDJIL_ALGO_SRC)/tests/should-vdj-tests/*.should-vdj.fa) $(wildcard $(VIDJIL_ALGO_SRC)/tests/should-vdj-tests/*.should-locus.fa) $(VIDJIL_ALGO_SRC)/tests/should-to-tap.sh $(wildcard $(VIDJIL_ALGO_SRC)/tests/should-get-tests/*.should-get) $(wildcard $(VIDJIL_ALGO_SRC)/tests/bugs/*.fa)  $(wildcard $(VIDJIL_ALGO_SRC)/tests/bugs/*.should-get) $(VIDJIL_ALGO_SRC)/tests/format-json.sh $(wildcard doc/analysis-example.vidjil) $(wildcard tools/tests/*.should_get) tools/tests/should-to-tap.sh tools/diff_json.sh
67
RELEASE_GERMLINES = germline/germline_id germline/get-saved-germline germline/get-germline germline/split-from-imgt.py $(wildcard germline/*.g) germline/revcomp-fasta.py germline/fasta.py
68
RELEASE_HELP = doc/algo.org doc/locus.org doc/dev.org doc/should-vdj.org doc/credits.org doc/CHANGELOG  doc/LICENSE README.org INSTALL.org
69
RELEASE_FILES = $(RELEASE_SOURCE) $(RELEASE_TESTS) $(RELEASE_MAKE) $(RELEASE_GERMLINES) $(RELEASE_HELP) data/segmentation.fasta $(wildcard data/*.fa.gz) $(wildcard data/*.label)
Mikaël Salson's avatar
Mikaël Salson committed
70 71 72 73 74 75
RELEASE_ARCHIVE = vidjil-$(RELEASE_TAG).tgz

CURRENT_DIR = vidjil
DIST_DIR=$(CURRENT_DIR)-$(RELEASE_TAG)
RELEASE_FILES_VID = $(RELEASE_FILES)

76 77 78 79 80 81
# Browser
RELEASE_JS = $(VIDJIL_BROWSER_SRC)/js/release.js
RELEASE_BROWSER_ARCHIVE = vidjil-browser-$(RELEASE_TAG).tgz
DIST_BROWSER_DIR=vidjil-browser-$(RELEASE_TAG)
TEST_FILES_BROWSER= Makefile $(VIDJIL_BROWSER_SRC)/test/Makefile $(wildcard $(VIDJIL_BROWSER_SRC)/test/*.rb) $(wildcard $(VIDJIL_BROWSER_SRC)/test/QUnit/*)  $(wildcard $(VIDJIL_BROWSER_SRC)/test/QUnit/testFiles/*.js)
RELEASE_FILES_BROWSER=$(TEST_FILES_BROWSER) $(wildcard $(VIDJIL_BROWSER_SRC)/*.html) $(wildcard $(VIDJIL_BROWSER_SRC)/js/*.js) $(wildcard $(VIDJIL_BROWSER_SRC)/js/lib/*.js) $(wildcard $(VIDJIL_BROWSER_SRC)/css/*.css) 
Mikaël Salson's avatar
Mikaël Salson committed
82

Mikaël Salson's avatar
Mikaël Salson committed
83
# $(MAKE) distrib RELEASE_TAG=2013.04alpha
Mikaël Salson's avatar
Mikaël Salson committed
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
distrib:	
	$(info ==== Release $(RELEASE_TAG) ====)

	# Tag the release
	if test "$(RELEASE_TAG)" != "notag"; then \
		git tag -f release-$(RELEASE_TAG); \
		echo '#define RELEASE_TAG "$(RELEASE_TAG)"' > $(RELEASE_H); \
	fi

	mkdir -p release 
	rm -rf release/$(RELEASE_ARCHIVE) release/$(DIST_DIR)
	mkdir -p release/$(DIST_DIR)
	for file in  $(RELEASE_FILES_VID); do\
		dir=release/$(DIST_DIR)/`dirname "$$file"`;	\
		mkdir -p $$dir;	\
		cp "$$file" $$dir;	\
	done
101
	make -C release/$(DIST_DIR)/doc html || true
102

Mikaël Salson's avatar
Mikaël Salson committed
103 104 105 106 107 108 109 110
	cd release && tar cvzf  $(RELEASE_ARCHIVE) $(DIST_DIR) \
	&& rm -rf $(DIST_DIR)

	# Untag the source
	rm -f $(RELEASE_H) ; touch $(RELEASE_H)

	# Check archive
	cd release && tar xvfz $(RELEASE_ARCHIVE)
Mikaël Salson's avatar
Mikaël Salson committed
111 112 113
	cd release/$(DIST_DIR) && $(MAKE)
	cd release/$(DIST_DIR) && $(MAKE) germline
	cd release/$(DIST_DIR) && $(MAKE) data
114
	cd release/$(DIST_DIR) && $(MAKE) -C algo test
Mikaël Salson's avatar
Mikaël Salson committed
115
	cd release/$(DIST_DIR) && $(MAKE) clean && $(MAKE) static && mv vidjil vidjil-$(RELEASE_TAG)_`uname -m`
Mikaël Salson's avatar
Mikaël Salson committed
116 117


118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
release_browser:
	$(info ==== Browser Release $(RELEASE_TAG) ====)

	# Tag the release
	if test "$(RELEASE_TAG)" != "notag"; then \
		git tag -f release-$(RELEASE_TAG); \
		echo 'RELEASE_TAG = "$(RELEASE_TAG)"' > $(RELEASE_JS); \
	fi

	mkdir -p release 
	rm -rf release/$(RELEASE_BROWSER_ARCHIVE) release/$(DIST_BROWSER_DIR)
	mkdir -p release/$(DIST_BROWSER_DIR)
	for file in  $(RELEASE_FILES_BROWSER); do\
		dir=release/$(DIST_BROWSER_DIR)/`dirname "$$file"`;	\
		mkdir -p $$dir;	\
		cp "$$file" $$dir;	\
	done
	cd release && tar cvzf  $(RELEASE_BROWSER_ARCHIVE) $(DIST_BROWSER_DIR) \
	&& rm -rf $(DIST_BROWSER_DIR)

	# Untag the source
	rm -f $(RELEASE_JS) ; touch $(RELEASE_JS)

	# Check archive
	cd release && tar xvfz $(RELEASE_BROWSER_ARCHIVE)
Mikaël Salson's avatar
Mikaël Salson committed
143
	cd release/$(DIST_BROWSER_DIR) && $(MAKE) unit_browser
144 145


Mikaël Salson's avatar
Mikaël Salson committed
146