From owner-freebsd-questions Tue Feb 15 14: 4:32 2000 Delivered-To: freebsd-questions@freebsd.org Received: from extremis.demon.co.uk (extremis.demon.co.uk [194.222.242.30]) by builder.freebsd.org (Postfix) with SMTP id D20935276 for ; Tue, 15 Feb 2000 13:55:17 -0800 (PST) Received: (qmail 661 invoked by uid 1010); 15 Feb 2000 21:55:32 -0000 Date: Tue, 15 Feb 2000 21:55:32 +0000 From: George Cox To: Johan Pettersson Cc: FreeBSD questions Subject: Re: Makefile Message-ID: <20000215215532.D503@extremis.demon.co.uk> References: <20000214223927.A2698@b41.ryd.student.liu.se> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.1.2i In-Reply-To: <20000214223927.A2698@b41.ryd.student.liu.se>; from johpe159@student.liu.se on Mon, Feb 14, 2000 at 10:39:27PM +0100 X-Operating-System: FreeBSD 4.0-CURRENT (i386) Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 14/02 22:39, Johan Pettersson wrote: > Have problem whith a makefile =/ Have read GNU Make but can't solve the > problem. Following line work: > cc -L/home/johpe/projekt/cn/src lab_2.c -lcable -lnsl Try this Makefile. I assume you are using gcc. ---8<--- CC = cc CFLAGS = -Wall -pipe SRCS = lab_2.c OBJS = $(SRCS:.c=.o) LIBS = -lcable -lnsl BIN = lab2 # the executable depends on all the objects $(BIN) : $(OBJS) $(CC) $(BIN) $(OBJS) $(LIBS) # each object depends on its source file %.o: %c $(CC) $(CFLAGS) -c $< -o $@ ---8<--- gjvc -- [gjvc] To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message