sim65 \
sp65
-CA65_INC := $(abspath ../asminc)
-CC65_INC := $(abspath ../include)
-LD65_LIB := $(abspath ../lib)
-LD65_OBJ := $(abspath ../lib)
-LD65_CFG := $(abspath ../cfg)
+ifdef prefix
+ CA65_INC = $(prefix)/lib/cc65/asminc
+ CC65_INC = $(prefix)/lib/cc65/include
+ LD65_LIB = $(prefix)/lib/cc65/lib
+ LD65_OBJ = $(prefix)/lib/cc65/lib
+ LD65_CFG = $(prefix)/lib/cc65/cfg
+else
+ CA65_INC := $(abspath ../asminc)
+ CC65_INC := $(abspath ../include)
+ LD65_LIB := $(abspath ../lib)
+ LD65_OBJ := $(abspath ../lib)
+ LD65_CFG := $(abspath ../cfg)
+endif
CFLAGS += -MMD -MP -O -std=c89 -I common \
-Wall -Wextra -Wno-char-subscripts -Werror \