summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@hadrons.org>2010-01-31 14:13:24 +0100
committerGuillem Jover <guillem@hadrons.org>2010-01-31 14:13:24 +0100
commit06a60a166ab19000b024dc1f70880278c09d8bc3 (patch)
tree701c7f8748f52f364331f004d280182033d86799
parent51863b6cf92883b6f2d58aa764b107e15d834b6f (diff)
build: Use proper user variables during build
To compile we need to use CPPFLAGS and CFLAGS, to link CFLAGS and LDFLAGS. Rename MK_CFLAGS to MK_CPPFLAGS as those are only relevant at compilation time. Reported-by: Eric Smith <eric@brouhaha.com>
-rw-r--r--Makefile13
1 files changed, 9 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index e9dda45..da3780a 100644
--- a/Makefile
+++ b/Makefile
@@ -104,13 +104,18 @@ AR = ar
CC = gcc
CCLD = $(CC)
-# Set default value for compilation
+# Set default values for user variables
+CPPFLAGS ?=
CFLAGS ?= -g -Wall -Wextra -Wno-unused-variable
+LDFLAGS ?=
-MK_CFLAGS := -Iinclude/ -include bsd/bsd.h -D_GNU_SOURCE -D__REENTRANT
+# Internal makefile variables
+MK_CPPFLAGS := -Iinclude/ -include bsd/bsd.h -D_GNU_SOURCE -D__REENTRANT
+MK_CFLAGS :=
+MK_LDFLAGS :=
-COMPILE = $(CC) $(MK_CFLAGS) $(CFLAGS)
-LINK = $(CCLD)
+COMPILE = $(CC) $(MK_CPPFLAGS) $(CPPFLAGS) $(MK_CFLAGS) $(CFLAGS)
+LINK = $(CCLD) $(MK_CFLAGS) $(CFLAGS) $(MK_LDFLAGS) $(LDFLAGS)
prefix = /usr
exec_prefix =