From 4e38dcab448f054d82a346e3c9d21ac78516a416 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 15 May 2015 12:01:48 -0700 Subject: [PATCH] Support command-line override of CFLAGS Most of the CFLAGS options can reasonably be changed at will, but a few are necessary. Move those few into HOEDOWN_CFLAGS, so the rest can be overridden, e.g. by distro policy. --- Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 497b67ce..e77613a3 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,9 @@ -CFLAGS = -g -O3 -ansi -pedantic -Wall -Wextra -Wno-unused-parameter -Isrc +CFLAGS = -g -O3 -ansi -pedantic -Wall -Wextra -Wno-unused-parameter PREFIX = /usr/local +HOEDOWN_CFLAGS = $(CFLAGS) -Isrc ifneq ($(OS),Windows_NT) - CFLAGS += -fPIC + HOEDOWN_CFLAGS += -fPIC endif HOEDOWN_SRC=\ @@ -77,7 +78,7 @@ install: # Generic object compilations %.o: %.c - $(CC) $(CFLAGS) -c -o $@ $< + $(CC) $(HOEDOWN_CFLAGS) -c -o $@ $< src/html_blocks.o: src/html_blocks.c - $(CC) $(CFLAGS) -Wno-static-in-inline -c -o $@ $< + $(CC) $(HOEDOWN_CFLAGS) -Wno-static-in-inline -c -o $@ $<