Mercurial > hg > CbC > CbC_gcc
annotate gcc/genmddeps.c @ 108:7ad14f446135
add CbC-example/rectypeTest/
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 14 Jun 2012 20:30:24 +0900 |
parents | f6334be47118 |
children | 04ced10e8804 |
rev | line source |
---|---|
0 | 1 /* genmddeps.c - creates a makefile dependency fragment for the md file. |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
2 Copyright (C) 2004, 2007, 2010 Free Software Foundation, Inc. |
0 | 3 |
4 This program is free software; you can redistribute it and/or modify it | |
5 under the terms of the GNU General Public License as published by the | |
6 Free Software Foundation; either version 3, or (at your option) any | |
7 later version. | |
8 | |
9 This program is distributed in the hope that it will be useful, | |
10 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 GNU General Public License for more details. | |
13 | |
14 You should have received a copy of the GNU General Public License | |
15 along with this program; see the file COPYING3. If not see | |
16 <http://www.gnu.org/licenses/>. */ | |
17 | |
18 #include "bconfig.h" | |
19 #include "system.h" | |
20 #include "coretypes.h" | |
21 #include "errors.h" | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
22 #include "read-md.h" |
0 | 23 |
24 | |
25 struct filedep | |
26 { | |
27 struct filedep *next; | |
28 const char *pathname; | |
29 }; | |
30 | |
31 static struct filedep *deps, **last = &deps; | |
32 | |
33 static void | |
34 add_filedep (const char *pathname) | |
35 { | |
36 struct filedep *n = XNEW (struct filedep); | |
37 n->pathname = pathname; | |
38 *last = n; | |
39 last = &n->next; | |
40 } | |
41 | |
42 int | |
43 main (int argc, char **argv) | |
44 { | |
45 struct filedep *d; | |
46 | |
47 progname = "genmddeps"; | |
48 include_callback = add_filedep; | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
49 |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
50 if (!read_md_files (argc, argv, NULL, NULL)) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
51 return FATAL_EXIT_CODE; |
0 | 52 |
53 *last = NULL; | |
54 | |
55 /* Output a variable containing all of the include files. */ | |
56 fputs ("MD_INCLUDES =", stdout); | |
57 for (d = deps; d ; d = d->next) | |
58 printf (" \\\n\t%s", d->pathname); | |
59 putchar ('\n'); | |
60 | |
61 /* Output make targets for these includes with empty actions. This | |
62 will guard against make errors when includes are removed. */ | |
63 for (d = deps; d ; d = d->next) | |
64 printf ("\n%s:\n", d->pathname); | |
65 | |
66 fflush (stdout); | |
67 return (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE); | |
68 } |