65X-DOS/config/config.mk

63 lines
1.1 KiB
Makefile
Executable File

SHELL := bash
CC := cc65816
AS := as65816
AR := nlib
LD := ln65816
MP := minipro
.SUFFIXES:
.SUFFIXES: .c .s .o .a
CFLAGS := -I include \
--code-model=large \
--data-model=huge \
--64bit-doubles \
--strong-inline \
--force-switch jump-table
ASFLAGS := -I include \
--code-model=large \
--data-model=huge
MPFLAGS := -p SST39LF040@PLCC32
ifeq ($(RELEASE), "true")
CFLAGS += -DNDEBUG \
-O2 \
--speed
else
CFLAGS += --debug \
-Wall \
-Wextra \
-Wpedantic \
-Werror \
-Wno-c11-extensions \
-Wno-gnu-binary-literal \
-Wno-gnu-conditional-omitted-operand \
-Wno-gnu-case-range \
-Wimplicit-fallthrough \
-Wno-gnu-folding-constant
ASFLAGS += --debug
endif
LDFLAGS := --rtattr cstartup=sentinel65x \
--verbose \
--rom-code \
--initialize-large-data \
--copy-initialize huge \
--output-format raw
ifeq ($(ENABLE_RELEASE_BUILD), "true")
CFLAGS += -DRELEASE_BUILD
CFLAGS += -DNDEBUG
else
CFLAGS += -DDEBUG
endif
%.o: %.c
@echo "Compiling $@..."
@$(CC) -c $(CFLAGS) -o $@ $<
%.o: %.s
@echo "Assembling $@..."
@$(AS) $(ASFLAGS) -o $@ $<