From owner-freebsd-questions@FreeBSD.ORG Mon May 22 23:08:32 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6E10716A9FD for ; Mon, 22 May 2006 23:08:32 +0000 (UTC) (envelope-from andrew.chace@gmail.com) Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id E938743D45 for ; Mon, 22 May 2006 23:08:31 +0000 (GMT) (envelope-from andrew.chace@gmail.com) Received: by nz-out-0102.google.com with SMTP id l8so1087999nzf for ; Mon, 22 May 2006 16:08:31 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:subject:from:to:cc:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding; b=Lk+N/h0lHxmjE2w70PUfeLH83EEo5I6f8WoVfbemqqVYylpxHL/Gj/CQTxjGK7EKd6uZZSccgwOH8+lR8VneleqdtNFTy0bnBec4nOey89MzcDZY8uSqj97CA5hY0KEmG7xpmgAVMSXT1tht1IJACYLXh5GC7SKRvrQy/t7nHTY= Received: by 10.36.220.27 with SMTP id s27mr5008802nzg; Mon, 22 May 2006 16:08:30 -0700 (PDT) Received: from ?192.168.0.6? ( [70.56.10.145]) by mx.gmail.com with ESMTP id 38sm3691200nzf.2006.05.22.16.08.30; Mon, 22 May 2006 16:08:30 -0700 (PDT) From: Andrew To: Parv In-Reply-To: <20060522224521.GA7373@holestein.holy.cow> References: <1148335671.2572.10.camel@LatitudeFC5.network> <20060522224521.GA7373@holestein.holy.cow> Content-Type: text/plain Date: Mon, 22 May 2006 18:08:37 -0500 Message-Id: <1148339317.2572.15.camel@LatitudeFC5.network> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 (2.6.1-1.fc5.2) Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: Makefile and '$(addprefix)' X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 May 2006 23:08:33 -0000 Hello, You are correct; I am using GNU make, err, rather, trying to, at least. Found a typo that fixed part of the problem: $(addprefix, PREFIX, ITEM) should be $(addprefix PREFIX, ITEM). Note that there is no comma after 'addprefix'. This particular Makefile seems to be horribly broken. So I think I might as well start over. Further reading shows that the 'vpath' directive should be used in this case, or '.PATH' for BSD make. Thanks for the suggestion at least... -Andrew On Mon, 2006-05-22 at 18:45 -0400, Parv wrote: > in message <1148335671.2572.10.camel@LatitudeFC5.network>, > wrote Andrew thusly... > > > > I'm trying to use $(addprefix) build lists of source files and > > object files containing the relative paths for each. The problem > > is that $(addprefix) never seems to be evaluated. When I run 'make > > -p', $OBJECT_LIST looks exactly like in does in my Makefile, which > > is listed below. > ... > > #### Begin Makefile #### > > > > ## compiler settings > > CC = gcc > > OPTIONS = -Wall -g > > > > ## directory layout > > BASEDIR = ../alice > > SOURCEDIR = $(BASEDIR)/sources > > OBJECTDIR = $(BASEDIR)/objects > > DOCSDIR = $(BASEDIR)/documentation > ... > > SOURCES_LIST = $(addprefix, $(SOURCEDIR), $(SOURCE)) > > OBJECTS_LIST = $(addprefix, $(OBJECTDIR), $(OBJECTS)) > > > > ## targets > > alice: $(OBJECT_LIST) > > $(CC) $(OPTIONS) -o $@ $(OBJECT_LIST) > ... > > Looks like you are using gnu make syntax. > > Read make(1) man page. Replace $(VAR) with ${VAR} & see what > happens (i am unsure as i am a light user of BSD make). > > > - Parv >