Re: [cc65] Please critique this makefile

From: <silverdr1wfmh.org.pl>
Date: 2010-04-23 13:29:40
On 2010-04-23, at 12:47, Oliver Schmidt wrote:

> Hi,
>
>> I added conditionals below so that default values are supplied  
>> instead of
>> failing when some variables are not defined. Target choice is  
>> following the
>> defaults of cc65 utilities.
>
> I intentionally didn't do that. The usefulness of doing so depends
> from my perspective from the intended scenario. If you i.e. want to
> integrate the Makefile into some framework than that framework should
> just always provide the name of the target to build for on the GNU
> make cmdline. Apart from that:
>
> - The C64 default has no technical background and is just guesswork
> based on some anticipated user preference.

That is correct, yet it is included in the cc65. Therefore I thought  
it would be OK to follow the same pattern. I would say - I believe  
this is what a user would expect.

> - The "it's in the path" default typically doesn't get you far as the
> tools don't find their headers and libraries without environment
> variables set. On Windows this has always been this way and if I
> understood a recent discussion on this list right than this is now
> true on Unix as well.

Luckily - for some time already - not. I recall my bugging here about  
the default locations for cc65 files and those have been established  
to follow the common pattern. Currently I don't need (and I don't  
have) a single CC65_* variable set anymore, which is very much OK. I  
would have to set variable(s) if I installed CC65 in a non-default  
location, which is clearly understandable of course.

> Since the last cc65 release CC65_HOME can
> replace all the other cc65 variables pointing to cc65 subdirectories.
> Including <cc65>/bin into the path is a nice add-on to reduce typing
> when running cl65 from the cmdline. But I don't see a point in relying
> on that in a Makefile.
>
>> From my perspective much more useful is something like this (from my
> Contiki Makefiles):
>
> ifndef CC65_HOME
>  ${error CC65_HOME not defined! You must specify where cc65 resides}
> endif

I am not sure how it works under Windows - does it work differently? -  
but the nice fact is that (at least on *nix) it is no longer required,  
as long as CC65 is installed in its default location. This is one of  
the examples of my favourite "convention over configuration" approach.

>
> All in all I'd say that I spent _way_ more time in my worklife finding
> out why something didn't work because of some default I didn't know of
> and had to figure out how to override than adding necessary parameters
> I was asked for...
>

That I fully agree. Why I wanted it to be there is that the variable  
is simply not mandatory (necessary) anymore, which can lead to  
situation where the whole cc65 package works perfectly fine but the  
Makefile asks for some (UNnecessary) variables. Again - I don't know  
how is that under Windows.

BTW. I am looking now at your sed voodoo trying to figure out what  
_exactly_ are you doing there and it never stops amazing me.. I mean I  
wrote a number of sed one-liners or complex regexps in my life but  
those things are always "write-only" to me ;-)

I also found that while cc65 has nice (and very much useful here!) '-- 
create-dep' option, ca65 does not.. If it had, it would be possible to  
track the dependencies from the assembler files as well. I mean  
e.g. .INCBINed files, right?

-- 
SD!

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Fri Apr 23 13:30:00 2010

This archive was generated by hypermail 2.1.8 : 2010-04-23 13:30:02 CEST