Path: utzoo!utgpu!watmath!att!pacbell!ames!sun-barr!cs.utexas.edu!uunet!mcvax!inria!chorus!mm From: mm@chorus.fr (Marc Maathuis) Newsgroups: comp.unix.questions Subject: make Message-ID: <3019@chorus.fr> Date: 9 Aug 89 11:38:38 GMT Organization: Chorus Systemes, Montigny-Le-Bretonneux, France Lines: 69 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@chorus.fr (Internet) {...,uunet}!mcvax!inria!chorus!mm (UUCP)