This is the mail archive of the
mailing list for the Cygwin project.
Re: Make, TMP=tmpnam => coredump
- From: Brian Dessent <brian at dessent dot net>
- To: cygwin at cygwin dot com
- Date: Fri, 08 Apr 2005 17:32:20 -0700
- Subject: Re: Make, TMP=tmpnam => coredump
- Organization: My own little world...
- References: <PDEBLOPEKAOKEBIONCMIKEHNFAAA.larry@eBizCreators.com>
- Reply-to: cygwin at cygwin dot com
> The problem I found is that the Makefile contains the statement
> 'TMP=tmpnam'. The build fails after the program builds a file $(TMP).
> Apparently, the local tmpnam.exe file that gets built gets called when make
> attempts to build the remaining files. (Is there a way to disable the pwd to
> test this?) I've verified this problem on two out of three machines.
> Does anybody know about this bug? Can someone please confirm what I'm
> Here's a simple test to confirm:
> all: $(TMP) program
> gcc -c program.c
> create two identical files tmpnam.c and program.c with the following code:
> #include <stdio.h>
> int main()
> printf("Hello World!");
> Type make. This is what I get:
> gcc tmpnam.c -o tmpnam
> gcc program.c -o program
> make: *** [program] Aborted (core dumped)
With the three files mentioned above, I get
make: *** No rule to make target `tmpnam', needed by `all'. Stop.
...which is correct because there is nothing in the Makefile to tell
make how to make 'tmpnam'. I suspect there is something else going on
in your case, such as some kind of implicit ".c.o" or ".c.exe" rule, or
some other makefile rules being included. Your test makefile above
doesn't make much sense anyway, because "gcc -c program.c" will compile
but not link program.c, creating program.o, which in no way satisfies
either dependency of the rule.
Are you sure the 'make' and 'gcc' that are in your path are Cygwin's and
not some win32 tools?
And just so you know... Cygwin tries to provide a POSIX environment but
there are still many differences between it and linux. I wouldn't
expect every example to work the same. The .exe extension is one main
one that comes up in makefiles. Another example is that -lm is totally
superfluous under Cygwin. Also realize that under Windows the
environment variable $TMP is used as the location to place temporary
files, and is a horrible choice for the name of a variable to use in a
Makefile. That's a good example of how not to write a portable
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html