65X-DOS/config/config.mk

75 lines
1.3 KiB
Makefile
Raw Permalink 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
2024-07-12 08:55:55 +02:00
ASFLAGS := -I . \
-I include \
2024-07-07 17:37:04 +02:00
--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 \
2024-07-16 01:26:07 +02:00
-Wno-gnu-folding-constant \
-Wno-unused-parameter \
-Wno-unused-variable
2024-07-07 17:37:04 +02:00
ASFLAGS += --debug
endif
2024-07-08 05:35:11 +02:00
LDFLAGS := --rtattr cstartup=sentinel65x \
2024-07-07 17:37:04 +02:00
--verbose \
2024-07-12 04:34:27 +02:00
--rom-code \
--initialize-large-data \
--copy-initialize huge \
2024-07-07 17:37:04 +02:00
--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 $@..."
2024-07-12 08:55:55 +02:00
@$(AS) $(ASFLAGS) -o $@ $<
.SUFFIXES: .png .fnt .ase
2024-07-12 08:55:55 +02:00
%.png: %.ase
aseprite -b $< -save-as $@
%.fnt: %.png
2024-07-12 08:55:55 +02:00
bin/makechrom -f $<
mv $<.bin $@