CITS2002 Systems Programming  
prev
next CITS2002 CITS2002 schedule  

Dependencies between files

From our pseudo-code:


if (files on which a certain file depends)
       i) do not exist, or
      ii) are not up-to-date
then
     create an up-to-date version;

we are particularly interested in the dependencies between various files - certain files depend on others and, if one changes, it triggers the "rebuilding" of others:

dependencies
  • The executable program prog is dependent on one or more object files (source1.o and source2.o).

  • Each object file is (typically) dependent on one C source file (suffix .c) and, often, on one or more header files (suffix .h).

So:

  • If a header file or a C source file are modified (edited),
    then an object file needs rebuilding (by cc).

  • If one or more object files are rebuilt or modified (by cc),
    then the executable program need rebuilding (by cc).

 

NOTE that the source code files (suffix .c) are not dependent on the header files (suffix .h).

 


CITS2002 Systems Programming, Lecture 17, p11, 26th September 2023.