* Makefile.tpl: Add missing empty maybe-check-gcc target.
[official-gcc.git] / gcc / mkdeps.h
blob2be8f81a99cc89f00c21c1cef303b494834dc56c
1 /* Dependency generator for Makefile fragments.
2 Copyright (C) 2000, 2001 Free Software Foundation, Inc.
3 Contributed by Zack Weinberg, Mar 2000
5 This program is free software; you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published by the
7 Free Software Foundation; either version 2, or (at your option) any
8 later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 In other words, you are welcome to use, share and improve this program.
20 You are forbidden to forbid anyone else to use, share and improve
21 what you give them. Help stamp out software-hoarding! */
23 #ifndef GCC_MKDEPS_H
24 #define GCC_MKDEPS_H
26 /* This is the data structure used by all the functions in mkdeps.c.
27 It's quite straightforward, but should be treated as opaque. */
29 struct deps;
31 /* Create a deps buffer. */
32 extern struct deps *deps_init PARAMS ((void));
34 /* Destroy a deps buffer. */
35 extern void deps_free PARAMS ((struct deps *));
37 /* Add a target (appears on left side of the colon) to the deps list. Takes
38 a boolean indicating whether to quote the target for MAKE. */
39 extern void deps_add_target PARAMS ((struct deps *, const char *, int));
41 /* Sets the default target if none has been given already. An empty
42 string as the default target in interpreted as stdin. */
43 extern void deps_add_default_target PARAMS ((struct deps *, const char *));
45 /* Add a dependency (appears on the right side of the colon) to the
46 deps list. Dependencies will be printed in the order that they
47 were entered with this function. By convention, the first
48 dependency entered should be the primary source file. */
49 extern void deps_add_dep PARAMS ((struct deps *, const char *));
51 /* Write out a deps buffer to a specified file. The third argument
52 is the number of columns to word-wrap at (0 means don't wrap). */
53 extern void deps_write PARAMS ((const struct deps *, FILE *,
54 unsigned int));
56 /* Write out a deps buffer to a file, in a form that can be read back
57 with deps_restore. Returns nonzero on error, in which case the
58 error number will be in errno. */
59 extern int deps_save PARAMS ((struct deps *, FILE *));
61 /* Read back dependency information written with deps_save into
62 the deps buffer. The third argument may be NULL, in which case
63 the dependency information is just skipped, or it may be a filename,
64 in which case that filename is skipped. */
65 extern int deps_restore PARAMS ((struct deps *, FILE *, const char *));
67 /* For each dependency *except the first*, emit a dummy rule for that
68 file, causing it to depend on nothing. This is used to work around
69 the intermediate-file deletion misfeature in Make, in some
70 automatic dependency schemes. */
71 extern void deps_phony_targets PARAMS ((const struct deps *, FILE *));
73 #endif /* ! GCC_MKDEPS_H */