delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/27/23:02:56

Date: Wed, 27 Aug 1997 20:01:23 -0700 (PDT)
Message-Id: <199708280301.UAA10610@adit.ap.net>
Mime-Version: 1.0
To: mauch AT uni-duisburg DOT de (Michael Mauch)
From: Nate Eldredge <eldredge AT ap DOT net>
Subject: Re: Simple Makefile: how to generate .exe file
Cc: djgpp AT delorie DOT com

This problem originates in the difference between Unix filename conventions,
where executable files have no extension, and the DOS convention, where they
are named *.exe or similar. In DJGPP, therefore, a line like
gcc -o foo foo.c
will produce the files "foo", an unstubbed COFF image, and "foo.exe", the
stubified version. Thus, it can claim to have made the file "foo", but also
be able to act correctly when a Unix-origin makefile then tries to run the
file "foo".
`make', being of Unix origin itself, has its implicit rules work according
to Unix conventions. Your options are:
- Continue doing what you have been
- Use rules like 
x: x.o
  and ignore or delete the unstubbed file
- Modify `make' to add an implicit rule for making .exe files from .o
  I have no idea how easy or hard that will be.

At 04:12  8/27/1997 +0200, you wrote:
>Hi!
>
>I have a very simple makefile:
>
>x.exe:	x.o
>
>This makes the x.o from x.c, because of the implicit rule for compiling
>.o from .c. But x.exe is not created.
>
>If I use:
>
>x:	x.o
>
>the x.exe is created, but also a file named "x." which seems to be the
>x.exe without the stub.
>
>I can insert a pattern rule (copied from the "%.: %.o" rule):
>
>%.exe: %.o  ; $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
>
>or include a makefile that contains that line, but isn't there a better
>(simplier) way to do it? How do you do this?

Nate Eldredge
eldredge AT ap DOT net



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019