User Tools

Site Tools


base:makefile_to_use_with_ca65_vice

Simple Makefile for ca65 projects, that puts compiled binary to .d64 files, and also shows the directory. Variation of this is used in practically all of my modern C64 projects.

“make run” also passes labels to VICE monitor for easier debugging.

Tested on Ubuntu & MorphOS.

CPU = 6502
C1541 = c1541
# Also pass symbols to VICE monitor
X64 = x64 -moncommands symbols
OUTPUT = "diskcontents/myprg.prg"

DISKFILENAME = my.d64
DISKNAME = myprg
ID = 17

AS = ca65
# Add defines, if needed (-DWHATEVER)
ASFLAGS = -g --cpu $(CPU) --include-dir src/

LD = ld65
#Define segments & files in config.cfg
LDFLAGS = -m labels.txt -Ln symbols -o $(OUTPUT) -C config.cfg

OBJS = \
	src/main.o \
	src/irq.o

all: d64

myprg: $(OBJS)
	$(LD) $(LDFLAGS) $(OBJS)

d64: myprg
	$(C1541) -format $(DISKNAME),$(ID) d64 $(DISKFILENAME)
	$(C1541) -attach $(DISKFILENAME) -write $(OUTPUT)
	$(C1541) -attach $(DISKFILENAME) -list

run: d64
	$(X64) $(DISKFILENAME)

clean:
	rm -f src/*.o diskcontents/* labels.txt symbols $(DISKFILENAME)
base/makefile_to_use_with_ca65_vice.txt · Last modified: 2017-07-28 18:40 by jupp3