Subject: Re: gcc produces foo.exe, not foo
From: [email-masked] (Mumit Khan)

25 Sep 1998 06:46:20 -0700
Message-ID: <[email-masked]>
References: <[email-masked]>
To: Arne Glenstrup <[email-masked]>
Cc: [email-masked]

Arne Glenstrup <[email-masked]> 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
"[email-masked]" with one line of text: "help".