-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
97 lines (74 loc) · 2.73 KB
/
Copy pathMakefile
File metadata and controls
97 lines (74 loc) · 2.73 KB
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
# libMACS3 — standalone MACS3-compatible peak caller
# Produces:
# lib/libmacs3.a — static library
# bin/macs3frag — standalone CLI
#
# htslib is referenced as a git submodule under third_party/htslib (pinned
# at tag 1.23). Set HTSLIB_DIR to point at an alternate build (e.g. an
# already-built copy in a sibling Chromap-suite checkout).
CXX ?= g++
AR ?= ar
# By default we link against system-installed htslib (libhts-dev provides
# kfunc.h and libhts.so). For a self-contained build, point HTSLIB_DIR at
# a built copy of third_party/htslib (or any other htslib install).
HTSLIB_DIR ?=
CXXFLAGS ?= -std=c++11 -Wall -Wextra -O3 -fopenmp -msse4.1
CPPFLAGS_LOCAL = -Iinclude
LDFLAGS_LOCAL = -lhts -lm -lz -lpthread -fopenmp
ifneq ($(strip $(HTSLIB_DIR)),)
CPPFLAGS_LOCAL += -I$(HTSLIB_DIR)
LDFLAGS_LOCAL := -L$(HTSLIB_DIR) $(LDFLAGS_LOCAL)
endif
OBJDIR = build
LIBDIR = lib
BINDIR = bin
LIB_SOURCES = \
src/bdgpeakcall.cc \
src/binned_signal.cc \
src/call_peaks.cc \
src/frag_compact_store.cc \
src/fragment_input.cc \
src/fragments.cc \
src/macs3_bed_callpeak.cc \
src/macs3_frag_peak_pipeline.cc \
src/macs3_frag_workspace.cc \
src/macs3_frag_sweep.cc \
src/macs3_pos_array.cc \
src/peak_io.cc \
src/signac_bed_projection.cc \
src/stage_profile.cc \
src/streaming.cc
LIB_OBJS = $(patsubst src/%.cc,$(OBJDIR)/%.o,$(LIB_SOURCES))
CLI_OBJ = $(OBJDIR)/cli_macs3frag.o
LIB = $(LIBDIR)/libmacs3.a
CLI = $(BINDIR)/macs3frag
.PHONY: all clean libmacs3 macs3frag test test-unit \
test-legacy-streaming-100k test-macs3-frag-100k
all: libmacs3 macs3frag
libmacs3: $(LIB)
macs3frag: $(CLI)
$(LIB): $(LIB_OBJS) | $(LIBDIR)
$(AR) rcs $@ $^
$(CLI): $(CLI_OBJ) $(LIB) | $(BINDIR)
$(CXX) $(CXXFLAGS) $(CLI_OBJ) $(LIB) -o $@ $(LDFLAGS_LOCAL)
$(CLI_OBJ): cli/macs3frag.cc | $(OBJDIR)
$(CXX) $(CXXFLAGS) $(CPPFLAGS_LOCAL) -c $< -o $@
$(OBJDIR)/%.o: src/%.cc | $(OBJDIR)
$(CXX) $(CXXFLAGS) $(CPPFLAGS_LOCAL) -c $< -o $@
$(OBJDIR) $(LIBDIR) $(BINDIR):
mkdir -p $@
# 100K parity smoke for the LEGACY custom caller path (--out-prefix). Exercises
# the streaming code path added in Phase B (uint16 bins, sliding-window lambda).
test-legacy-streaming-100k: $(CLI)
tests/run_100k_legacy_caller_smoke.sh
# 100K parity smoke for the MACS3 FRAG path (--macs3-frag-narrowpeak +
# --macs3-frag-summits) — the path libchromap calls in production. Currently
# still runs in-memory; streamingifying is the next Phase B target.
test-macs3-frag-100k: $(CLI)
tests/run_100k_macs3_frag_smoke.sh
# Unit tests (compiled binaries under build/tests/, run sequentially).
test-unit: $(LIB)
tests/run_unit_tests.sh
test: test-unit test-legacy-streaming-100k test-macs3-frag-100k
clean:
rm -rf $(OBJDIR) $(LIBDIR) $(BINDIR)