Date: Thu, 25 Jun 92 10:53:10 -0400 From: unifi!yigal AT uunet DOT UU DOT NET (Yigal Hochberg) To: uunet!tts.lth.se!exjtmm AT uunet DOT UU DOT NET Cc: djgpp AT uunet DOT UU DOT NET Subject: How to make up a makefile? > Return-Path: > From: Thommy "M." Malmstroem > Date: Thu, 25 Jun 92 14:23:58 +0200 > To: djgpp AT sun DOT soe DOT clarkson DOT edu > Subject: How to make up a makefile? > > Hi all! > > What's wrong with this makefile? > > Gives error: > C:\TGT>gmake > make: makefile:5: missing separator. Stop. (1) Gmake wants a real in front of a command-line, for example: target : dep1 dep1 echo dep1 dep2 In your specific case for example you need: tgt.exe : timer.o setup.o trafsig.o signals.o tgt.o gcc -o tgt timer.o setup.o trafsig.o signals.o tgt.o strip tgt aout2exe tgt (2) Other comments: (a) Why don't you use generic rule for compilation: %.o : %.c $(CC) -c $(CFLAGS) $< And then you will not need a line per individual "c" file. (b) You can also use some builtin macros like $^ $@ $? etc. for example: tgt.exe : timer.o setup.o trafsig.o signals.o tgt.o gcc -o $(basename $@) $^ strip $(basename $@) aout2exe $(basename $@) I hope it helps. - Yigal Yigal Hochberg yigal AT unifi DOT com Unifi Communications Corp. Tel: 508-663-7570 4 Federal St. Fax: 508-663-7543 Bellerica, MA 01821