summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorOxore <oxore@protonmail.com>2018-12-06 06:07:45 +0300
committerOxore <oxore@protonmail.com>2018-12-06 06:07:45 +0300
commit80325e9dfaece1316fa5cdc2b0551280369c4f7d (patch)
tree422cedea361c27146bede7fe7431589f34615bf6 /Makefile
parent0813c5e414de517ff0fef6cc9eedcb4d512f4fe8 (diff)
Wrap PREFIX with conditions in Makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile4
1 files changed, 4 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 41b61b6..02b129b 100644
--- a/Makefile
+++ b/Makefile
@@ -16,7 +16,9 @@ SOURCES:=$(wildcard $(SRC)/*.c)
OBJECTS:=$(SOURCES:$(SRC)/%.c=$(BUILD)/%.c.o)
DEPENDS:=$(OBJECTS:.o=.d)
+ifdef PREFIX
INCLUDE+=$(PREFIX)/include
+endif
INCLUDE+=include
INCLUDE+=$(MUNIT)
INCLUDE:=$(INCLUDE:%=-I%)
@@ -35,8 +37,10 @@ CFLAGS+=-g3
CFLAGS+=-O0
CFLAGS+=-MD
+ifdef PREFIX
LDFLAGS+=-L$(PREFIX)/lib
LDFLAGS+=-Wl,-rpath=$(PREFIX)/lib
+endif
LDFLAGS+=$(COMMON)
LDFLAGS_TETRIS+=$(LDFLAGS)