From 414dfe5db7f2668489825cb5e7c792debbc6ae76 Mon Sep 17 00:00:00 2001 From: Michael Zucchi Date: Sat, 19 Oct 2019 14:32:55 +1030 Subject: [PATCH] Update java.make. Rename config.make to config.make.in so edits are not tracked. Fixed REAMDE for changed file locations. --- .gitignore | 1 + README | 15 +++++++++------ config.make => config.make.in | 2 -- java.make | 14 +++++++++++++- 4 files changed, 23 insertions(+), 9 deletions(-) rename config.make => config.make.in (90%) diff --git a/.gitignore b/.gitignore index 470b0ea..0ff731a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ /bin/ /build/ /dist/ +config.make diff --git a/README b/README index e361372..da90562 100644 --- a/README +++ b/README @@ -20,23 +20,26 @@ This module must be compiled under a GNU/Linux system. Cross compilation is possible to windows-amd64 by installing gcc-mingw-w64-x86-64. +First copy config.make.in to config.make and edit as necessary. + $ make $ make TARGET=linux-amd64 $ make TARGET=windows-amd64 The target-specific jmodule: -`bin/notzed.nativez//notzed.nativez.jmod' +`bin//jmods/notzed.nativez.jmod' Other files of import which can be used for an IDE, dependent project compilation, or non-modular use: -`bin/notzed.nativez/notzed.nativez.jar' - portable modular jar -`bin/notzed.nativez//include' - header files -`bin/notzed.nativez//include' - header files -`bin/notzed.nativez//lib/libnativez.so' - linux shared library +`bin//lib/notzed.nativez.jar' - portable modular jar +`bin//include' - header files +`bin//lib/libnativez.so' - linux shared library +`bin//bin/nativez.dll' - microsoft windows dynamic link library +`bin//bin/nativez-gen' - table generator + `bin/modules/notzed.nativez/' - compiled class files -`bin/notzed.nativez//bin/nativez-gen' - table generator Usage ----- diff --git a/config.make b/config.make.in similarity index 90% rename from config.make rename to config.make.in index f82e020..2986b96 100644 --- a/config.make +++ b/config.make.in @@ -2,8 +2,6 @@ TARGET ?= linux-amd64 JAVA_HOME ?= /usr/local/jdk-11.0.2 -JAVAFX_HOME ?= /usr/local/javafx-sdk-11.0.2 -FFMPEG_HOME ?= /opt/ffmpeg/4.0 JAVAC ?= javac JAR ?= jar diff --git a/java.make b/java.make index 657910d..8896ca1 100644 --- a/java.make +++ b/java.make @@ -103,6 +103,9 @@ # _DEPENDENCIES A list of other objects on which this library depends before linking. +# _DEFS A list of .def files for nativez-gen. +# _DEFSFLAGS Flags for nativez-gen invocation. + # .c files have dependencies automatically generated # Targets @@ -305,6 +308,7 @@ $($(1)_objdir)/%.o: src/$(1)/jni/%.c bin/status/$(1).classes $($(1)_incdir)/%.h: src/$(1)/jni/%.h install -DC $$< $$@ +# auto-dependencies for c files $($(1)_objdir)/%.d: src/$(1)/jni/%.c bin/status/$(1).classes @install -d $$(@D) @rm -f $$@ @@ -312,6 +316,11 @@ $($(1)_objdir)/%.d: src/$(1)/jni/%.c bin/status/$(1).classes $($(TARGET)_CPPFLAGS) $($(2)_CPPFLAGS) $$< -o $$@.d 2>/dev/null @sed 's,\($$*\.o\) *:,\1 $$@ : ,g' $$@.d > $$@ ; rm $$@.d +# .def files for nativez mapping +$($(1)_jnidir)/%.h: src/$(1)/jni/%.def + @install -d $$(@D) + $(NATIVEZ_HOME)/bin/nativez-gen -J $($(2)_DEFSFLAGS) $$< > $$@ || ( rm $$@ ; exit 1) + bin jni $(1) $(java_jmoddir)/$(1).jmod: \ $($(1)_libdir)/$(LIB)$(2)$(SO) \ $(java_libdir)/$(LIB)$(2)$(SO) \ @@ -319,7 +328,7 @@ bin jni $(1) $(java_jmoddir)/$(1).jmod: \ $(addprefix $(java_incdir)/,$($(2)_HEADERS)) \ $(addprefix $($(1)_bindir)/,$($(2)_COMMANDS)) \ $(addprefix $(java_bindir)/,$($(2)_COMMANDS)) \ - $$(addprefix $($(1)_libdir)/,$$($(2)_LIBRARIES)) + $(addprefix $($(1)_libdir)/,$($(2)_LIBRARIES)) $(if $(filter clean dist gen,$(MAKECMDGOALS)),,-include $$($(2)_OBJS:.o=.d)) endef @@ -327,6 +336,9 @@ endef #$(foreach module,$(java_JMODS),$(foreach library,$($(module)_JNI_LIBRARIES),$(info $(call jni_library,$(module),$(library))))) $(foreach module,$(java_JMODS),$(foreach library,$($(module)_JNI_LIBRARIES),$(eval $(call jni_library,$(module),$(library))))) +#$(foreach module,$(java_JMODS),$(foreach library,$($(module)_JNI_LIBRARIES),$(foreach def,$($(library)_DEFS),$(info $($(module)_objdir)/$(def:.def=.o): $($(module)_jnidir)/$(def:.def=.h))))) +$(foreach module,$(java_JMODS),$(foreach library,$($(module)_JNI_LIBRARIES),$(foreach def,$($(library)_DEFS),$(eval $($(module)_objdir)/$(def:.def=.o): $($(module)_jnidir)/$(def:.def=.h))))) + # ###################################################################### dist: -- 2.39.5