From: George Foot Newsgroups: comp.os.msdos.djgpp Subject: Re: Can't MAKE Date: 18 Nov 1997 21:09:54 GMT Organization: Oxford University, England Lines: 66 Message-ID: <64t072$64u$1@news.ox.ac.uk> References: NNTP-Posting-Host: sable.ox.ac.uk Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk On Tue, 18 Nov 1997 15:36:45 +1000 in comp.os.msdos.djgpp Oon Lin wrote: : makefile:2: *** missing separator. Stop. : What does that mean ?? It drives me crazy.. I know that make needs real : tabs in MAKEFILE . Since DOS EDIT doesn't support real tab , I had got VIM : , which is similiar to VI in UNIX , to write a makefile but the same error : still appears. Perhaps vim is also not using real tabs... I haven't used it for a while. If you know how to use debug, you could debug the makefile and find out whether it really does have real tabs, or spaces. IIRC in the Win95 DOS Edit you can insert real tabs by typing Ctrl-P Ctrl-I. It's flaky, though; if you do too much editing it can change them all back into spaces again. :( Note that you can get around this problem to some extent by leaving out the commands in your makefile ;). Make already knows how to do most of what you want it to do... you can rewrite your makefile like this: --- begin makefile --- # Tell Make what compiler to use CC = gcc # Tell Make what flags to pass for C compilation (you didn't use any # but this is how you pass them) CFLAGS = -O2 -Wall -g # The following rule runs the value of `CC'. $@ expands to the target # name (program.exe in this case), and $^ expands to the complete # dependency list (mainsrc.o printer.o header.o in this case) program.exe: mainsrc.o printer.o header.o $(CC) -o $@ $^ # The following rules don't have commands given. Make will look # through its internal database to decide what to do to them. mainsrc.o: mainsrc.c printer.h header.h printer.o: printer.c printer.h header.o: header.c header.h --- end makefile --- Now it only has one tab in it -- less opportunity for Edit to corrupt it ;). Also a brief comment on your C code... In mainsrc.c you have: : void main(void) { This is bad. The `main' function must return an integer -- you should declare it like this: int main (void) { and you should put in a `return' statement before the closing brace. And finally, your `header.c' and `printer.c' files should have `#include ', since they use printf. -- george DOT foot AT merton DOT oxford DOT ac DOT uk