-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
56 lines (50 loc) · 2.37 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
#*************************************************************************
#
# This file is part of the software to infer antigenic trees.
# Copyright (C) 2012 Lars Steinbrueck
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#**************************************************************************
# directories
SRC = src
JAR = jar
BIN = bin
ifdef CONDA_PREFIX
USR := ${CONDA_PREFIX}
else
USR := /usr
endif
# compilers
JAVAC = $(USR)/bin/javac
JAVAH = $(USR)/bin/javah
CC = $(USR)/bin/gcc
LFLAGS = -lc -lgfortran -shared
# change the following row to match your system configuration (include directories where 'jni.h' and 'jni_md.h' are located)
ifdef CONDA_PREFIX
LIB_LFLAGS = -I ${CONDA_PREFIX}/lib/jvm/include/linux -I ${CONDA_PREFIX}/lib/jvm/include/
else
JAVA_HOME := $(shell java -XshowSettings:properties -version 2>&1 | grep -Po '(?<=java.home = )(.*)')
LIB_LFLAGS = -I $(JAVA_HOME)/include/ -I $(JAVA_HOME)/include/linux/
endif
# create bin dir & compile java
$(BIN)/libbvlslib.so: $(SRC)/phyloDriver.java $(SRC)/bvls.c $(SRC)/bvls.f90 $(SRC)/fitchAlgoObj.java $(SRC)/HIMat.java $(SRC)/NNLSsolver.java $(SRC)/node.java $(SRC)/phyloDriver.java $(SRC)/Sankoff.java $(SRC)/treeObj.java
@ mkdir -p $(BIN)
$(JAVAC) -cp $(SRC)/:$(JAR)/Jama.jar -d $(BIN) $(SRC)/phyloDriver.java
#$(JAVAH) -bootclasspath $(BIN) -d $(BIN) -jni NNLSsolver
$(JAVAC) -h $(BIN) -cp $(BIN):$(JAR)/Jama.jar $(SRC)/NNLSsolver.java -d $(BIN)
$(CC) -c -g -o $(BIN)/bvls.o $(SRC)/bvls.f90 -fPIC
$(CC) -o $(BIN)/libbvlslib.so -Wl,-soname,$(BIN)/libbvlslib.so $(LIB_LFLAGS) $(SRC)/bvls.c $(BIN)/bvls.o $(LFLAGS) -fPIC
$(BIN)/AntigenicTreeTools.jar: $(BIN)/phyloDriver.class
jar vcfe $(BIN)/AntigenicTreeTools.jar phyloDriver $(BIN)/phyloDriver.class $(BIN)/*.class $(BIN)/*.o $(BIN)/*.so jar/Jama.jar