# Common settings

ifndef PORTS
PORTS = sm83 z80 mos6502
endif
ifndef PLATFORMS
PLATFORMS = gb ap duck gg sms msxdos nes
endif

ifndef SDCCLIB
SDCCLIB = $(SDCCDIR)
endif

SCC = 	$(SDCCLIB)/bin/sdcc
GBCC = 	$(SDCCLIB)/bin/lcc
SDAR = 	$(subst \,/,'$(SDCCLIB)')/bin/sdar


AS_Z80 = $(SDCCLIB)/bin/sdasz80
AS_SM83 = $(SDCCLIB)/bin/sdasgb
AS_6500 = $(SDCCLIB)/bin/sdas6500

CLEANSPEC = *.o *.cdb *.sym *.lst *~ *.asm

CFLAGS = -I$(TOPDIR)/include -D__PORT_$(PORT) -D__TARGET_$(THIS)
CFLAGS += -m$(PORT)
CFLAGS += --max-allocs-per-node 50000
CFLAGS += --fsigned-char
CC = 	$(SCC)
BUILD = $(TOPDIR)/build/$(THIS)
LIB = 	$(BUILD)/$(THIS).lib

OBJ = $(CSRC:%.c=$(BUILD)/%.o) $(ASSRC:%.s=$(BUILD)/%.o)
