gcc produces foo.exe, not foo

Mumit Khan khan@xraylith.wisc.edu
Thu Sep 24 19:59:00 GMT 1998


Arne Glenstrup <panic@diku.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@cygnus.com" with one line of text: "help".



More information about the Cygwin mailing list