Re: [cc65] Please critique this makefile

From: Oliver Schmidt <ol.sc1web.de>
Date: 2010-04-24 16:21:35
Hi,

> My current "universal" Makefile is at:
>
> http://zennon.internetdsl.pl/Makefile

Some remarks:

1.

ifeq ($(MYVAR),)

is actually equivalent to

ifndef MYVAR

which is easier to read/understand:
http://www.gnu.org/software/make/manual/make.html#Conditional-Syntax

2.

Your new target 'love' should be added to the dependency list of .PHONY

.PHONY: all clean love

3.

basename is not the list of utilities a Makefile is supposed to depend on:
http://www.gnu.org/software/make/manual/make.html#Utilities-in-Makefiles

So your line
PROGRAM := $(shell basename $(CURDIR))
turns the Makefile much less portable.

In general there's a broad tendency of Makefile authors who know shell
programming well to write Makefiles as pseudo shell scripts,
especially when it comes to do something many times you see shell
for-loops. Beside many issues this basically disables GNU make's
parallel processing capabilities...

This line is way simpler (and by the way faster)
PROGRAM := $(notdir $(CURDIR))

Regards,
Oliver
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sat Apr 24 16:22:08 2010

This archive was generated by hypermail 2.1.8 : 2010-04-24 16:22:10 CEST