summaryrefslogtreecommitdiffstats
path: root/rules.mk
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2016-06-19 20:53:35 -0400
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2016-06-21 14:03:54 -0400
commitc034d2d366aed74662fcde471bd20b39a55aca0e (patch)
treed3ba932c347bc72bff0fe1b1ac4b3855fde4cef5 /rules.mk
parentcbe32133dadf0945357e2bec67aa7a86ae9f0295 (diff)
downloadtalos-skeleton-c034d2d366aed74662fcde471bd20b39a55aca0e.tar.gz
talos-skeleton-c034d2d366aed74662fcde471bd20b39a55aca0e.zip
Enable user-overriable CFLAGS
Put required CFLAGS (ie pkg-config --cflags) in ALL_CFLAGS and append user specified CFLAGS to that. Use CFLAGS during link. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'rules.mk')
-rw-r--r--rules.mk6
1 files changed, 3 insertions, 3 deletions
diff --git a/rules.mk b/rules.mk
index 9cad8cf..758e9f2 100644
--- a/rules.mk
+++ b/rules.mk
@@ -5,7 +5,7 @@ sbindir=/usr/sbin
libdir=/usr/lib
LDLIBS+=$(shell pkg-config --libs $(PACKAGE_DEPS))
-CFLAGS+=$(shell pkg-config --cflags $(PACKAGE_DEPS)) -Werror
+ALL_CFLAGS+=$(shell pkg-config --cflags $(PACKAGE_DEPS)) -fPIC -Werror $(CFLAGS)
INSTALLDEPS?=install-bins
BIN_SUFFIX?=.exe
@@ -14,10 +14,10 @@ DEFAULT_ALL?=$(BINS)
all: $(DEFAULT_ALL)
%.o: %.c
- $(CC) -c $(CFLAGS) -fPIC -o $@ $<
+ $(CC) -c $(ALL_CFLAGS) -o $@ $<
$(BINS): %: %.o $(EXTRA_OBJS)
- $(CC) $(LDFLAGS) -o $@$(BIN_SUFFIX) $^ $(LDLIBS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@$(BIN_SUFFIX) $^ $(LDLIBS)
install-bins:
@mkdir -p $(DESTDIR)$(sbindir)
OpenPOWER on IntegriCloud