[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Change in behaviour of subst from 3.80 to 3.81 ??

From: Jamie Allsop
Subject: Change in behaviour of subst from 3.80 to 3.81 ??
Date: Sat, 08 May 2004 10:19:11 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4


(Windows 2k/XP(tested on both), Cygwin, make 3.80 and make 3.81 beta)

I have a make file that works fine 3.80 but not in 3.81. I have already
posted one issue in a previous post. This is another issue relating to
the same file.

I have a make file with the following elements, first I read in a
Windows environment variable and fix the windows path slashes...


I have sources located off this location on my hard drive so I can write:

PROJECT = MyProgram.exe

SOURCES = mainsourcefile.cpp \
   $(MAKE_COMPATIBLE_ENVVAR1)/sourcedir/dir1/sourcefile1.cpp \
   $(MAKE_COMPATIBLE_ENVVAR1)/sourcedir/dir1/sourcefile2.cpp \

OBJFILES = $(subst .cpp,.obj,$(SOURCES))

Assuming I have a variable defined as LINKER_DIRECTIVE (this was a
mistake in my previous post...) and COMPILER_DIRECTIVE I can write the


$(OBJFILES) : %.obj : %.cpp

My problem is in the LINKER_DIRECTIVE.

I am using Borland's ilink32 linker and I define LINKER_DIRECTIVE as:


LINKER_ALLOBJ = c0w32.obj sysinit.obj $(ILINK32OBJFILES)

                    $(ILINK32LIBPATHS) \
                    $(LINKER_ALLOBJ), \
                    $(PROJECT),, \
                    $(LINKER_ALLLIB),, \


ilink32 uses the '+' sign to concatenate libpats and obj files so that
long lines can be passed to the linker. Only ILINK32OBJFILES and
ILINK32LIBPATHS are of interest, the rest are striaghtforward variable

ILINK32OBJFILES is defined as:

ILINK32OBJFILES = $(subst /,\, $(subst \,+,$(OBJFILES)))

ILINK32LIBPATHS is similarly defined as:

ILINK32LIBPATHS = $(subst /,\, $(subst \,+,$(LIBPATHS)))

If we only consider ILINK32OBJFILES then as far as I understand the
following substitution results:

Given $(OBJFILES) is something like this:

OBJFILES = mainsourcefile.obj \
   $(MAKE_COMPATIBLE_ENVVAR1)/sourcedir/dir1/sourcefile1.obj \
   $(MAKE_COMPATIBLE_ENVVAR1)/sourcedir/dir1/sourcefile2.obj \

assuming $(MAKE_COMPATIBLE_ENVVAR1) expands to 'D:/cvscheckout' we have

OBJFILES = mainsourcefile.obj \
   D:/cvscheckout/sourcedir/dir1/sourcefile1.obj \
   D:/cvscheckout/sourcedir/dir1/sourcefile2.obj \

then ILINK32OBJFILES will be this, after substitution,

ILINK32OBJFILES = mainsourcefile.obj +
   D:\cvscheckout\sourcedir\dir1\sourcefile1.obj +
   D:\cvscheckout\sourcedir\dir1\sourcefile2.obj +

When this is passed to the linker using make 3.80 the linker happily
sees all the files and performs the link as expected.

However when the same is passed to the linker using make 3.81 the linker
chokes and says that it cannot find the file (for example),

Turbo Incremental Link 5.64 Copyright (c) 1997-2002 Borland
Fatal: Unable to open file 'D:cvscheckoutsourcedirdir1sourcefile1.obj'

The first file mainsourcefile.obj appears to be found ok. The files do
exist and it works ok in 3.80. (fails in 3.79)

Has there been a change in how subst works in 3.81? Is this a regression?

Thanks for your help,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]