CCMAKEDEP(1)

πŸ“¦
version 1.0.11 Β· 3 versions
, in alpine 3.24, arch rolling, nixos 26.05, nixpkgs unstable

🌸 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 -c immediately followed by the compiler name, she's a little quirky like that πŸŽ€)
  • -fmakefile β€” filename. this allows you to specify an alternate makefile in which ccmakedep can 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 for ccmakedep to 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 -- β€” if ccmakedep encounters 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, ccmakedep can be made to safely ignore esoteric compiler arguments that might normally be found in a CFLAGS make macro (see the EXAMPLE section above). -D, -I, and -U options appearing between the pair of double hyphens are still processed normally. πŸ¦‹
heads up bestie: your -wwidth and -oobject-suffix from the synopsis are in the house too β€” they're just part of the cpp-flags situation, and remember the golden rule: anything ccmakedep doesn'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