[cc65] Universal Makefile: Some advanced magic wanted?

From: Oliver Schmidt <ol.sc1web.de>
Date: 2010-05-03 10:45:02
Hi,

Now that the basics are carved out we could bring in some advanced GNU
Make stuff - like an abstraction layer for toolchain cmdline options:

Call the Makefile below i.e. with

make OPTIONS=optspeed,mapfile

The two primary benefits are:
- Users don't have to deal with more or less cryptic compiler/linker flags
- Users can use the same "high level options" for different toolchains

Regards,
Oliver

-----------------------------------------------

define _optspeed_
  CFLAGS += -Oris
endef

define _optsize_
  CFLAGS += -Or
endef

define _mapfile_
  LDFLAGS += -m $@.map
  REMOVES += $(PROGRAM).map
endef

COMMA := ,
SPACE := $(N/A) $(N/A)
$(foreach o,$(subst $(COMMA),$(SPACE),$(OPTIONS)),$(eval $(_$o_)))

$(info CFLAGS =$(CFLAGS))
$(info LDFLAGS=$(LDFLAGS))
$(info REMOVES=$(REMOVES))
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon May 3 10:45:07 2010

This archive was generated by hypermail 2.1.8 : 2010-05-03 10:45:10 CEST