OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [java/] [jcf-depend.c] - Blame information for rev 861

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 287 jeremybenn
/* Functions for handling dependency tracking when reading .class files.
2
 
3
   Copyright (C) 1998, 1999, 2000, 2001, 2003, 2006, 2007
4
   Free Software Foundation, Inc.
5
 
6
This file is part of GCC.
7
 
8
GCC is free software; you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation; either version 3, or (at your option)
11
any later version.
12
 
13
GCC is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
GNU General Public License for more details.
17
 
18
You should have received a copy of the GNU General Public License
19
along with GCC; see the file COPYING3.  If not see
20
<http://www.gnu.org/licenses/>.
21
 
22
Java and all Java-based marks are trademarks or registered trademarks
23
of Sun Microsystems, Inc. in the United States and other countries.
24
The Free Software Foundation is independent of Sun Microsystems, Inc.  */
25
 
26
/* Written by Tom Tromey <tromey@cygnus.com>, October 1998.  */
27
 
28
#include "config.h"
29
#include "system.h"
30
#include "coretypes.h"
31
#include "tm.h"
32
#include "mkdeps.h"
33
 
34
#include <assert.h>
35
 
36
#include "jcf.h"
37
 
38
 
39
 
40
/* The dependency structure used for this invocation.  */
41
struct deps *dependencies;
42
 
43
/* The output file, or NULL if we aren't doing dependency tracking.  */
44
static FILE *dep_out = NULL;
45
 
46
/* Nonzero if system files should be added.  */
47
static int system_files;
48
 
49
/* Nonzero if we are dumping out dummy dependencies.  */
50
static int print_dummies;
51
 
52
 
53
 
54
/* Call this to reset the dependency module.  This is required if
55
   multiple dependency files are being generated from a single tool
56
   invocation.  FIXME: we should change our API or just completely use
57
   the one in mkdeps.h.  */
58
void
59
jcf_dependency_reset (void)
60
{
61
  if (dep_out != NULL)
62
    {
63
      if (dep_out != stdout)
64
        fclose (dep_out);
65
      dep_out = NULL;
66
    }
67
 
68
  if (dependencies != NULL)
69
    {
70
      deps_free (dependencies);
71
      dependencies = NULL;
72
    }
73
}
74
 
75
void
76
jcf_dependency_set_target (const char *name)
77
{
78
  /* We just handle this the same as an `add_target'.  */
79
  if (dependencies != NULL && name != NULL)
80
    deps_add_target (dependencies, name, 1);
81
}
82
 
83
void
84
jcf_dependency_add_target (const char *name)
85
{
86
  if (dependencies != NULL)
87
    deps_add_target (dependencies, name, 1);
88
}
89
 
90
void
91
jcf_dependency_set_dep_file (const char *name)
92
{
93
  assert (dep_out != stdout);
94
  if (dep_out)
95
    fclose (dep_out);
96
  if (! strcmp (name, "-"))
97
    dep_out = stdout;
98
  else
99
    dep_out = fopen (name, "w");
100
}
101
 
102
void
103
jcf_dependency_add_file (const char *filename ATTRIBUTE_UNUSED, int system_p)
104
{
105
  if (! dependencies)
106
    return;
107
 
108
  /* Just omit system files.  */
109
  if (system_p && ! system_files)
110
    return;
111
 
112
 
113
  /* FIXME: Don't emit any dependencies.  In many cases we'll just see
114
     temporary files emitted by ecj... */
115
  /* deps_add_dep (dependencies, filename); */
116
}
117
 
118
void
119
jcf_dependency_init (int system_p)
120
{
121
  assert (! dependencies);
122
  system_files = system_p;
123
  dependencies = deps_init ();
124
}
125
 
126
void
127
jcf_dependency_print_dummies (void)
128
{
129
  print_dummies = 1;
130
}
131
 
132
void
133
jcf_dependency_write (void)
134
{
135
  if (! dep_out)
136
    return;
137
 
138
  assert (dependencies);
139
 
140
  deps_write (dependencies, dep_out, 72);
141
  if (print_dummies)
142
    deps_phony_targets (dependencies, dep_out);
143
  fflush (dep_out);
144
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.