delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/01/13/14:42:19

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <030201bf5dfe$5b529b80$2301a8c0@mediadb.net>
From: "Matthew Brown" <mbrown AT mediadb DOT net>
To: "Andre Oliveira da Costa" <costa AT cade DOT com DOT br>,
<cygwin AT sourceware DOT cygnus DOT com>
References: <001901bf5df6$428a2170$8400000a AT costa DOT cadenet DOT com DOT br>
Subject: Re: [mingw32] Re: [RFC] changing gcc default output executable name (a.exe now)
Date: Thu, 13 Jan 2000 14:42:42 -0500
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id OAA08337

The process I (and others that I am familiar with) use is to define macros for common file extensions such as: EXEEXT, OBJEXT, and LIBEXT. You can conditionally define these in the makefile (or in a makefile that is included everywhere) to be the proper values for the target platform.

Example using gmake syntax:
ifeq ($(TARGET_OS), win32)
  EXEEXT=.exe
  OBJEXT=.obj
  LIBEXT=.lib
else
  ifeq ($(TARGET_OS), cygwin)
    EXEEXT=.exe
    OBJEXT=.o
    LIBEXT=.a
  else
    EXEEXT=
    OBJEXT=.o
    LIBEXT=.a
  endif
endif

Then when you define your targets:
foo$(EXEEXT) :

-- Matthew Brown

----- Original Message ----- 
From: "Andre Oliveira da Costa" <costa AT cade DOT com DOT br>
To: <cygwin AT sourceware DOT cygnus DOT com>
Sent: Thursday, January 13, 2000 1:44 PM
Subject: RE: [mingw32] Re: [RFC] changing gcc default output executable name (a.exe now)


> I'd like to ask for comments on another issue related to portability from
> UNIX --> cygwin, compilation etc.: the way it is now, the linker
> automagically appends a .exe suffix to the executable filename. If you do
> 
> gcc -o foo foo.o
> 
> ld will create foo.exe . I wouldn't complain about it except for the fact
> that this imposes a serious restriction to portability. For example, usually
> when I try to install a just-compiled application through "make install",
> all the cp, mv, chmod, strip and install rules refer to "foo" and not
> "foo.exe", and therefore they (rightfully) complain about missing files. So,
> even if the compilation goes out well,  there's always some makefile
> tweaking involved.
> 
> I don't think tweaking all these applications to look for "foo.exe" if they
> can't find "foo" would be the right thing. But I would really like to be
> able to install the applications I compile without having to tweak all the
> makefiles. Maybe the solution would be not to add the .exe suffix...
> 
> Am I missing something or is this a real problem?
> 
> Andre
> --
> André Oliveira da Costa
> (costa AT cade DOT com DOT br)
> 
> 
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
> 
> 


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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