From: Michael Zucchi Date: Sat, 19 Oct 2019 03:59:31 +0000 (+1030) Subject: Added auto variable for nativez-gen .def files. X-Git-Url: https://code.zedzone.au/cvs?a=commitdiff_plain;h=a9a3810b52f8013c345e1b762e1822c459e5f64e;p=jjmpeg Added auto variable for nativez-gen .def files. --- 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: diff --git a/src/notzed.jjmpeg/jni/jni.make b/src/notzed.jjmpeg/jni/jni.make index ef0fc36..2f0d697 100644 --- a/src/notzed.jjmpeg/jni/jni.make +++ b/src/notzed.jjmpeg/jni/jni.make @@ -58,10 +58,4 @@ jjmpeg_DEFS = \ jj-avstream.def \ jj-avutil.def -jjmpeg_makedep=$(notzed.jjmpeg_objdir)/$(1).o: $(notzed.jjmpeg_jnidir)/$(1).h - -$(foreach def,$(jjmpeg_DEFS),$(eval $(call jjmpeg_makedep,$(def:.def=)))) - -$(notzed.jjmpeg_jnidir)/%.h: src/notzed.jjmpeg/jni/%.def - @install -d $(@D) - $(NATIVEZ_HOME)/bin/nativez-gen -J -b "$(FFMPEG_HOME)/include" $< > $@ || ( rm $@ ; exit 1) +jjmpeg_DEFSFLAGS=-b "$(FFMPEG_HOME)/include"