-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
45 lines (35 loc) · 955 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
MASTER_DIR=$(shell pwd)
BIN_DIR=$(MASTER_DIR)/bin
LIB=$(MASTER_DIR)/libs
AUTOCONF = autoconf
AUTOHEADER = autoheader
CFLAGS:=
ifeq ($(mode), debug)
CFLAGS:=$(CFLAGS) -O0 -g -DDEBUG
else
CFLAGS:=$(CFLAGS) -O3
endif
CXXFLAGS:=-std=c++11 $(CFLAGS)
export $(CFLAGS)
export $(CXXFLAGS)
BCFTOOLS_DIR=$(LIB)/bcftools
BCFTOOLS=$(BIN_DIR)/bcftools
HTS_DIR=$(LIB)/htslib
HTS_LIB=$(HTS_DIR)/libhts.a
all: $(COMPACT) $(BCFTOOLS)
.PHONY: all
clean:
@rm -rf $(BIN_DIR)
$(MAKE) clean -C $(HTS_DIR)
$(MAKE) clean -C $(BCFTOOLS_DIR)
.PHONY: clean
$(BCFTOOLS): $(HTS_LIB)
@echo "- Building in bcftools"
@cd $(BCFTOOLS_DIR) && $(AUTOHEADER) && $(AUTOCONF) && ./configure
@$(MAKE) --no-print-directory -C $(BCFTOOLS_DIR)
@mkdir -p $(BIN_DIR)
@cp $(BCFTOOLS_DIR)/bcftools $@
$(HTS_LIB):
@echo "- Building in htslib"
@cd $(HTS_DIR) && $(AUTOHEADER) && $(AUTOCONF) && ./configure --disable-lzma --disable-lcurl
@$(MAKE) --no-print-directory -C $(HTS_DIR)