install include files
[MKUltra.git] / defs.Linux
blob0e61373d5334b5d32bcae1dfb8d409adad74748b
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/>.
20 a_ext := a
21 a_sfx := .$(a_ext)
22 a_pfx := lib
24 so_ext := so
25 so_sfx := .$(so_ext)
26 so_pfx := lib
28 o_ext := o
29 o_sfx := .$(o_ext)
31 exe_ext :=
32 exe_sfx :=
34 pkg_config_lib := /usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib64/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
36 boost_mt :=
38 CFLAGS += -fPIC -pthread
39 CXXFLAGS += -fPIC -pthread
41 LDFLAGS += -Wl,-rpath=.
42 LDLIBS += -lpthread -lrt
44 ifneq (,$(JAVA))
46 define possibly_set_java_home
47 ifneq (,$(wildcard $(1)))
48 JAVA_HOME ?= $(1)
49 endif
50 endef
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))))
59 # Fall back location
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
66 endif