diff --git a/jode/javaDependencies.pl.in b/jode/javaDependencies.pl.in index b8dd616..64ddab7 100755 --- a/jode/javaDependencies.pl.in +++ b/jode/javaDependencies.pl.in @@ -27,12 +27,15 @@ # constant and thus doesn't include a reference to the class. # # Usage: -# javaDependencies.pl -classpath [-dependdir ] +# javaDependencies.pl -classpath [-dependdir [-subdir ]] +# # # cp: colon separated paths to the java files we should depend on. # depdir: if set, use this path as path to the java files when printing # dependencies, not the path where the java files were found. # useful, if you want to make use of VPATH settings in Makefile. +# subdir: if set, this is the path from depdir to the current directory. +# Use it to remove unneccessary ../../$subdir/ # class: The class file (not an inner class) for which the dependencies # should be generated. We will also look for inner and anon # classes. @@ -136,11 +139,28 @@ for $filename ($clazz, glob("$base\\\$*.class")) { next if defined $done{"$clzz"}; $done{$clzz} = 1; + my $p; for $p (split ':', $classpath) { if (-e "$p/$clzz.java") { - push @deplist, (defined $dependdir - ? "$dependdir/$clzz.java" - : "$p/$clzz.java"); + my $path="$p/"; + if (defined $dependdir) { + $path = "$dependdir/"; + if (defined $subdir) { + my $currsubdir = "$subdir/"; + while ($currsubdir =~ m<^([A-Za-z0-9]+)/+(.*)>) { + $currsubdir = $2; + my $firstcomp = $1; + if ($clzz =~ m<$firstcomp/(.*)>) { + my $remain = $1; + if ($path =~ m<^(|.*/)\.\./+$>) { + $path = $1; + $clzz = $remain; + } + } + } + } + } + push @deplist, "$path$clzz.java"; next clazz; } } diff --git a/jode/jode/Makefile.am b/jode/jode/Makefile.am index 9bb3e39..1da5dac 100644 --- a/jode/jode/Makefile.am +++ b/jode/jode/Makefile.am @@ -4,7 +4,7 @@ SUBDIRS = util bytecode type jvm expr flow decompiler obfuscator @SWINGUI@ JAR = @JAR@ JAVAC = @JAVAC@ -JAVADEP = $(top_builddir)/javaDependencies.pl \ +JAVADEP = $(top_builddir)/javaDependencies.pl -subdir=$(subdir)\ -dependdir=$(top_builddir) -classpath=$(top_builddir):$(top_srcdir) CLASSPATH = @CLASSPATH@ CLASSLIB = @CLASSLIB@ @@ -22,7 +22,7 @@ EXTRA_DIST = $(MY_JAVA_FILES) JARFILE = jode-@VERSION@.jar -data_DATA = $(JARFILE) +#data_DATA = $(JARFILE) @QUOTE@-include $(MY_JAVA_FILES:.java=.dep) diff --git a/jode/jode/bytecode/Makefile.am b/jode/jode/bytecode/Makefile.am index 626e680..432bdb9 100644 --- a/jode/jode/bytecode/Makefile.am +++ b/jode/jode/bytecode/Makefile.am @@ -2,7 +2,7 @@ JAR = @JAR@ JAVAC = @JAVAC@ -JAVADEP = $(top_builddir)/javaDependencies.pl\ +JAVADEP = $(top_builddir)/javaDependencies.pl -subdir=$(subdir)\ -dependdir=$(top_builddir) -classpath=$(top_builddir):$(top_srcdir) CLASSPATH = @CLASSPATH@ CLASSLIB = @CLASSLIB@ diff --git a/jode/jode/decompiler/Makefile.am b/jode/jode/decompiler/Makefile.am index 3a0365d..d9125ed 100644 --- a/jode/jode/decompiler/Makefile.am +++ b/jode/jode/decompiler/Makefile.am @@ -2,7 +2,7 @@ JAR = @JAR@ JAVAC = @JAVAC@ -JAVADEP = $(top_builddir)/javaDependencies.pl\ +JAVADEP = $(top_builddir)/javaDependencies.pl -subdir=$(subdir)\ -dependdir=$(top_builddir) -classpath=$(top_builddir):$(top_srcdir) CLASSPATH = @CLASSPATH@ CLASSLIB = @CLASSLIB@ diff --git a/jode/jode/expr/Makefile.am b/jode/jode/expr/Makefile.am index c879a29..858cd37 100644 --- a/jode/jode/expr/Makefile.am +++ b/jode/jode/expr/Makefile.am @@ -2,7 +2,7 @@ JAR = @JAR@ JAVAC = @JAVAC@ -JAVADEP = $(top_builddir)/javaDependencies.pl\ +JAVADEP = $(top_builddir)/javaDependencies.pl -subdir=$(subdir)\ -dependdir=$(top_builddir) -classpath=$(top_builddir):$(top_srcdir) CLASSPATH = @CLASSPATH@ CLASSLIB = @CLASSLIB@ diff --git a/jode/jode/flow/Makefile.am b/jode/jode/flow/Makefile.am index 9697f2e..477c736 100644 --- a/jode/jode/flow/Makefile.am +++ b/jode/jode/flow/Makefile.am @@ -2,7 +2,7 @@ JAR = @JAR@ JAVAC = @JAVAC@ -JAVADEP = $(top_builddir)/javaDependencies.pl\ +JAVADEP = $(top_builddir)/javaDependencies.pl -subdir=$(subdir)\ -dependdir=$(top_builddir) -classpath=$(top_builddir):$(top_srcdir) CLASSPATH = @CLASSPATH@ CLASSLIB = @CLASSLIB@ diff --git a/jode/jode/jvm/Makefile.am b/jode/jode/jvm/Makefile.am index a23808e..f9751f7 100644 --- a/jode/jode/jvm/Makefile.am +++ b/jode/jode/jvm/Makefile.am @@ -2,7 +2,7 @@ JAR = @JAR@ JAVAC = @JAVAC@ -JAVADEP = $(top_builddir)/javaDependencies.pl\ +JAVADEP = $(top_builddir)/javaDependencies.pl -subdir=$(subdir)\ -dependdir=$(top_builddir) -classpath=$(top_builddir):$(top_srcdir) CLASSPATH = @CLASSPATH@ CLASSLIB = @CLASSLIB@ diff --git a/jode/jode/obfuscator/Makefile.am b/jode/jode/obfuscator/Makefile.am index f8d28d1..e27634b 100644 --- a/jode/jode/obfuscator/Makefile.am +++ b/jode/jode/obfuscator/Makefile.am @@ -2,7 +2,7 @@ JAR = @JAR@ JAVAC = @JAVAC@ -JAVADEP = $(top_builddir)/javaDependencies.pl\ +JAVADEP = $(top_builddir)/javaDependencies.pl -subdir=$(subdir)\ -dependdir=$(top_builddir) -classpath=$(top_builddir):$(top_srcdir) CLASSPATH = @CLASSPATH@ CLASSLIB = @CLASSLIB@ @@ -24,9 +24,12 @@ MY_JAVA_FILES = \ MethodIdentifier.java \ ModifierMatcher.java \ NameSwapper.java \ + OptionHandler.java \ PackageIdentifier.java \ + ParseException.java \ RemovePopAnalyzer.java \ Renamer.java \ + ScriptParser.java \ SimpleAnalyzer.java \ StrongRenamer.java \ TranslationTable.java \ diff --git a/jode/jode/swingui/Makefile.am b/jode/jode/swingui/Makefile.am index 278482c..7295b82 100644 --- a/jode/jode/swingui/Makefile.am +++ b/jode/jode/swingui/Makefile.am @@ -2,7 +2,7 @@ JAR = @JAR@ JAVAC = @JAVAC@ -JAVADEP = $(top_builddir)/javaDependencies.pl\ +JAVADEP = $(top_builddir)/javaDependencies.pl -subdir=$(subdir)\ -dependdir=$(top_builddir) -classpath=$(top_builddir):$(top_srcdir) CLASSPATH = @CLASSPATH@ CLASSLIB = @CLASSLIB@ diff --git a/jode/jode/type/Makefile.am b/jode/jode/type/Makefile.am index 06b20e9..793fe6a 100644 --- a/jode/jode/type/Makefile.am +++ b/jode/jode/type/Makefile.am @@ -2,7 +2,7 @@ JAR = @JAR@ JAVAC = @JAVAC@ -JAVADEP = $(top_builddir)/javaDependencies.pl\ +JAVADEP = $(top_builddir)/javaDependencies.pl -subdir=$(subdir)\ -dependdir=$(top_builddir) -classpath=$(top_builddir):$(top_srcdir) CLASSPATH = @CLASSPATH@ CLASSLIB = @CLASSLIB@ diff --git a/jode/jode/util/Makefile.am b/jode/jode/util/Makefile.am index 9e7849f..b8f8d89 100644 --- a/jode/jode/util/Makefile.am +++ b/jode/jode/util/Makefile.am @@ -2,7 +2,7 @@ JAR = @JAR@ JAVAC = @JAVAC@ -JAVADEP = $(top_builddir)/javaDependencies.pl\ +JAVADEP = $(top_builddir)/javaDependencies.pl -subdir=$(subdir)\ -dependdir=$(top_builddir) -classpath=$(top_builddir):$(top_srcdir) CLASSPATH = @CLASSPATH@ CLASSLIB = @CLASSLIB@