12 ifeq ($(ARCH), aarch64)
18 ifeq ($(ARCH), ppc64le)
31 SLIBJVMTI=libjvmti.so.$(VERSION).$(REVISION).$(AGE)
32 VLIBJVMTI=libjvmti.so.$(VERSION)
33 SLDFLAGS=-shared -Wl,-soname -Wl,$(VLIBJVMTI)
36 # The following works at least on fedora 23, you may need the next
37 # line for other distros.
38 ifneq (,$(wildcard /usr/sbin/update-java-alternatives))
39 JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | awk '{print $$3}')
41 ifneq (,$(wildcard /usr/sbin/alternatives))
42 JDIR=$(shell alternatives --display java | tail -1 | cut -d' ' -f 5 | sed 's%/jre/bin/java.%%g')
46 $(error Could not find alternatives command, you need to set JDIR= to point to the root of your Java directory)
48 ifeq (,$(wildcard $(JDIR)/include/jvmti.h))
49 $(error the openjdk development package appears to me missing, install and try again)
52 $(info Using Java from $(JDIR))
53 # -lrt required in 32-bit mode for clock_gettime()
55 INCDIR=-I $(JDIR)/include -I $(JDIR)/include/linux
59 SRCS=libjvmti.c jvmti_agent.c
62 OPT=-O2 -g -Werror -Wall
64 CFLAGS=$(INCDIR) $(OPT)
69 $(CC) $(CFLAGS) -c $*.c
71 $(CC) -fPIC -DPIC $(CFLAGS) -c $*.c -o $*.lo
73 $(OBJS) $(SOBJS): Makefile jvmti_agent.h ../util/jitdump.h
75 $(SLIBJVMTI): $(SOBJS)
76 $(CC) $(CFLAGS) $(SLDFLAGS) -o $@ $(SOBJS) $(LIBS)
77 $(LN) $@ libjvmti.$(SOLIBEXT)
80 $(RM) -f *.o *.so.* *.so *.lo
83 -mkdir -p $(DESTDIR)/lib
84 install -m 755 $(SLIBJVMTI) $(DESTDIR)/lib/
85 (cd $(DESTDIR)/lib; $(LN) $(SLIBJVMTI) $(VLIBJVMTI))
86 (cd $(DESTDIR)/lib; $(LN) $(SLIBJVMTI) libjvmti.$(SOLIBEXT))
89 .SUFFIXES: .c .S .o .lo