3 # This script is used when compiling Classpath with gcj. The idea is
4 # to compile one package at a time, and only recompile packages when
7 # We build java->class by package so we need to know what .java files
8 # correspond to what package.
10 # We have a .stamp file for each package; this is the makefile target.
11 # We also have a .list file for each package, which lists all the
12 # input files in that package.
14 # gen-classlist.sh makes a list of all the .java files we are going to compile.
16 # This script generates Makefile.deps, which looks like this:
18 # java/awt/AWTUtilities.class: lists/java-awt.stamp
19 # lists/java-awt.list: /home/aph/gcc/gcc/libjava/classpath/gnu/java/awt/AWTUtilities.java
20 # java/awt/BitMaskExtent.class: lists/java-awt.stamp
21 # lists/java-awt.list: /home/aph/gcc/gcc/libjava/classpath/gnu/java/awt/BitMaskExtent.java
22 # java/awt/BitwiseXORComposite.class: lists/java-awt.stamp
23 # lists/java-awt.list: /home/aph/gcc/gcc/libjava/classpath/gnu/java/awt/BitwiseXORComposite.java
25 echo "Splitting for gcj"
26 rm -f Makefile.dtmp
> /dev
/null
2>&1
27 test -d lists || mkdir lists
28 # Much more efficient to do processing outside the loop...
29 # The first expression computes the .class file name.
30 # We only want the first three package components, and
31 # we want them separated by '-'; this is the remaining expressions.
32 sed -e 's, \(.*\)[.]java$, \1.java \1.class,' \
33 -e 's,^\([^/ ]*\)/\([^/ ]*\) ,\1-\2 ,' \
34 -e 's,^\([^/ ]*\)/\([^/ ]*\)/\([^/ ]*\) ,\1-\2-\3 ,' \
35 -e 's,^\([^/ ]*\)/\([^/ ]*\)/\([^/ ]*\)/[^ ]* ,\1-\2-\3 ,' \
37 while read pkg dir
file f2
; do
39 echo "$dir/$file" >> ${list}.list
.1
41 echo "$f2: ${list}.stamp" >> Makefile.dtmp
42 echo "${list}.list: $dir/$file" >> Makefile.dtmp
45 # Only update a .list file if it changed.
46 for file in lists
/*.list
.1; do
47 real
=`echo "$file" | sed -e 's/.1$//'`
48 if cmp -s $real $file; then
55 # If we were run we must update Makefile.deps.
56 mv Makefile.dtmp Makefile.deps