-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
102 lines (81 loc) · 2.73 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
# optional dependencies
USE_DSRPDB= yes
USE_MMTF= yes
USE_OPENBABEL= yes
# general options
USE_EXCEPTIONS= no # exceptions aren't really functional as of yet, and aren't currently needed because all errors are fatal
BROWSER_SUBDIR= qt5-QtWebEngine-browser
SRCS_CPP= main.cpp obj.cpp molecule.cpp molecule-xyz.cpp molecule-pdb.cpp util.cpp process.cpp common.cpp Vec3-ext.cpp tm.cpp temp-file.cpp web-io.cpp \
js-binding.cpp js-support.cpp image.cpp \
op-rmsd.cpp molecule-qhull.cpp periodic-table-data.cpp binary.cpp structure-db.cpp float-array.cpp \
linear-algebra.cpp neural-network.cpp
HEADERS= common.h xerror.h obj.h molecule.h js-binding.h util.h process.h Vec3.h Mat3.h Vec3-ext.h tm.h temp-file.h web-io.h op-rmsd.h periodic-table-data.h \
structure-db.h stl-ext.h js-support.h mytypes.h
APP= chemwiz
APPS= $(APP) $(BROWSER_SUBDIR)/browser
CXX?= c++
CFLAGS= -O3 -Wall -Wconditional-uninitialized $(shell pkg-config --static --cflags mujs) -DPROGRAM_NAME=\"ChemWiz\"
CFLAGS+= -Icontrib/date/include/date
CFLAGS+= -I/usr/local/include/minidnn
CFLAGS+= -I/usr/local/include/eigen3/
CXXFLAGS= $(CFLAGS) -std=c++17
DEP_FILES= $(SRCS_CPP:%.cpp=%.d)
DEP_FILES_MASK= *.d
# for MuJS
LDFLAGS+= $(shell pkg-config --static --libs-only-L mujs gl glfw3)
LDLIBS= $(shell pkg-config --static --libs-only-l mujs gl glfw3)
ifeq ($(USE_DSRPDB), yes)
SRCS_CPP+= molecule-dsrpdb.cpp
CXXFLAGS+= -DUSE_DSRPDB
LDFLAGS+= -ldsrpdb
endif
ifeq ($(USE_MMTF), yes)
SRCS_CPP+= molecule-mmtf.cpp
CXXFLAGS+= -DUSE_MMTF
endif
ifeq ($(USE_OPENBABEL), yes)
SRCS_CPP+= molecule-ob.cpp
CXXFLAGS+= -DUSE_OPENBABEL $(shell pkg-config --cflags openbabel-3)
LDFLAGS+= $(shell pkg-config --libs openbabel-3)
endif
ifeq ($(USE_EXCEPTIONS), yes)
CXXFLAGS+= -DUSE_EXCEPTIONS
endif
# for libqhull (from the qhull package)
LDFLAGS+= -lqhull_r
# for boost compressor/recompressor
LDFLAGS+= -lboost_iostreams -lz
# for OpenSSL used to access https URLs
LDFLAGS+= -lssl -lcrypto -pthread
# for threads
LDFLAGS+= -pthread
# for OpenBLAS that is needed for the rmsd library
LDFLAGS+= -lopenblas
LDFLAGS+= -Wl,-rpath=/usr/local/lib/gcc9 /usr/local/lib/gcc9/libgcc_s.so # FreeBSD-specific
OBJS:= $(SRCS_CPP:.cpp=.o) $(SRCS_C:.c=.o)
.PHONY: all clean clean-deps
#
# build rules
#
all: $(APPS)
$(APP): $(OBJS)
$(CXX) -o $(APP) $(OBJS) $(LDFLAGS) $(LDLIBS)
$(BROWSER_SUBDIR)/browser: $(BROWSER_SUBDIR)/browser.pro $(BROWSER_SUBDIR)/main.cpp
cd $(BROWSER_SUBDIR) && CXX=$(CXX) qmake && $(MAKE)
#
# auto-dependencies
#
%.d: %.cpp
@echo "scanning dependencies for $<"
@$(CXX) -M $< $(CXXFLAGS) > $@
%.o: %.cpp %.d
#
# other targets
#
test:
./$(APP) qa/run-all-tests.js
clean:
rm -f $(OBJS) $(BROWSER_SUBDIR)/main.o $(APPS) $(DEP_FILES_MASK)
clean-deps:
rm -f $(DEP_FILES)
-include $(DEP_FILES)