Skip to main content
added 75 characters in body
Source Link
Kusalananda
  • 355.8k
  • 42
  • 735
  • 1.1k

You have said that aaa depends on bbb. This means that to create or update aaa, the bbb target needs to be made.

If aaa and bbb exist as files in the current directory, and if aaa is newer than bbb, then neither target needs to be rebuilt, but if bbbaaa is outdated in comparison to aaabbb or if it'sbbb is missing, then itaaa will have to be built to ensure that it is up to date (if aaabbb is upmissing, this would need to dateinvolve rebuilding bbb too).

The example below shows that if the two targets actually create the relevant files, then the targets do not get built upon a second invocation of make. If the bbb file is removed, both targets are rebuilt:

$ cat Makefile
aaa: bbb
        echo 456
        touch aaa

bbb:
        echo 123
        touch bbb
$ rm -f aaa bbb
$ make
echo 123
123
touch bbb
echo 456
456
touch aaa
$ make
`aaa' is up to date.
$ rm bbb
$ make
echo 123
123
touch bbb
echo 456
456
touch aaa

You have said that aaa depends on bbb. This means that to create or update aaa, the bbb target needs to be made.

If aaa and bbb exist as files in the current directory, and if aaa is newer than bbb, then neither target needs to be rebuilt, but if bbb is outdated in comparison to aaa or if it's missing, then it will have to be built to ensure that aaa is up to date.

The example below shows that if the two targets actually create the relevant files, then the targets do not get built upon a second invocation of make. If the bbb file is removed, both targets are rebuilt:

$ cat Makefile
aaa: bbb
        echo 456
        touch aaa

bbb:
        echo 123
        touch bbb
$ rm -f aaa bbb
$ make
echo 123
123
touch bbb
echo 456
456
touch aaa
$ make
`aaa' is up to date.
$ rm bbb
$ make
echo 123
123
touch bbb
echo 456
456
touch aaa

You have said that aaa depends on bbb. This means that to create or update aaa, the bbb target needs to be made.

If aaa and bbb exist as files in the current directory, and if aaa is newer than bbb, then neither target needs to be rebuilt, but if aaa is outdated in comparison to bbb or if bbb is missing, then aaa will have to be built to ensure that it is up to date (if bbb is missing, this would need to involve rebuilding bbb too).

The example below shows that if the two targets actually create the relevant files, then the targets do not get built upon a second invocation of make. If the bbb file is removed, both targets are rebuilt:

$ cat Makefile
aaa: bbb
        echo 456
        touch aaa

bbb:
        echo 123
        touch bbb
$ rm -f aaa bbb
$ make
echo 123
123
touch bbb
echo 456
456
touch aaa
$ make
`aaa' is up to date.
$ rm bbb
$ make
echo 123
123
touch bbb
echo 456
456
touch aaa
added 1 character in body
Source Link
Kusalananda
  • 355.8k
  • 42
  • 735
  • 1.1k

You have said that aaa depends on bbb. This means that to create or update aaa, the bbb target needs to be made.

If aaa and bbb exist as files in the current directory, and if aaa is newer than bbb, then neither target needs to be rebuilt, but if bbb is outdated in comparison to aaa or if it's missing, then it will have to be built to ensure that aaa is up to date.

The example below shows that if the two targettargets actually create the relevant files, then the targets do not get built upon a second invocation of make. If the bbb file is removed, both targets are rebuilt:

$ cat Makefile
aaa: bbb
        echo 456
        touch aaa

bbb:
        echo 123
        touch bbb
$ rm -f aaa bbb
$ make
echo 123
123
touch bbb
echo 456
456
touch aaa
$ make
`aaa' is up to date.
$ rm bbb
$ make
echo 123
123
touch bbb
echo 456
456
touch aaa

You have said that aaa depends on bbb. This means that to create or update aaa, the bbb target needs to be made.

If aaa and bbb exist as files in the current directory, and if aaa is newer than bbb, then neither target needs to be rebuilt, but if bbb is outdated in comparison to aaa or if it's missing, then it will have to be built to ensure that aaa is up to date.

The example below shows that if the two target actually create the relevant files, then the targets do not get built upon a second invocation of make. If the bbb file is removed, both targets are rebuilt:

$ cat Makefile
aaa: bbb
        echo 456
        touch aaa

bbb:
        echo 123
        touch bbb
$ rm -f aaa bbb
$ make
echo 123
123
touch bbb
echo 456
456
touch aaa
$ make
`aaa' is up to date.
$ rm bbb
$ make
echo 123
123
touch bbb
echo 456
456
touch aaa

You have said that aaa depends on bbb. This means that to create or update aaa, the bbb target needs to be made.

If aaa and bbb exist as files in the current directory, and if aaa is newer than bbb, then neither target needs to be rebuilt, but if bbb is outdated in comparison to aaa or if it's missing, then it will have to be built to ensure that aaa is up to date.

The example below shows that if the two targets actually create the relevant files, then the targets do not get built upon a second invocation of make. If the bbb file is removed, both targets are rebuilt:

$ cat Makefile
aaa: bbb
        echo 456
        touch aaa

bbb:
        echo 123
        touch bbb
$ rm -f aaa bbb
$ make
echo 123
123
touch bbb
echo 456
456
touch aaa
$ make
`aaa' is up to date.
$ rm bbb
$ make
echo 123
123
touch bbb
echo 456
456
touch aaa
Source Link
Kusalananda
  • 355.8k
  • 42
  • 735
  • 1.1k

You have said that aaa depends on bbb. This means that to create or update aaa, the bbb target needs to be made.

If aaa and bbb exist as files in the current directory, and if aaa is newer than bbb, then neither target needs to be rebuilt, but if bbb is outdated in comparison to aaa or if it's missing, then it will have to be built to ensure that aaa is up to date.

The example below shows that if the two target actually create the relevant files, then the targets do not get built upon a second invocation of make. If the bbb file is removed, both targets are rebuilt:

$ cat Makefile
aaa: bbb
        echo 456
        touch aaa

bbb:
        echo 123
        touch bbb
$ rm -f aaa bbb
$ make
echo 123
123
touch bbb
echo 456
456
touch aaa
$ make
`aaa' is up to date.
$ rm bbb
$ make
echo 123
123
touch bbb
echo 456
456
touch aaa