[comp.lang.c] Further Adventures w/MS Make

doug@gethen.UUCP (Doug Asherman) (08/16/88)

I am (again) having a slight problem with the Microsoft make utility.
I'll go through this step by step...bear with me, OK?

I have the following inference rules set up in TOOLS.INI in the UTIL
directory:

.c.obj
    cl -c $(CFLAGS) *.c

.obj.exe:
    link $(LFLAGS) $**,$@,$(MAP),$(LIBS);

and of course I've set the environment variable INIT to C:\UTIL.

So...I use the following makefile (called DEMO):

#makefile for DEMO.EXE
a.obj : a.c

b.obj : b.c

demo.exe : a.obj b.obj
#end of makefile

    The problem here is:  a.obj and b.obj are both built successfully.
However, demo.exe is not created.  If I change the name of either a or
b to demo, though, everything goes without a hitch.  I can only assume
from this that you can -only- build a .exe file if one of your .obj files
has the same name.  However, in the MS documentation on MAKE, they have
a file called TEST.EXE built from 3 .obj files called MOD1, MOD2, and
MOD3.  (Do I trust the docs?  Well, up till now...)

So...what am I doing wrong?  Everything I've read seems to indicate that
I should have no trouble, yet...

Any help on this would be greatly appreciated.


-- 
Current Address:                    :  "Get used to disappointment"
                                    :         -William Goldman
{ sun, ptsfa }                      :              from
!hoptoad!unisoft!gethen!doug        :         "The Princess Bride"

jlh@loral.UUCP (Physically Pffft) (08/18/88)

In article <1148@gethen.UUCP> doug@gethen.UUCP (Doug Asherman) writes:
=I am (again) having a slight problem with the Microsoft make utility.
=I'll go through this step by step...bear with me, OK?
=
=I have the following inference rules set up in TOOLS.INI in the UTIL
=directory:
=
=a.obj : a.c
=
=b.obj : b.c
=
=demo.exe : a.obj b.obj
=#end of makefile
=
=    The problem here is:  a.obj and b.obj are both built successfully.
=However, demo.exe is not created.  If I change the name of either a or
=b to demo, though, everything goes without a hitch.


If memory serves me correctly you hafta put the demo.exe: line ABOVE the
a.obj and b.obj.  Microsoft make is pretty stupid, almost as stupid as
the user interfaces to the compiler and linker.  Too bad you can't use
a 'good' make, like Aztec's, but then I run into lots of problems with
the linker interface.  Stuff like the Aztec make lets me make a line
longer than 128 characters, but the linker stops parsing the input line
at 128 with no warning or message whatsoever.  Because the 128 limit
fell on a space between my source file specifications and my library
specification it took me 2 days to figure out why the bloody linker
refused to include my libraries.  Microsoft make gives the error message
'line too long'.


								Jim

					"Broken spanish spoken perfectly"


-- 
Jim Harkins 
Loral Instrumentation, San Diego
{ucbvax, ittvax!dcdwest, akgua, decvax, ihnp4}!ucsd!sdcc6!loral!jlh