delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/09/25/06:46:20

From: khan AT xraylith DOT wisc DOT edu (Mumit Khan)
Subject: Re: gcc produces foo.exe, not foo
25 Sep 1998 06:46:20 -0700 :
Message-ID: <9809250047.AA04041.cygnus.gnu-win32@modi.xraylith.wisc.edu>
References: <Pine DOT HPP DOT 3 DOT 95 DOT 980924111126 DOT 1831B-100000 AT grimer DOT diku DOT dk>
To: Arne Glenstrup <panic AT diku DOT dk>
Cc: gnu-win32 AT cygnus DOT com

Arne Glenstrup <panic AT diku DOT dk> writes:
> Now that we have established that we need some (in my opinion) dirty
> $(EXEEXT)-stuff, what is the consensus on how to use it with regards to
> makefile targets and -o switches to compilers? Should a makefile look
> like this:

Writing portable Makefiles usually always involves something that will
always be "dirty" to some/most. I still have makefiles lying around in 
our projects that were portable between Unix and VMS, and talk about 
dirty!

Make is a powerful tool, but the downside is that it's quite low-level 
and has been showing its age for a while now. Unfortunately, the general
purpose and cross-platform alternatives just haven't caught on and have 
remained in the dark arena called "research tools". 

> 
>   EXEEXT = @EXEEXT@
> 
>   goal$(EXEEXT): goal.c
>                  $(CC) -o goal$(EXEEXT) goal.c
>                  cp goal$(EXEEXT) anothergoal$(EXEEXT)
>                  mv goal$(EXEEXT) yet.another.goal
> 

How about letting make saving you some error-prone typing:

   goal$(EXEEXT): goal.c
                  $(CC) -o $@ goal.c
                  cp $@ anothergoal$(EXEEXT)
                  mv $@ yet.another.goal
 
> or should it look like this:
> 
>   EXEEXT = @EXEEXT@
> 
>   goal:          goal.c
>                  $(CC) -o goal goal.c
>                  cp goal$(EXEEXT) anothergoal$(EXEEXT)
>                  mv goal$(EXEEXT) yet.another.goal

I prefer, and use, the former.

Regards,
Mumit

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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