From: Oliver Schmidt
Date: Fri, 7 Jun 2013 21:13:46 +0000 (+0200)
Subject: Added support for 'prefix'.
X-Git-Tag: V2.15~268
X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=32daa3dd2b004759e379e296ff00478c934992e4;p=cc65
Added support for 'prefix'.
If the variable 'prefix' is defined then the builtin search paths are set to
$(prefix)/lib/cc65/... allowing to build binaries intended for installation.
Note that the library build still works with these binaries as it generally
overrides the builtin search paths by setting the CC65_HOME env var.
---
diff --git a/src/Makefile b/src/Makefile
index 8c4c6861e..3d0463147 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -12,11 +12,19 @@ PROGS = ar65 \
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 \