|
From: William S. <wil...@gm...> - 2010-11-26 10:16:24
|
>> ... I am referring to my makefile, >> not Keith's. [Keith's did not work at all, as shown in the message >> below] ... > > In what way did it not work? This was what happened when I did a make: C:\MinGW\local\lib\src\rand>make gcc -c rand.c del librand.a Could Not Find C:\librand.a ar rcvs librand.a rand.o a - rand.o gcc rand.o librand.a -o rand c:/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../libmingw32.a(main.o):main.c:(.tex t+0xd2): undefined reference to `WinMain@16' collect2: ld returned 1 exit status mingw32-make: *** [rand] Error 1 But below you said to do make install, so: C:\MinGW\local\lib\src\rand>make install copy librand.a c:/mingw/local/lib The system cannot find the file specified. mingw32-make: *** [install] Error 1 > > Sorry, I've misled you here; (I wrote it as I would, forgetting that you > are using a make [mingw32-make] which relies on a dysfunctional shell > [cmd.exe]). cmd.exe will be confused by those slashes used as path > name separators; you need: > > libdir = c:\mingw\local\lib > includedir = c:\mingw\local\inlcude > > or maybe even: > > libdir = c:\\mingw\\local\\lib > includedir = c:\\mingw\\local\\inlcude Tried both. Each time, results identical to above. > > (because make uses backslash as an escape; I don't know if GNU make > built for native windows is smart enough to guess when any single > backslash is intended to represent a path name separator, or an escape). I think \ by itself is ok. > >> ... > > Other than requiring that correction, which is needed for "make install" > to work correctly, I can see no reason for it not to work. Please tell > us why you think it doesn't. (And please stop top-posting, or I may > stop responding). OK sorry about top-posting. > >> ... didn't move and del files correctly, looking in the worng place >> for them. When I invoke make in a given directory, and my makefile >> tells it to move a file from *here* to *there*, it should know to look >> *here* for the file to move! It doesn't. It looks in c:\ >> >> I never told make to look there. When I start up cmd.exe, the >> autorun.bat tells it to start in c:\. Else it starts in something like >> >> ...My Documents... >> >> I don't see why that would be the problem, since this is a sensible >> place to start, in the search path for everybody. It does not confuse >> gcc for example, or any other command I use. > > I suspect this is Windows' inherent user hostility working against you. > Your copy and del commands are cmd.exe built-ins, so make spawns cmd.exe > to execute them; (in fact, it may even spawn cmd.exe to execute all > commands other than a very few make built-ins). If that spawned cmd.exe > runs your autorun.bat, then you lost your current working directory. Ahh! Thanks Keith! I would never have guessed that! Yes, that's it. That's why I needed my kludge. You know, I agree that Windows is complete crap, and that bash is far superior to cmd.exe. I have used linux since 1998. You don't need to convince me. But being forced to work in a Windows environment I have to be pragmatic. Maybe I will install MYSYS at some point, but for now, given my primitive skill set and needs, I think I can cope with cmd.exe vs bash. I would never use grep and other unix utilities. Thanks again for all the help! Bill |