| 1 |
####### Makefile for "BioSig for C/C++" ##################### |
| 2 |
### |
| 3 |
### Copyright (C) 2018-2020 Alois Schloegl <[email protected]> |
| 4 |
### This file is part of the "BioSig for C/C++" repository |
| 5 |
### (biosig4c++) at http://biosig.sf.net/ |
| 6 |
### |
| 7 |
############################################################## |
| 8 |
|
| 9 |
### JNI ### |
| 10 |
# https://stackoverflow.com/questions/5963266/call-c-function-from-java |
| 11 |
|
| 12 |
JAVA_HOME ?= $(realpath $(dir $(realpath $(shell which @JAVAC@ )))/..) |
| 13 |
|
| 14 |
CLASS_PATH ?= $(JAVA_HOME)/bin |
| 15 |
|
| 16 |
libBiosig.so: Biosig.h Biosig.c |
| 17 |
$(CXX) -shared -fPIC \ |
| 18 |
-I.. \ |
| 19 |
-I$(JAVA_HOME)/include \ |
| 20 |
-I$(JAVA_HOME)/include/$(shell uname -s | tr '[:upper:]' '[:lower:]') \ |
| 21 |
Biosig.c -L.. -lbiosig -o libBiosig.so |
| 22 |
|
| 23 |
Biosig.h: Biosig.class |
| 24 |
@JAVAC@ -h . Biosig.java |
| 25 |
|
| 26 |
Biosig.class: Biosig.java |
| 27 |
@JAVAC@ Biosig.java |
| 28 |
|
| 29 |
test: libBiosig.so |
| 30 |
LD_LIBRARY_PATH=.. @JAVA@ -Djava.library.path=. Biosig "../data/Newtest17-256.bdf" |
| 31 |
|
| 32 |
clean: |
| 33 |
-rm *.h |
| 34 |
-rm *.o |
| 35 |
-rm *.cxx |
| 36 |
-rm *.so |
| 37 |
|