hotspot/src/share/tools/MakeDeps/FileList.java
author duke
Sat, 01 Dec 2007 00:00:00 +0000
changeset 1 489c9b5090e2
child 5547 f4b087cbb361
permissions -rw-r--r--
Initial load
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
489c9b5090e2 Initial load
duke
parents:
diff changeset
     2
 * Copyright 1999-2000 Sun Microsystems, Inc.  All Rights Reserved.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    19
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    20
 * CA 95054 USA or visit www.sun.com if you need additional information or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    21
 * have any questions.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
import java.io.*;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
import java.util.*;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
/** This class implements the java.util.List interface as well as
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
    providing functionality specific to keeping track of lists of
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
    files. See the documentation for the Database class to see how
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
    these are used. Each FileList must only contain other FileLists
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
    (although that is not currently enforced in the mutators). */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
public class FileList extends Vector {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
    private String name; // (also the file name)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
    private boolean beenHere;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
    private boolean mayBeCycle;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
    private boolean isCycle;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
    /** Put in list because a file can refuse to */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
    private boolean useGrandInclude;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
    private String platformDependentInclude;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
    private int count;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
    private Platform plat;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
    public FileList(String n, Platform plat) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
        super();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
        this.plat = plat;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
        beenHere = mayBeCycle = isCycle = false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
        platformDependentInclude = null;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
        name = n;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
        count = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
        useGrandInclude = plat.haveGrandInclude();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
    // Change definition of equality from AbstractList so remove() works properly
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
    public boolean equals(Object o) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
      return ((Object) this) == o;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
    // Necessary accessors
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
    public String getName() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
        return name;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
    public void setPlatformDependentInclude(String arg) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
        platformDependentInclude = arg;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
    public String getPlatformDependentInclude() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
        return platformDependentInclude;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
    public boolean getUseGrandInclude() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
        return useGrandInclude;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
    public void setUseGrandInclude(boolean arg) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
        useGrandInclude = arg;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
    public void incrementCount() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
        count++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
    public int getCount() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
        return count;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
    public FileList listForFile(String fileName) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
        for (Iterator iter = iterator(); iter.hasNext(); ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
            FileList fl = (FileList) iter.next();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
            if (plat.fileNameStringEquality(fl.name, fileName)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
                plat.fileNamePortabilityCheck(fl.name, fileName);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
                return fl;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
        plat.fileNamePortabilityCheck(fileName);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
        FileList newList = new FileList(fileName, plat);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
        add(newList);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
        return newList;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
    public boolean hasListForFile(String fileName) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
        for (Iterator iter = iterator(); iter.hasNext(); ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
            FileList fl = (FileList) iter.next();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
            if (plat.fileNameStringEquality(fl.name, fileName)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
                plat.fileNamePortabilityCheck(fl.name, fileName);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
                return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
        return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
    public boolean compareLists(FileList s) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
        Iterator myIter = iterator();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
        Iterator hisIter = s.iterator();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
        while (myIter.hasNext() &&
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
               hisIter.hasNext()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
            // crude: order dependent
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
            FileList myElement = (FileList) myIter.next();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
            FileList hisElement = (FileList) hisIter.next();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
            if (!plat.fileNameStringEquality(myElement.name,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
                                             hisElement.name)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
                return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
        if (myIter.hasNext() != hisIter.hasNext()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
            // One ended earlier
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
            return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
        return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
    public void addIfAbsent(FileList s) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
        for (Iterator iter = iterator(); iter.hasNext(); ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
            if (iter.next() == s) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
                return;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
        add(s);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
    public void sortByName() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
        Collections.sort(this, new Comparator() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
                public int compare(Object o1, Object o2) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
                    FileList fl1 = (FileList) o1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
                    FileList fl2 = (FileList) o2;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
                    return fl1.getName().compareTo(fl2.getName());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
                }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
            });
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
    public void setFirstFile(FileList s) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
      // Remove the file list if it's already here
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
      remove(s);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
      add(0, s);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
    public void setLastFile(FileList s) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
      // Remove the file list if it's already here
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
      remove(s);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
      add(s);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
    public boolean doFiles(FileList s) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
        boolean result = true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
        for (Iterator iter = iterator(); iter.hasNext(); ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
            FileList h = (FileList) iter.next();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
            if (h.platformDependentInclude != null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
                System.err.println("Error: the source for " +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
                                   h.platformDependentInclude +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
                                   " is " + h.name + ".");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
                System.err.println("\tIt shouldn't be included directly by " +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
                                   name + ".");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
                h.platformDependentInclude = null; // report once per file
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
                result = false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
            h.doHFile(s);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
        return result;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
    public void traceCycle(FileList s) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
        if (isCycle) // already traced
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
            return;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
        isCycle = true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
        System.err.println("\ttracing cycle for " + name);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
        // FIXME: must return status in caller routine
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
        // exitCode = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
        for (Iterator iter = iterator(); iter.hasNext(); ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
            FileList q = (FileList) iter.next();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
            if (q.mayBeCycle) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
                if (s == q) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
                    plat.fatalError("\tend of cycle for " + s.getName());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
                } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
                    q.traceCycle(s);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
                }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
    public void doHFile(FileList s) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
        if (beenHere) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
            if (mayBeCycle) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
                traceCycle(this);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
            return;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
        beenHere = true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
        mayBeCycle = true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
        doFiles(s);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
        mayBeCycle = false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
        s.add(this);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
    public FileList doCFile() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
        FileList s = new FileList(name, plat);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
        s.useGrandInclude = useGrandInclude; // propagate this
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
        doFiles(s);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
        for (Iterator iter = s.iterator(); iter.hasNext(); ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
            FileList l = (FileList) iter.next();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
            l.beenHere = false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
        return s;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
    /** if .h file is included thresh times, put it in the grand
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
        include file */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
    public void putInclFile(Database db)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
        throws IOException {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
        boolean needline = true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
        FileName inclName = plat.getInclFileTemplate().copyStem(name);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
        PrintWriter inclFile =
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
            new PrintWriter(new FileWriter(inclName.dirPreStemSuff()));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
        if (plat.haveGrandInclude() && plat.includeGIInEachIncl()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
            inclFile.println("# include \"" +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
                             plat.getGIFileTemplate().dirPreStemAltSuff() +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
                             "\"");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
            needline = false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
        for (Iterator iter = iterator(); iter.hasNext(); ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
            FileList hfile = (FileList) iter.next();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
            if (!db.hfileIsInGrandInclude(hfile, this)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
                inclFile.println("# include \"" +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
                                 plat.getInclFileTemplate().getInvDir() +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
                                 hfile.name +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
                                 "\"");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
                needline = false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
        // Solaris C++ in strict mode warns about empty files
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
        if(needline) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
            inclFile.println();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
        inclFile.close();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   263
}