[Ilugc] make doubt

  • From: kameshj@xxxxxxxxxxxxx (kamesh jayachandran)
  • Date: Tue, 16 Jul 2002 12:57:53 +0000

Hi all,
I have a project directory structure like this
dependent
        |
        |--->dependent.c
        |--->Makefile
        |--->independent(directory)
                |
                |--->independent.c
                |--->Makefile
The Makefile under the top directory "dependent" is like this
----Makefile starts here---
.PHONY: independent clean
dependent: dependent.c independent
  gcc -o dependent dependent.c
independent:
  cd independent && $(MAKE)
clean:
  rm dependent
----Makefile ends here---

The problem is,
For the module("named independent") sources that are up to date with the 
targets,make says "target is uptodate".This scenario is fine.

For the module("named dependent") sources ,make compile every time i make it 
even though they are up to date with the targets.This scenario is not fine.

How to make it to compile only upon change in the sources not every time in the 
second case.
with regards
kamesh jayachandran


Other related posts: