From 8c1fc428676fffc032d31bee0a5390ae8e9657ba Mon Sep 17 00:00:00 2001 From: nicejs-is-cool Date: Tue, 2 Jun 2026 09:21:51 -0300 Subject: [PATCH] get it to BUILD and RUN --- Makefile | 6 +++--- README.md | 2 +- src/main/org/neoflock/NeoNucleus/nn_Computer.java | 2 +- src/native/main.cpp | 5 ++--- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 72d9f3a..c82783f 100644 --- a/Makefile +++ b/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 \ No newline at end of file diff --git a/README.md b/README.md index bbca66d..db7f5f8 100644 --- a/README.md +++ b/README.md @@ -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. \ No newline at end of file +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`. \ No newline at end of file diff --git a/src/main/org/neoflock/NeoNucleus/nn_Computer.java b/src/main/org/neoflock/NeoNucleus/nn_Computer.java index 1707375..464b538 100644 --- a/src/main/org/neoflock/NeoNucleus/nn_Computer.java +++ b/src/main/org/neoflock/NeoNucleus/nn_Computer.java @@ -1,5 +1,5 @@ package org.neoflock.NeoNucleus; -public class nn_Computer { +public class nn_Computer extends PointerBackedClass { // TODO } diff --git a/src/native/main.cpp b/src/native/main.cpp index a69b939..8a50141 100644 --- a/src/native/main.cpp +++ b/src/native/main.cpp @@ -1,7 +1,9 @@ #include "org_neoflock_NeoNucleus_NativeBindings.h" #include #include "neonucleus.h" +extern "C" { #include "ncomplib.h" +} #include #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; }