Files
65c02-template/Makefile
T
RuiFPB 3801459e1e Overhaul the template.
- DATA and RODATA segments added to computer.cfg
 - RAM memory configuration now starts at  to not overwrite the cpu stack
 - hardware.inc added to handle hardware related constants
 - constants removed from via.s
 - constants removed from serial.s
 - serial_delay from serial.s is now dynamic, dependant on CPU_HZ and baud rate
 - serial_baud_* functions added to setup 19200 and 9600 baud
 - mem_copy.s added. data copy functions are to be implemented here
 - copy_data (mem_copy.s) implemented to copy the DATA segment from ROM to RAM
 - propper system setup in main.s
 - Makefile now generates a .map file with the memory map information
2026-09-29 12:14:05 +01:00

29 lines
728 B
Makefile

OUTPUT := example.bin
TARGET_CPU := 65c02
MEM_MAP_FILE := $(OUTPUT:.bin=.map)
# Tool list
CC65 := cc65
CA65 := ca65
LD65 := ld65
CL65 := cl65
# Searches directly under src and one level under. If a file is under 2 folders
#such as src/math/float/types.s, either one more level needs to be added, or
#switch these to a shell find $(shell find src -name '*.s')
C_SOURCES := $(wildcard src/*.c) $(wildcard src/*/*.s)
ASM_SOURCES := $(wildcard src/*.s) $(wildcard src/*/*.s)
OBJECTS := $(ASM_SOURCES:.s=.o)
.PHONY: all clean
all: $(OUTPUT)
$(OUTPUT): $(C_SOURCES) $(ASM_SOURCES)
@mkdir -p $(dir $@)
$(CL65) -t none --cpu $(TARGET_CPU) -C computer.cfg -m $(MEM_MAP_FILE) -O -o $@ $^
clean:
rm -f $(OBJECTS)
rm -f $(OUTPUT)