This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: make: .exe handling breaks kernel cross-compile


On Sun, Jun 10, 2012 at 03:57:33PM -0500, Yaakov (Cygwin/X) wrote:
>On 2012-06-10 13:29, Christopher Faylor wrote:
>> On Sun, Jun 10, 2012 at 01:06:18PM -0500, Yaakov (Cygwin/X) wrote:
>>> I can confirm that this previously reported bug in make .exe handling
>>> still affects the cross-compile of the Linux kernel:
>>>
>>> http://cygwin.com/ml/cygwin/2009-11/msg00935.html
>>
>> Without diving into the depths of the linux makefiles, this doesn't seem
>> like a bug.  gcc creates .exe files.  The makefile isn't expecting to
>> create one and, so, gets confused.  Makefiles which expect .exe
>> extensions usually use the EXEEXT variable for just this purpose.
>> Linux's makefile doesn't do that for probably obvious reasons.
>
>While our make won't connect a dep on "foo" to a foo.exe rule (which can 
>occur in automake-generated Makefiles with custom rules), it does see 
>foo.exe fulfilling a dep on "foo" if it is already present:
>
>$ cat Makefile
>all: bar
>bar: foo
>	touch bar.exe
>clean:
>	rm -f bar.exe foo.exe
>
>$ touch foo.exe
>$ make
>touch bar.exe
>$ make clean
>rm -f bar.exe foo.exe
>
>The problem here is the kernel uses VPATH -- scripts/pnmtologo(.exe) is 
>not relative to drivers/video/logo, but rather to $(O) -- and somehow 
>with VPATH the .exe magic doesn't happen:
>
>$ cat Makefile
>VPATH = $(PWD)/build
>
>all: bar
>bar: foo
>	touch bar.exe
>
>$ mkdir -p build
>$ touch build/foo.exe
>$ make
>make: *** No rule to make target `foo', needed by `bar'.  Stop.
>
>So foo.exe fulfills foo, but not with VPATH.  Isn't that a bug?

If there is a bug it is with make ever equating foo.exe with foo.  It's
undoubtedly happening because of Cygwin's attempts at transparency.

I'm not kidding about EXEEXT.  Surely you know about this from having
maintained cygport.

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]