1gccmakedep(1) General Commands Manual gccmakedep(1)
2
3
4
6 gccmakedep - create dependencies in makefiles using 'gcc -M'
7
9 gccmakedep [ -sseparator ] [ -fmakefile ] [ -a ] [ -- options -- ]
10 sourcefile ...
11
13 The gccmakedep program calls 'gcc -M' to output makefile rules describ‐
14 ing the dependencies of each sourcefile, so that make(1) knows which
15 object files must be recompiled when a dependency has changed.
16
17 By default, gccmakedep places its output in the file named makefile if
18 it exists, otherwise Makefile. An alternate makefile may be specified
19 with the -f option. It first searches the makefile for a line begin‐
20 ning with
21
22 # DO NOT DELETE
23
24 or one provided with the -s option, as a delimiter for the dependency
25 output. If it finds it, it will delete everything following this up to
26 the end of the makefile and put the output after this line. If it
27 doesn't find it, the program will append the string to the makefile and
28 place the output after that.
29
31 Normally, gccmakedep will be used in a makefile target so that typing
32 'make depend' will bring the dependencies up to date for the makefile.
33 For example,
34 SRCS = file1.c file2.c ...
35 CFLAGS = -O -DHACK -I../foobar -xyz
36 depend:
37 gccmakedep -- $(CFLAGS) -- $(SRCS)
38
40 The program will ignore any option that it does not understand, so you
41 may use the same arguments that you would for gcc(1), including -D and
42 -U options to define and undefine symbols and -I to set the include
43 path.
44
45 -a Append the dependencies to the file instead of replacing exist‐
46 ing dependencies.
47
48 -fmakefile
49 Filename. This allows you to specify an alternate makefile in
50 which gccmakedep can place its output. Specifying “-” as the
51 file name (that is, -f-) sends the output to standard output
52 instead of modifying an existing file.
53
54 -sstring
55 Starting string delimiter. This option permits you to specify a
56 different string for gccmakedep to look for in the makefile.
57 The default is “# DO NOT DELETE”.
58
59 -- options --
60 If gccmakedep encounters a double hyphen (--) in the argument
61 list, then any unrecognized arguments following it will be
62 silently ignored. A second double hyphen terminates this spe‐
63 cial treatment. In this way, gccmakedep can be made to safely
64 ignore esoteric compiler arguments that might normally be found
65 in a CFLAGS make macro (see the EXAMPLE section above). -D, -I,
66 and -U options appearing between the pair of double hyphens are
67 still processed normally.
68
70 gcc(1), make(1), makedepend(1).
71
73 The version of the gccmakedep included in this X.Org Foundation release
74 was originally written by the XFree86 Project based on code supplied by
75 Hongjiu Lu.
76
77 Colin Watson wrote this manual page, originally for the Debian Project,
78 based partly on the manual page for makedepend(1).
79
80
81
82X Version 11 gccmakedep 1.0.3 gccmakedep(1)