Re: [cc65] automatic generation of makefile dependencies

From: thefox xofeht <thefox1aspekt.fi>
Date: 2011-04-24 17:09:40
On Sun, Apr 24, 2011 at 4:28 PM, Oliver Schmidt <ol.sc@web.de> wrote:
> http://wiki.cc65.org/doku.php?id=cc65:project_setup

Thanks Oliver & silverdr, this is exactly what I needed!

However, I tried adapting the Makefile to my NES project and noticed a
couple of things:

1) I need to link an external library in, but wasn't able to do this
by modifying LDFLAGS (foo.lib needs to come after all the object files
when linking). I fixed this by moving the $(LDFLAGS) to the end of
this line:

$(PROGRAM): $(OBJECTS)
	$(CC) -t $(TARGETS) -o $@ $^ $(LDFLAGS)

2) You might want to add a build option for generating a debug file
(--dbgfile switch for linker). This should do the trick:

# Linker flags for generating a debug file
define _dbgfile_
  LDFLAGS += -Wl --dbgfile,$$@.dbg
  REMOVES += $(PROGRAM).dbg
endef

-thefox
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sun Apr 24 17:09:55 2011

This archive was generated by hypermail 2.1.8 : 2011-04-24 17:09:58 CEST