From c5d1abb69479212b17029fe2272b46c2b76b4345 Mon Sep 17 00:00:00 2001 From: "Helmut K. C. Tessarek" Date: Fri, 14 Apr 2017 02:54:57 -0400 Subject: [PATCH 1/2] -c does not belong in CFLAGS, should always be explicitly set in the compile command --- src/makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/makefile b/src/makefile index 25ad417..0ed65ee 100644 --- a/src/makefile +++ b/src/makefile @@ -6,7 +6,7 @@ CC=g++ # Added -std=c++11 because of auto_ptr to unique_ptr transition -CFLAGS= -c -Wall -O2 -DNDEBUG -std=c++11 +CFLAGS= -Wall -O2 -DNDEBUG -std=c++11 LDFLAGS= @@ -23,7 +23,7 @@ $(EXECUTABLE): $(OBJECTS) $(CC) $(LDFLAGS) $(OBJECTS) -o $@ .cpp.o: - $(CC) $(CFLAGS) $< -o $@ + $(CC) -c $(CFLAGS) $< -o $@ clean: @rm -f *.o From e9d83e3cdf61ef5c816c3199bc9eb63c374f09ca Mon Sep 17 00:00:00 2001 From: "Helmut K. C. Tessarek" Date: Fri, 14 Apr 2017 02:57:36 -0400 Subject: [PATCH 2/2] add CXXFLAGS and EXTRA_LDFLAGS external build systems might want to add additional flags, but CXXFLAGS is missing. EXTRA_LDFLAGS is also often used to add extra LDFLAGS. --- src/makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/makefile b/src/makefile index 0ed65ee..982789e 100644 --- a/src/makefile +++ b/src/makefile @@ -20,10 +20,10 @@ EXECUTABLE=ansifilter all: $(SOURCES) $(EXECUTABLE) $(EXECUTABLE): $(OBJECTS) - $(CC) $(LDFLAGS) $(OBJECTS) -o $@ + $(CC) $(LDFLAGS) $(EXTRA_LDFLAGS) $(OBJECTS) -o $@ .cpp.o: - $(CC) -c $(CFLAGS) $< -o $@ + $(CC) -c $(CFLAGS) $(CXXFLAGS) $< -o $@ clean: @rm -f *.o