-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
196 lines (161 loc) · 6.16 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
#---Begin configuration---#
#---Begin configuration---#
shufcmd := $(shell which shuf || which gshuf)
prefix?=/usr/local
piuser?=
#----End configuration----#
#----End configuration----#
SHELL := bash
# Binaries
PE_EXE=bin/parseval
CN_EXE=bin/canon-gff3
LP_EXE=bin/locuspocus
GV_EXE=bin/gaeval
XT_EXE=bin/xtractore
RP_EXE=bin/pmrna
TD_EXE=bin/tidygff3
UT_EXE=bin/unittests
INSTALL_BINS=$(PE_EXE) $(CN_EXE) $(LP_EXE) $(GV_EXE) $(XT_EXE) $(RP_EXE) $(TD_EXE)
BINS=$(INSTALL_BINS) $(UT_EXE)
#----- Source, header, and object files -----#
# AEGeAn core class and module files
AGN_SRCS=$(sort $(wildcard src/core/Agn*.c))
AGN_OBJS=$(patsubst src/core/%.c,obj/%.o,$(AGN_SRCS))
AGN_HDRS=$(patsubst src/core%.c,inc/core/%.h,$(AGN_SRCS))
# Compilation settings
CC=gcc
CFLAGS=-Wall -DAGN_DATA_PATH='"$(prefix)/share/aegean"' -Wno-unused-result
GTFLAGS=prefix=$(prefix)
ifeq ($(cairo),no)
CFLAGS += -DWITHOUT_CAIRO
GTFLAGS += cairo=no
CAIROFT=cairo=no
endif
ifneq ($(errorcheck),no)
CFLAGS += -Werror
endif
ifeq ($(optimize),yes)
CFLAGS += -O3
endif
ifneq ($(64bit),no)
ifeq ($(shell uname -m),x86_64)
CFLAGS += -m64
endif
GTFLAGS += 64bit=yes
endif
ifneq ($(debug),no)
CFLAGS += -g
endif
LDFLAGS+=-lgenometools -lm -ldl \
-L$(prefix)/lib \
-L/usr/local/lib
ifdef lib
LDFLAGS += -L$(lib)
endif
INCS=$(shell pkg-config --silence-errors --cflags-only-I cairo) \
-I inc/core \
-I /usr/local/include/genometools \
-I $(prefix)/include/genometools
ifeq ($(memcheck),yes)
MEMCHECK=valgrind --leak-check=full --show-reachable=yes --error-exitcode=1 \
--suppressions=data/misc/libpixman.supp \
--suppressions=data/misc/libpango.supp
MEMCHECKFT=memcheck
else
MEMCHECKFT=nomemcheck
endif
# Targets
all: $(BINS) libaegean.a
install: all LocusPocus
@ mkdir -p $(prefix)/bin/
@ mkdir -p $(prefix)/lib/
@ mkdir -p $(prefix)/include/aegean/
@ mkdir -p $(prefix)/share/aegean/
@ rm -f $(prefix)/include/aegean/*
cp $(INSTALL_BINS) $(prefix)/bin/.
cp libaegean.a $(prefix)/lib/.
cp inc/core/*.h $(prefix)/include/aegean/.
cp -r data/share/* $(prefix)/share/aegean/.
install-scripts:
@ mkdir -p $(prefix)/bin/
cp data/scripts/*.p? $(prefix)/bin/.
LocusPocus: LocusPocus/LocusPocus.egg-info
LocusPocus/LocusPocus.egg-info:
(cd LocusPocus; ./install.sh ${piuser}; cd ..;)
uninstall:
for exe in $(INSTALL_BINS); do rm -r $(prefix)/$$exe; done
rm -r $(prefix)/include/aegean/
rm -r $(prefix)/share/aegean/
rm $(prefix)/lib/libaegean.a
(cd LocusPocus; ./uninstall.sh ${piuser}; cd ..;)
clean:
rm -rf $(BINS) libaegean.a $(AGN_OBJS) inc/core/AgnVersion.h bin/*.dSYM
$(AGN_OBJS): obj/%.o : src/core/%.c inc/core/%.h inc/core/AgnVersion.h
@- mkdir -p obj
@ echo "[compile $*]"
@ $(CC) $(CPPFLAGS) $(CFLAGS) $(INCS) -c -o $@ $<
$(PE_EXE): src/ParsEval/parseval.c src/ParsEval/pe_options.c src/ParsEval/pe_utils.c src/ParsEval/pe_options.h src/ParsEval/pe_utils.h $(AGN_OBJS)
@ mkdir -p bin
@ echo "[compile ParsEval]"
@ $(CC) $(CPPFLAGS) $(CFLAGS) $(INCS) -I src/ParsEval -o $@ $(AGN_OBJS) src/ParsEval/parseval.c src/ParsEval/pe_options.c src/ParsEval/pe_utils.c $(LDFLAGS)
$(CN_EXE): src/canon-gff3.c $(AGN_OBJS)
@ mkdir -p bin
@ echo "[compile CanonGFF3]"
@ $(CC) $(CPPFLAGS) $(CFLAGS) $(INCS) -o $@ $(AGN_OBJS) src/canon-gff3.c $(LDFLAGS)
$(LP_EXE): src/locuspocus.c $(AGN_OBJS)
@ mkdir -p bin
@ echo "[compile LocusPocus]"
@ $(CC) $(CPPFLAGS) $(CFLAGS) $(INCS) -o $@ $(AGN_OBJS) src/locuspocus.c $(LDFLAGS)
$(GV_EXE): src/gaeval.c $(AGN_OBJS)
@ mkdir -p bin
@ echo "[compile GAEVAL]"
@ $(CC) $(CPPFLAGS) $(CFLAGS) $(INCS) -o $@ $(AGN_OBJS) src/gaeval.c $(LDFLAGS)
$(XT_EXE): src/xtractore.c $(AGN_OBJS)
@ mkdir -p bin
@ echo "[compile Xtractore]"
@ $(CC) $(CPPFLAGS) $(CFLAGS) $(INCS) -o $@ $(AGN_OBJS) src/xtractore.c $(LDFLAGS)
$(RP_EXE): src/pmrna.c $(AGN_OBJS)
@ mkdir -p bin
@ echo "[compile $@]"
@ $(CC) $(CPPFLAGS) $(CFLAGS) $(INCS) -o $@ $(AGN_OBJS) src/pmrna.c $(LDFLAGS)
$(TD_EXE): src/tidygff3.c $(AGN_OBJS)
@ mkdir -p bin
@ echo "[compile $@]"
@ $(CC) $(CPPFLAGS) $(CFLAGS) $(INCS) -o $@ $(AGN_OBJS) src/tidygff3.c $(LDFLAGS)
$(UT_EXE): test/unittests.c $(AGN_OBJS)
@ mkdir -p bin
@ echo "[compile unit tests]"
@ $(CC) $(CPPFLAGS) $(CFLAGS) $(INCS) -o $@ $(AGN_OBJS) test/unittests.c $(LDFLAGS)
libaegean.a: $(AGN_OBJS)
@ echo "[create libaegean]"
@ ar ru libaegean.a $(AGN_OBJS)
inc/core/AgnVersion.h:
@- echo "[print $@]"
@ data/scripts/version.py > $@
test: agn-test locuspocus-test
agn-test: all
@ $(MEMCHECK) bin/unittests
@ $(MEMCHECK) bin/locuspocus --outfile=/dev/null data/gff3/grape-refr.gff3 data/gff3/grape-pred.gff3
@ $(MEMCHECK) bin/locuspocus --outfile=/dev/null data/gff3/grape-refr.gff3 data/gff3/grape-pred.gff3
@ $(MEMCHECK) bin/locuspocus --outfile=/dev/null --skipends data/gff3/grape-refr.gff3 data/gff3/grape-pred.gff3
@ $(MEMCHECK) bin/locuspocus --outfile=/dev/null --skipends --verbose data/gff3/grape-refr.gff3 data/gff3/grape-pred.gff3
@ $(MEMCHECK) bin/locuspocus --outfile=/dev/null --skipends --verbose --namefmt=GrapeLocus%03lu data/gff3/grape-refr.gff3 data/gff3/grape-pred.gff3
@ $(MEMCHECK) bin/locuspocus --outfile=/dev/null --verbose data/gff3/dmel-pseudofeat-sort-test-in.gff3 2> >(grep -v 'not unique')
@ $(MEMCHECK) bin/tidygff3 < data/gff3/grape-refr.gff3 > /dev/null
@ echo AEGeAn Functional Tests
@ test/AT1G05320.sh $(MEMCHECKFT)
@ test/FBgn0035002.sh $(MEMCHECKFT)
@ test/iLocusParsing.sh $(MEMCHECKFT)
@ test/xtractore-ft.sh $(MEMCHECKFT)
@ test/canon-gff3-ft.sh $(MEMCHECKFT)
@ test/gaeval-ft.sh $(MEMCHECKFT)
@ test/AmelOGSvsNCBI.sh $(MEMCHECKFT) $(CAIROFT)
@ test/align-convert.sh
@ test/misc-ft.sh $(MEMCHECKFT)
locuspocus-test:
cd LocusPocus && pytest --cov=LocusPocus LocusPocus/*.py
ci-test:
@ set -e && for conf in $$(ls LocusPocus/genome_configs/*.yml | grep -v -e Mmus -e Btau -e Emex -e Drer -e Hsap | $(shufcmd) | head -n 1); do label=$$(basename $$conf .yml); echo $$label; fidibus --refr=$$label --workdir=scratch/testmore/ --relax download prep iloci breakdown stats; rm -r scratch/testmore/; done
style:
pycodestyle data/scripts/*.py
cd LocusPocus && pycodestyle LocusPocus/*.py scripts/*.py