Date: Thu, 9 Jun 1994 8:06:05 -0400 (EDT) From: Chris Tate To: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Weird Make/MS C++ problems This isn't *quite* a fit topic for this list, but since it centers around the GNU Make distributed with DJGPP, I thought I'd give it a go. Bear with me. I would like *very* much to use GNU Make for developing a particular Windows application that I'm working on, using Visual C++ (actually MS C++ 8.0, the command-line version, since obviously Make needs that sort of compiler). My main reason is the 'vpath' functionality; I'd really like to be able to keep sources, headers, and object files all in different places. I'm getting very strange behavior from CL (the compiler), though, when it's invoked from Make. The directory structure I'm using has the Makefile at the 'root', and 'INC', 'SRC', and 'OBJ' subdirectories to hold includes, sources, and object files respectively. Now, the command to compile a file, putting the object into a particular directory looks like this: CL /c /Fo /Tp src/foo.cc can be something like 'obj\' i.e. make the command line: CL /c /Foobj\ /Tp src/foo.cc, which puts the resultant .obj file into the obj\ subdirectory of whatever the 'current' directory is. This is what I want. (oh, yeah - the 'src/foo.cc' is generated by GNU Make to properly specify a .cc file in the SRC subdirectory). Unfortunately, it doesn't work. From the Makefile, that is. If I go to the directory with the Makefile, and type the above CL command (giving /Foobj\ as the output file option) it works fine. However, when *the exact same command* is invoked from GNU Make, it writes the object file to a bogus file in the same directory as the Makefile, with a name something like 'foobj.obj'. If the /Fo option is given a full path, i.e. something like /Fod:\gmtng\obj\, then the created file is named gmtngobj.obj. *SOMETHING* is confusing MS C++ 8.0's CL. My initial suspicion is that it's either a bug in CL, or some strange interaction involving the way that GNU Make passes arguments to external programs. Does anyone have any notion about what's going on? I'd like to upgrade to the Visual C++ 1.5 release, but I don't have a CD-ROM drive immediately available, so for the moment that's not an option.... Thanks for taking the time to read this! -- Chris Tate fixer AT faxcsl DOT dcrt DOT nih DOT gov