delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/03/14/19:28:53

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <000701c40a24$5e9cc7d0$2cb80544@cx272325b>
From: "Alan" <alanw AT cox DOT net>
To: "Cygwin" <cygwin AT cygwin DOT com>
References: <003601c40a0d$9bbeec90$6400000a AT RossLap>
Subject: Re: cp.exe bug
Date: Sun, 14 Mar 2004 16:27:59 -0800
MIME-Version: 1.0

----- Original Message ----- 
From: "Ross Boulet" <ross AT rossb DOT com>
To: "Cygwin" <cygwin AT cygwin DOT com>
Cc: "'Alan'" <alanw AT cox DOT net>
Sent: Sunday, March 14, 2004 1:44 PM
Subject: RE: cp.exe bug


> > > > Problem:
> > > > fileutils version 4.1-2, specifically: cp.exe does not
> > work properly.
> > > >
>
> [ ... Snip ... ]
>
> >
> > I've narrowed it down to running `make' on my linux Makefiles, simple
> > example follows:
> >
> > ####### Simple Makefile Example
> >
> > CC= gcc
> >
> > OBJ= foo.o
> > FILE= foo.c
> > BIN= foo
> >
> > all: $(BIN) install
> >
> > $(BIN): $(OBJ)
> >  $(CC) -o $(BIN) $(OBJ)
> >
> > $(OBJ):
> >  $(CC) -c $(FILE) -o $(OBJ)
> >
> > install:
> >  mkdir -p ./bin/;
> >  cp $(BIN) ./bin/;
> >
> > ####### End Makefile>
> >
> > >From prompt:
> >
> > $ make
> > mkdir -p ./bin/;
> > cp foo ./bin/;
> > cp: `foo' and `./bin/foo' are the same file
> > make: *** [install] Error 1
> >
> >
> > The problem I believe is that `Make' outputs the binary `foo'
> > as `foo.exe'
> > which causes `cp.exe' to fail. This had previously worked
> > fine with the
> > version of `cp.exe' included with `fileutils 4.1-1'
> >
> > Workaround:
> > Modify all existing Makefiles by adding the proper file
> > extension to the
> > binary.
> >
> > Example:
> > BIN= foo
> >
> > Should be changed to:
> > BIN= foo.exe
> >
> >
> >
>
> I cut more from my makefile and just use one symbolic in place of your
BIN,
> OBJ, and FILE as follows:
>
> ####### Even More Simple Makefile Example
>
> CC= gcc
>
> FILE= foo
>
> all: $(FILE).exe install
>
> $(FILE).exe: $(FILE).o
>  $(CC) -o $(FILE).exe $(FILE).o
>
> $(FILE).o:
>  $(CC) -c $(FILE).c -o $(FILE).o
>
> install:
>  mkdir -p ./bin/;
>  cp $(FILE).exe ./bin/;
>
> ####### End Makefile
>
>

That would normally be fine if I was was using Cygwin only, but since my
Makefiles are used in projects built with both RedHat linux and Cygwin, this
new change to `cp.exe' forces me to have to modify all my Makefiles.

Example, I now either need to maintain two makefiles for each project, or
add a conditional expression to all my Makefiles:

BIN= foo

ifeq ($(TERM), cygwin)
    BIN:=$(BIN).exe
endif


It's no big deal, but after updating to the newest Cygwin release and
discovering my projects no longer installed because of the new `cp.exe'
seemed like a bug.





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

- Raw text -


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