65X-DOS/config/config.mk

60 lines
1.0 KiB
Makefile
Raw Normal View History

2024-07-07 17:37:04 +02:00
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
2024-07-08 05:35:11 +02:00
LDFLAGS := --rtattr cstartup=sentinel65x \
2024-07-07 17:37:04 +02:00
--verbose \
--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 $@ $<