MKDEP(1)

πŸ“¦
this version Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’… mkdep β€” construct Makefile dependency list ✨

okay bestie, so this is mkdep, and she lives in section 1 of the General Commands Manual. she's a little build-system fairy and honestly? she eats. 🧚


🌸 SYNOPSIS 🌸

mkdep [-ap] [-f file] [flags] file [...]

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe: mkdep takes a bunch of flags meant for the C compiler plus a list of C source files, and it constructs a whole set of include file dependencies β€” and then it writes all of that into the file .depend. periodt. πŸ’–

an example of how you'd use her in a Makefile might look like this:

CFLAGS= -O -I../include
SRCS= file1.c file2.c

depend:
        mkdep ${CFLAGS} ${SRCS}

where the macro SRCS is the list of C source files, and the macro CFLAGS is the list of flags for the C compiler. iykyk. 😌

the options are as follows:

  • -a β€” append to the output file, so that you can run multiple mkdep's from a single Makefile. so many mkdeps, so little time, we love a group project. 🫢
  • -f file β€” write the include file dependencies to file, instead of the default .depend. she's flexible like that. πŸ’…
  • -p β€” cause mkdep to produce dependencies of the form:
program: program.c

so that subsequent makes will produce program directly from its C module rather than using an intermediate .o module. this is useful for programs whose source is contained in a single module. one file, one moment, main character energy. πŸ‘‘


🌈 SEE ALSO 🌈

cc(1), cpp(1), make(1)


πŸŽ€ FILES πŸŽ€

  • .depend β€” file containing list of dependencies

πŸ“œ HISTORY πŸ“œ

the mkdep command appeared in 4.3BSD-Tahoe. she's vintage, she's iconic, she's been serving since day one. ⭐


and that's the whole page, bestie!! this was brought to you by the 4.2 Berkeley Distribution, dated June 6, 1993 β€” yeah she's an elder but she's still slaying, no cap πŸ’€βœ¨πŸ¦‹

πŸ“¦ where this page comes from