1 # -*- Mode: makefile; -*- #
3 # This file is part of MKUltra - Gene's ultimate make include files.
5 # Copyright © 2016-2017 Gene Hightower <gene@digilicious.com>
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, version 3.
11 # This program is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. See the file LICENSE. If not, see
18 # <http://www.gnu.org/licenses/>.
34 pkg_config_lib := /usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib64/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
38 CFLAGS += -fPIC -pthread
39 CXXFLAGS += -fPIC -pthread
41 LDFLAGS += -Wl,-rpath=.
42 LDLIBS += -lpthread -lrt
46 define possibly_set_java_home
47 ifneq (,$(wildcard $(1)))
52 possible_java_locations := \
53 /usr/lib/jvm/default-java \
54 /usr/lib/jvm/java-1.8.0-openjdk \
55 /usr/lib/jvm/java-8-openjdk-amd64
57 $(foreach x,$(possible_java_locations),$(eval $(call possibly_set_java_home,$(x))))
60 JAVA_HOME ?= /usr/lib/jvm/java-1.8.0-openjdk
61 jvmdir = $(JAVA_HOME)/jre/lib/amd64/server
63 CPPFLAGS += -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
64 LDFLAGS += -L$(jvmdir) -Wl,-rpath,$(jvmdir)
65 LDLIBS += -dynamic -ljvm