get it to BUILD and RUN
This commit is contained in:
6
Makefile
6
Makefile
@@ -1,7 +1,7 @@
|
||||
CC=gcc
|
||||
CXX=g++
|
||||
CFLAGS=-Wall -Wextra -fno-sanitize=address
|
||||
LD_FLAGS=-fno-sanitize=address
|
||||
CFLAGS=-Wall -Wextra
|
||||
LD_FLAGS=
|
||||
TARGET=libcarbon.so
|
||||
|
||||
BASE_PATH=./src/main/org/neoflock/NeoNucleus
|
||||
@@ -32,6 +32,6 @@ run: all
|
||||
|
||||
clean:
|
||||
rm ${JAVA_CLASSES}
|
||||
rm $(OBJS) $(TARGET)
|
||||
rm $(OBJS) $(BASE_NPATH)/$(TARGET)
|
||||
|
||||
.PHONY: all clean
|
||||
@@ -1,4 +1,4 @@
|
||||
# Carbon Hydrogen
|
||||
NeoNucleus JNI bindings.
|
||||
### Dev Setup Notes
|
||||
Java expects libcarbon.so on the src/native directory. This is the default unless you're not using the Makefile. Make *sure* to build NeoNucleus with `make lib MODE=release`, and place the libneonucleus.a on src/native.
|
||||
Java expects libcarbon.so on the src/native directory. This is the default unless you're not using the Makefile. Make *sure* to build NeoNucleus with `make lib MODE=release`, and place the libneonucleus.a on src/native. The same applies for TLA (testLuaArch), which must be built with `make MODE=release`.
|
||||
@@ -1,5 +1,5 @@
|
||||
package org.neoflock.NeoNucleus;
|
||||
|
||||
public class nn_Computer {
|
||||
public class nn_Computer extends PointerBackedClass {
|
||||
// TODO
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#include "org_neoflock_NeoNucleus_NativeBindings.h"
|
||||
#include <iostream>
|
||||
#include "neonucleus.h"
|
||||
extern "C" {
|
||||
#include "ncomplib.h"
|
||||
}
|
||||
#include <jni.h>
|
||||
#include "luaarch.h"
|
||||
|
||||
@@ -41,12 +43,9 @@
|
||||
|
||||
JNIEXPORT jobject JNICALL Java_org_neoflock_NeoNucleus_NativeBindings_nn_1initContext
|
||||
(JNIEnv * env, jclass) {
|
||||
//jclass clazz = env->FindClass("org/neoflock/NeoNucleus/nn_Context");
|
||||
//jmethodID creator = env->GetStaticMethodID(clazz, "createFromPointer", "(J)Lorg/neoflock/NeoNucleus/Context;");
|
||||
jobject obj = Carbon::InstantiateOpaqueClass(env, "org/neoflock/NeoNucleus/nn_Context");
|
||||
nn_Context * ctx = (nn_Context*)malloc(sizeof(nn_Context));
|
||||
nn_initContext(ctx);
|
||||
//jobject result = env->CallStaticObjectMethod(clazz, creator, (jlong) ctx);
|
||||
Carbon::PointerBacked::SetPointer(env, obj, ctx);
|
||||
return obj;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user