-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
81 lines (57 loc) · 1.92 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
CC = gcc
CXX = g++
AR = ar
AWK = awk
CFLAGS = -g -Wall -O2 -pedantic -std=c99 -D_XOPEN_SOURCE=600
CPPFLAGS = -std=c++11 -g -Wall -O3 -fopenmp
LDFLAGS =
LIBS =
OBJ = Haplotag.o ParsingBam.o Util.o HaplotagProcess.o PhasingProcess.o Phasing.o PhasingGraph.o ModCall.o ModCallParsingBam.o ModCallProcess.o main.o
PROGRAMS = longphase
all: subprojects
subprojects:
$(MAKE) -C ./jemalloc
$(MAKE) -C ./htslib
$(MAKE) $(PROGRAMS)
ALL_CPPFLAGS = -I. $(CPPFLAGS) -Ihtslib -Ijemalloc
ALL_LDFLAGS = $(LDFLAGS) -Lhtslib/htslib -Ljemalloc/lib
# Usually config.mk and config.h are generated by running configure
# or config.status, but if those aren't used create defaults here.
config.mk:
@sed -e '/^prefix/,/^LIBS/d;s/@Hsource@//;s/@Hinstall@/#/;s#@HTSDIR@#htslib#g;s/@HTSLIB_CPPFLAGS@/-I$$(HTSDIR)/g;s/@CURSES_LIB@/-lcurses/g' config.mk.in > $@
config.h:
echo '/* Basic config.h generated by Makefile */' > $@
echo '#define HAVE_CURSES' >> $@
echo '#define HAVE_CURSES_H' >> $@
include config.mk
JEMDIR = jemalloc
JEMLIB = $(JEMDIR)/lib/libjemalloc.a -ldl
$(PROGRAMS): $(OBJ)
$(CXX) $(ALL_CPPFLAGS) $(ALL_LDFLAGS) -o $@ $^ $(HTSLIB_LIB) $(JEMLIB)
%.o: %.cpp
$(CXX) $(ALL_CPPFLAGS) -o $@ -c $^
mostlyclean:
-rm -f *.o
clean: mostlyclean
-rm -f $(PROGRAMS)
distclean: clean
-rm -f config.cache config.h config.log config.mk config.status
-rm -f TAGS
-rm -rf autom4te.cache
clean-jemalloc:
$(MAKE) -C ./jemalloc clean
distclean-jemalloc:
$(MAKE) -C ./jemalloc distclean
relclean-jemalloc:
$(MAKE) -C ./jemalloc distclean
clean-all: clean clean-htslib clean-jemalloc
distclean-all: distclean distclean-htslib distclean-jemalloc
mostlyclean-all: mostlyclean mostlyclean-htslib
tags:
ctags -f TAGS *.[ch] misc/*.[ch]
force:
.PHONY: all subprojects
.PHONY: mostlyclean clean distclean
.PHONY: clean-jemalloc distclean-jemalloc relclean-jemalloc
.PHONY: clean-all distclean-all mostlyclean-all
.PHONY: tags force