make

Marc Maathuis mm at chorus.fr
Wed Aug 9 21:38:38 AEST 1989


Can anybody explain me why in the following typescript
'make -n' and 'make' want to recompile:

i/  Why does 'make -n' at command <9> say that prog.c has to be recompiled,
    and 'make' says <11> that prog is up to date ?

ii/ After having removed the file x.h at <12>, x.h in the makefile
    is just a target (make doesn't complain about not finding a file x.h).
    Why does 'make' recompile every time (<14>, <15>),
    altough the file y.h is older than prog.o ?

-------------------------------------------------
Script started on Wed Aug  9 11:41:18 1989
<1>  uname -a
java java 4.2BSD vm sun
<2>  echo $SHELL
/bin/ksh
<3>  type make
make is a tracked alias for /bin/make
<4>  cat prog.c
main () {return;}

<5>  cat makefile
prog:   prog.o
        cc -o prog prog.o

prog.o: x.h
        cc -c prog.c

x.h:    y.h

<6>  > x.h
<7>  > y.h
<8>  make
cc -c prog.c
cc -o prog prog.o
<9>  make -n
cc -c prog.c
cc -o prog prog.o
<10>  ls -l prog.o x.h
-rw-r-----  1 mm             74 Aug  9 11:43 prog.o
-rw-r-----  1 mm              0 Aug  9 11:41 x.h
<11>  make
`prog' is up to date.
<12>  rm x.h
<13>  make -n
cc -c prog.c
cc -o prog prog.o
<14>  make
cc -c prog.c
cc -o prog prog.o
<15>  make
cc -c prog.c
cc -o prog prog.o
<16>  exit

script done on Wed Aug  9 11:44:33 1989
------------------------------------------------

Thanks for sending answers by email.

Marc Maathuis
  Chorus systemes			Tel +33 (1) 30 57 00 22
  6, avenue Gustave Eiffel		Fax +33 (1) 30 57 00 66
  78182 St. Quentin en Yvelines Cedex	
  France

  E-mail: mm at chorus.fr                     	(Internet)
          {...,uunet}!mcvax!inria!chorus!mm	(UUCP)



More information about the Comp.unix.questions mailing list