73 lines
1.5 KiB
Makefile
73 lines
1.5 KiB
Makefile
SHELL := bash
|
|
CC := cc65816
|
|
AS := as65816
|
|
AR := nlib
|
|
LD := ln65816
|
|
|
|
.SUFFIXES:
|
|
.SUFFIXES: .c .s .o .a
|
|
|
|
MEMORY_MAP := config/memory.scm
|
|
|
|
CFLAGS := --include-system=include/libc \
|
|
-I include \
|
|
--code-model=small \
|
|
--data-model=small \
|
|
--64bit-doubles \
|
|
--strong-inline \
|
|
--force-switch jump-table
|
|
|
|
ASFLAGS := -I include \
|
|
--code-model=small \
|
|
--data-model=small
|
|
|
|
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 := $(MEMORY_MAP) \
|
|
--list-file build.lst \
|
|
--rom-code \
|
|
--output-format raw \
|
|
--raw-multiple-memories \
|
|
--verbose \
|
|
--cstartup=sentinel65x
|
|
|
|
ifeq ($(ENABLE_RELEASE_BUILD), "true")
|
|
CFLAGS += -DRELEASE_BUILD
|
|
CFLAGS += -DNDEBUG
|
|
else
|
|
CFLAGS += -DDEBUG
|
|
endif
|
|
|
|
LIBS := build/libc.a
|
|
|
|
KERNEL_SRC_C := $(wildcard src/*.c) \
|
|
$(wildcard src/*/*.c) \
|
|
$(wildcard src/*/*/*.c) \
|
|
$(wildcard src/*/*/*/*.c) \
|
|
$(wildcard src/*/*/*/*/*.c)
|
|
KERNEL_SRC_S := $(wildcard src/*.s) \
|
|
$(wildcard src/*/*.s) \
|
|
$(wildcard src/*/*/*.s) \
|
|
$(wildcard src/*/*/*/*.s) \
|
|
$(wildcard src/*/*/*/*/*.s)
|
|
KERNEL_OBJ := $(KERNEL_SRC_C:.c=.o) \
|
|
$(KERNEL_SRC_S:.s=.o)
|
|
KERNEL_DEP := $(KERNEL_SRC_C:.c=.d)
|