Date: Sun, 22 Nov 1998 04:21:59 +0000 (GMT) From: George Foot To: djgpp AT delorie DOT com Subject: Re: Makefile Beginner In-Reply-To: <737m7o$jp0$1@oak.prod.itd.earthlink.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com On Sat, 21 Nov 1998, Chris Dupuy wrote: > I have been playing with djgpp for about three days now, I usually use > MSVC for my compiler, but lately decided to check out djgpp. My problem is > in the makefile, I can't seem to get any makefile to work properly, even > when copying them directly out of the HTML help page. Which help page? > Here is my make as it sits, and the message I am getting back is "unable > to find rule to make target gcc needed by main.o".. What? My make seems to > work ok on the Linux box, am I missing something, or am i just stupid? You copied them wrongly. You ought to read the Info documentation -- `info make' -- but briefly, the basic syntax is: target: dependencies command You can have more than one command -- put them on separate lines, in the order they should be executed. They must be indented using real tab characters. Your makefile ends up looking like this (but watch out for the tabs): CC=gcc CFLAGS = -c MkTest.exe : main.o serversocket.o main.o : main.cc $(CC) $(CFLAGS) main.cc -o main.o serversocket.o : serversocket.cc $(CC) $(CFLAGS) -c serversocket.cc -o serversocket.o There are still some problems with it though. I don't think Make knows how to make the .exe like that -- you must tell it. Also you could just lean on the built-in rules here and write a much shorter makefile, but at first it's probably best to learn one thing at a time. -- george DOT foot AT merton DOT oxford DOT ac DOT uk xu do tavla fo la lojban -- http://xiron.pc.helsinki.fi/lojban/