From: Eli Zaretskii Newsgroups: comp.os.msdos.djgpp Subject: Re: Generic makefile! (Re: Reverse-compiler) Date: Wed, 05 Apr 2000 19:34:41 +0200 Organization: NetVision Israel Lines: 14 Message-ID: <38EB7931.C8B9E132@is.elta.co.il> References: <8c3eae$j1l$1 AT news6 DOT svr DOT pol DOT co DOT uk> <8c457a$162$1 AT news7 DOT svr DOT pol DOT co DOT uk> <8caj5q$ii3$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE> <8cb2cm$t25$1 AT news6 DOT svr DOT pol DOT co DOT uk> NNTP-Posting-Host: ras1-p35.rvt.netvision.net.il Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.netvision.net.il 954955992 9969 62.0.172.37 (5 Apr 2000 17:33:12 GMT) X-Complaints-To: abuse AT netvision DOT net DOT il NNTP-Posting-Date: 5 Apr 2000 17:33:12 GMT X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en,ru,hebrew To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Damian Yerrick wrote: > > %.o: %.c $(HEADS) > gcc $(CFLAGS) -o $@ -c $< This rule is redundant: Make knows how to compile .c files into .o files without your telling it. It also knows that every .o file depends on the corresponding .c file. The only piece of knowledge you need to convey to Make is that the .o files depend on the headers. Here's how you do that: $(OBJS): $(HEADS) That's it! Do NOT put any commands under this line, because this isn't a rule, it's just a dependency description.