CCMAKEDEP(1)
πΈ CCMAKEDEP(1) β the create-dependencies-in-makefiles-using-a-C-compiler page πΈ
okay so real talk, bestie: this is ccmakedep(1) from the General Commands Manual and it is genuinely iconic. it's the little tool that goes "hey, your makefile forgot about this header" so you don't have to. let's get into it π
β¨ NAME β¨
ccmakedep β create dependencies in makefiles using a C compiler. literally what it says on the tin, no cap π«Ά
π¦ SYNOPSIS π¦
ccmakedep [ cpp-flags ] [ -wwidth ] [ -smagic-string ] [ -fmakefile ] [ -oobject-suffix ] [ -v ] [ -a ] [ -cccompiler ] [ -- options -- ] sourcefile ...
π DESCRIPTION π
so the way this works is: ccmakedep calls a C compiler to preprocess each sourcefile, and then takes that output and constructs makefile rules describing their dependencies. those rules are what tell make(1) which object files must be recompiled when a dependency has changed. main character energy fr fr π
by default, ccmakedep places its output in the file named makefile if it exists, otherwise Makefile. you can pick an alternate makefile with the -f option. here's the cute part: it first searches the makefile for a line beginning with
# DO NOT DELETE
or one you provided with the -s option, and uses that 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. slay, honestly β¨
π₯ EXAMPLE π₯
normally, ccmakedep 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:
ccmakedep -- $(CFLAGS) -- $(SRCS)
look at that. beautiful. no notes π
π OPTIONS π
the program will ignore any option that it does not understand, so you may use the same arguments that you would for cc(1), including -D and -U options to define and undefine symbols and -I to set the include path. iykyk π
-aβ append the dependencies to the file instead of replacing existing dependencies.-cccompilerβ use this compiler to generate dependencies. (yes, that's-cimmediately followed by the compiler name, she's a little quirky like that π)-fmakefileβ filename. this allows you to specify an alternate makefile in whichccmakedepcan place its output. specifying-as the file name (that is,-f-) sends the output to standard output instead of modifying an existing file. obsessed with that little trick ngl π«Ά-sstringβ starting string delimiter. this option permits you to specify a different string forccmakedepto look for in the makefile. the default is# DO NOT DELETE.-vβ be verbose: display the C compiler command before running it. she's narrating her own life π-- options --β ifccmakedepencounters 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,ccmakedepcan 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. π¦
heads up bestie: your-wwidthand-oobject-suffixfrom the synopsis are in the house too β they're just part of thecpp-flagssituation, and remember the golden rule: anythingccmakedepdoesn't understand gets silently ignored. π
π SEE ALSO π
cc(1), make(1), makedepend(1), ccmakedep(1).
(yes, she references herself. icon behavior. nobody's gonna stop her π)
π AUTHOR π
ccmakedep was written by the X Consortium.
Colin Watson wrote this manual page, originally for the Debian Project, based partly on the manual page for makedepend(1).
and that's the whole page, bestie!! π this gorgeous little manual came to you courtesy of imake 1.0.11, dated 2002-10-12 β vintage, but she still ate π β¨
π¦ where this page comes from
- alpine 3.24: imake-doc 1.0.11-r0 Β· custom
- arch rolling: imake 1.0.11-1 Β· MIT-open-group AND HPND
- nixos 26.05: imake 1.0.11
- nixpkgs unstable: imake 1.0.11
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms