mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-13 04:44:39 +00:00
Estimated hours taken: 13 Branches: main Implement some library predicates for Java using JNI. java/runtime/Native.java.in: A new class which uses JNI to provide any native functionality required by predicates of the standard library in Java. So far it only provides methods relating to timing. java/runtime/Native.c: Source code, written in C, which implements all the native methods of mercury.runtime.Native. Note that this implementation makes use of the existing C implementation of the equivalent functions. java/runtime/Mmakefile: Rules for compiling a shared object from Native.c. library/time.m: Implement the following predicates for Java using Native interface: time__c_clock/3 time__clocks_per_sec/1 time__times/7 library/benchmarking.m: Implement the following predicates for Java using Native interface: get_user_cpu_miliseconds/1 library/Mmakefile: Renamed to library/Mmakefile.in, so as to have access to FULLARCH constant. library/Mmakefile.in: Added rules for incorporating the Native shared object.
36 lines
882 B
Plaintext
36 lines
882 B
Plaintext
|
|
# Copyright (C) 2004 The University of Melbourne.
|
|
# This file may only be copied under the terms of the GNU Library General
|
|
# Public License - see the file COPYING.LIB in the Mercury distribution.
|
|
#
|
|
# This Makefile compiles the shared object for use with mercury.runtime.Native
|
|
#
|
|
|
|
MERCURY_DIR = ../..
|
|
RUNTIME_DIR = $(MERCURY_DIR)/runtime
|
|
|
|
include $(MERCURY_DIR)/Mmake.common
|
|
|
|
NATIVE_PIC = Native.$(EXT_FOR_PIC_OBJECTS)
|
|
NATIVE_SO = Native.$(EXT_FOR_SHARED_LIB)
|
|
|
|
MAIN_TARGET = $(NATIVE_SO)
|
|
|
|
PIC_OBJS = $(RUNTIME_DIR)/mercury_timing.$(EXT_FOR_PIC_OBJECTS) \
|
|
$(NATIVE_PIC)
|
|
|
|
CFLAGS = -I$(RUNTIME_DIR)
|
|
|
|
$(NATIVE_SO): $(PIC_OBJS)
|
|
$(LINK_SHARED_OBJ) -o $(NATIVE_SO) $(PIC_OBJS)
|
|
|
|
$(NATIVE_PIC): Native.c
|
|
$(MGNUC) $(ALL_GRADEFLAGS) $(ALL_MGNUCFLAGS) \
|
|
$(CFLAGS_FOR_PIC) -o $(NATIVE_PIC) -c Native.c
|
|
|
|
clean:
|
|
rm -f $(PIC_OBJS)
|
|
|
|
realclean:
|
|
rm -f $(PIC_OBJS) $(NATIVE_SO) *.class
|