Path: utzoo!attcan!uunet!wuarchive!usc!snorkelwacker!ira.uka.de!fauern!tub!net From: net@tub.UUCP (Oliver Laumann) Newsgroups: comp.unix.questions Subject: make(1) question Message-ID: <1463@tub.UUCP> Date: 14 Aug 90 13:19:26 GMT Reply-To: net@tub.UUCP (Oliver Laumann) Organization: Technical University of Berlin, Germany Lines: 32 What is /bin/make supposed to do with the following Makefile (provided that foo.c exists)? % cat Makefile .DEFAULT: echo Ouch. all: foo.o foo.o: foo.c cc -c foo.c % Note that the rule for "all" doesn't have commands. Under all versions of UNIX where I have tested it (lots!), it only compiles foo.c. GNU make, on the other hand, compiles foo.c and then executes the command under the .DEFAULT rule. The 4.3BSD manual for make(1) says that if a target must be created and there are neither any explicit commands nor a relevant built-in rule, then the commands under the .DEFAULT are executed. So GNU make seems to be correct. Is this true? If so, how can I modify the above Makefile to suppress execution of the .DEFAULT commands (provided the .DEFAULT rule must be there for other reasons)? Add a "dummy" echo command to the "all" rule? Or an empty command, i.e. just a tab character? (We don't have GNU make here.) Thanks, -- Oliver Laumann net@TUB.BITNET net@tub.cs.tu-berlin.de net@tub.UUCP