gccmakedep(1)
π¦ gccmakedep(1) π¦
okay so bestie, you're reading the gccmakedep(1) page from the General Commands Manual, and it's giving very useful build-system energy. This is the whole thing β every flag, example, author credit, and footer vibe included. no cap. π
β¨ NAME β¨
gccmakedep β create dependencies in makefiles using gcc -M π
πΈ SYNOPSIS πΈ
gccmakedep [ -sseparator ] [ -fmakefile ] [ -a ] [ -- options -- ]
sourcefile ...
π DESCRIPTION π
okay so gccmakedep literally calls gcc -M to output makefile rules describing the dependencies of each sourcefile, so that make(1) knows which object files must be recompiled when a dependency has changed. main character build behavior, honestly. β¨
By default, gccmakedep places its output in the file named makefile if it exists, otherwise Makefile. An alternate makefile may be specified with the -f option. It first searches the makefile for a line beginning with
# DO NOT DELETE
or one provided with the -s option, as a delimiter for the dependency output. If it finds it, it will delete everything following this up to the end of the makefile and put the output after this line. If it doesn't find it, the program will append the string to the makefile and place the output after that. π
π₯ EXAMPLE π₯
Normally, gccmakedep will be used in a makefile target so that typing make depend will bring the dependencies up to date for the makefile. For example,
SRCS = file1.c file2.c ...
CFLAGS = -O -DHACK -I../foobar -xyz
depend:
gccmakedep -- $(CFLAGS) -- $(SRCS)
π OPTIONS π
The program will ignore any option that it does not understand, so you may use the same arguments that you would for gcc(1), including -D and -U options to define and undefine symbols and -I to set the include path. iconic. π«Ά
-aβ Append the dependencies to the file instead of replacing existing dependencies. π-fmakefileβ Filename. This allows you to specify an alternate makefile in whichgccmakedepcan place its output. Specifying β-β as the file name (that is,-f-) sends the output to standard output instead of modifying an existing file. β¨-sstringβ Starting string delimiter. This option permits you to specify a different string forgccmakedepto look for in the makefile. The default is β# DO NOT DELETEβ. π-- options --β Ifgccmakedepencounters a double hyphen (--) in the argument list, then any unrecognized arguments following it will be silently ignored. A second double hyphen terminates this special treatment. In this way,gccmakedepcan be made to safely ignore esoteric compiler arguments that might normally be found in aCFLAGSmake macro (see the EXAMPLE section above).-D,-I, and-Uoptions appearing between the pair of double hyphens are still processed normally. π
π SEE ALSO π
gcc(1), make(1), makedepend(1). iykyk. π¦
π AUTHOR π
The version of gccmakedep included in this X.Org Foundation release was originally written by the XFree86 Project based on code supplied by Hongjiu Lu. β¨
Colin Watson wrote this manual page, originally for the Debian Project, based partly on the manual page for makedepend(1). π
okay bestie, that's the whole page! brought to you by X Version 11, gccmakedep 1.0.4, and the gccmakedep(1) manual. slay and goodbye! π
β¨
π¦ where this page comes from
- alpine 3.24: gccmakedep-doc 1.0.4-r0 Β· MIT
- arch rolling: imake 1.0.11-1 Β· MIT-open-group AND HPND
- nixos 26.05: gccmakedep 1.0.4
- nixpkgs unstable: gccmakedep 1.0.4
- opensuse-leap 16.0: gccmakedep 1.0.4-160000.2.2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms