-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (63 loc) · 3.92 KB
/
Copy pathMakefile
File metadata and controls
76 lines (63 loc) · 3.92 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
include Makefile.common
COMETSEARCH = CometSearch
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
override CXXFLAGS += -O3 -std=c++20 -fpermissive -Wall -Wextra -Wno-char-subscripts -Wno-unused-result -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D__LINUX__ -D_NOSQLITE -I$(MSTOOLKIT)/include -I$(MSTOOLKIT)/extern/expat-2.2.9/lib -I$(MSTOOLKIT)/extern/zlib-1.2.11 -I$(COMETSEARCH) -I$(ASCOREPRO)/include
else
override CXXFLAGS += -O3 -static -std=c++20 -fpermissive -Wall -Wextra -Wno-char-subscripts -Wno-unused-result -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D__LINUX__ -D_NOSQLITE -I$(MSTOOLKIT)/include -I$(MSTOOLKIT)/extern/expat-2.2.9/lib -I$(MSTOOLKIT)/extern/zlib-1.2.11 -I$(COMETSEARCH) -I$(ASCOREPRO)/include
endif
EXECNAME = comet.exe
OBJS = Comet.o
DEPS = CometSearch/CometData.h CometSearch/CometDataInternal.h CometSearch/CometPreprocess.h CometSearch/CometWriteSqt.h\
CometSearch/OSSpecificThreading.h CometSearch/CometMassSpecUtils.h CometSearch/CometSearch.h CometSearch/CometWritePepXML.h\
CometSearch/CometWriteMzIdentML.h CometSearch/CometWriteTxt.h CometSearch/Threading.h CometSearch/CometPostAnalysis.h\
CometSearch/CometSearchManager.h CometSearch/CometWritePercolator.h CometSearch/Common.h CometSearch/ThreadPool.h\
CometSearch/CombinatoricsUtils.h CometSearch/CometModificationsPermuter.h CometSearch/CometMassSpecUtils.cpp\
CometSearch/CometSearch.cpp CometSearch/CometWritePepXML.cpp CometSearch/CometWriteMzIdentML.cpp CometSearch/CometWriteTxt.cpp\
CometSearch/CometPostAnalysis.cpp CometSearch/CometSearchManager.cpp CometSearch/CometWritePercolator.cpp CometSearch/Threading.cpp\
CometSearch/CometPreprocess.cpp CometSearch/CometWriteSqt.cpp CometSearch/CombinatoricsUtils.cpp\
CometSearch/CometModificationsPermuter.cpp CometSearch/CometInterfaces.h CometSearch/CometInterfaces.cpp\
CometSearch/CometFragmentIndex.cpp CometSearch/CometFragmentIndex.h\
CometSearch/CometPeptideIndex.cpp CometSearch/CometPeptideIndex.h\
CometSearch/CometSpecLib.cpp CometSearch/CometSpecLib.h\
CometSearch/CometAlignment.cpp CometSearch/CometAlignment.h\
CometSearch/BS_thread_pool.hpp CometSearch/githubsha.h
LIBPATHS = -L$(MSTOOLKIT) -L$(COMETSEARCH) -L$(ASCOREPRO)
LIBS = -lcometsearch -lmstoolkit -lmstoolkitextern -lascorepro -lm -lpthread
ifdef MSYSTEM
LIBS += -lws2_32 -lpsapi
endif
LIBCOMETSEARCH = $(COMETSEARCH)/libcometsearch.a
UNITTEST_BIN = tests/unit/test_comet_internal
UNITTEST_SRC = tests/unit/TestCometSearchAndPreprocess.cpp
comet.exe: $(OBJS) $(LIBCOMETSEARCH)
cd $(ASCOREPRO) && $(MAKE) all
ifeq ($(UNAME_S),Darwin)
${CXX} $(OBJS) -headerpad_max_install_names -o ${EXECNAME} $(CXXFLAGS) $(LIBPATHS) $(LIBS)
else
${CXX} $(OBJS) -o ${EXECNAME} $(CXXFLAGS) $(LIBPATHS) $(LIBS)
endif
# MSToolkit's build extracts/builds expat and zlib under MSToolkit/extern/,
# whose generated headers Comet.cpp and CometSearch both #include (via
# MSReader.h/mzParser.h) -- it must run before either compiles, not just
# before the final comet.exe link, or a from-scratch checkout fails with
# "expat.h: No such file or directory".
$(LIBCOMETSEARCH): $(wildcard $(COMETSEARCH)/*.cpp $(COMETSEARCH)/*.h $(COMETSEARCH)/*.hpp)
cd $(MSTOOLKIT) && $(MAKE) all
cd $(COMETSEARCH) && $(MAKE)
Comet.o: Comet.cpp $(DEPS)
cd $(MSTOOLKIT) && $(MAKE) all
${CXX} ${CXXFLAGS} Comet.cpp -c
# Dependency-free unit tests (tests/unit/MiniTest.h -- no gtest, no CMake).
# Builds a standalone binary linked directly against libcometsearch and
# its dependencies, then runs it.
unittest: $(LIBCOMETSEARCH)
cd $(ASCOREPRO) && $(MAKE) all
${CXX} ${CXXFLAGS} $(UNITTEST_SRC) -o $(UNITTEST_BIN) $(LIBPATHS) $(LIBS)
$(UNITTEST_BIN)
clean:
rm -f *.o ${EXECNAME} $(UNITTEST_BIN)
cd $(MSTOOLKIT) ; make realclean ; cd ../CometSearch ; make clean ; cd ../$(ASCOREPRO) ; make clean
cclean:
rm -f *.o ${EXECNAME} $(UNITTEST_BIN)
cd CometSearch ; make clean