Fix up Makefiles, and fix include issues compiling with gcc

dev
Nick Terrell 2016-09-01 18:26:19 -07:00
parent b1a3ab1804
commit 7df55e17e9
5 changed files with 13 additions and 13 deletions

View File

@ -11,12 +11,10 @@ ZSTDDIR = ../../lib
PROGDIR = ../../programs PROGDIR = ../../programs
CPPFLAGS = -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/dictBuilder -I$(PROGDIR) -I. CPPFLAGS = -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/dictBuilder -I$(PROGDIR) -I.
CFLAGS ?= -O3 CXXFLAGS ?= -O3
CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wstrict-aliasing=1 \ CXXFLAGS += -std=c++11
-Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes -Wundef \ CXXFLAGS += $(MOREFLAGS)
-std=c++11 FLAGS = $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS)
CFLAGS += $(MOREFLAGS)
FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
ZSTDCOMMON_FILES := $(ZSTDDIR)/common/*.c ZSTDCOMMON_FILES := $(ZSTDDIR)/common/*.c

View File

@ -9,6 +9,7 @@
#include "Options.h" #include "Options.h"
#include <cstdio> #include <cstdio>
#include <cstring>
namespace pzstd { namespace pzstd {

View File

@ -24,10 +24,10 @@ GTEST_LIB ?= -L $(PZSTDDIR)/googletest/build/googlemock/gtest
CPPFLAGS = -I$(PZSTDDIR) $(GTEST_INC) $(GTEST_LIB) -I$(ZSTDDIR)/common -I$(PROGDIR) CPPFLAGS = -I$(PZSTDDIR) $(GTEST_INC) $(GTEST_LIB) -I$(ZSTDDIR)/common -I$(PROGDIR)
CFLAGS ?= -O3 CXXFLAGS ?= -O3
CFLAGS += -std=c++11 CXXFLAGS += -std=c++11
CFLAGS += $(MOREFLAGS) CXXFLAGS += $(MOREFLAGS)
FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) FLAGS = $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS)
datagen.o: $(PROGDIR)/datagen.* datagen.o: $(PROGDIR)/datagen.*
$(CXX) $(FLAGS) $(PROGDIR)/datagen.c -c -o $@ $(CXX) $(FLAGS) $(PROGDIR)/datagen.c -c -o $@

View File

@ -16,6 +16,7 @@
#include "utils/Likely.h" #include "utils/Likely.h"
#include <cstddef> #include <cstddef>
#include <cstring>
#include <stdexcept> #include <stdexcept>
#include <string> #include <string>
#include <type_traits> #include <type_traits>

View File

@ -21,10 +21,10 @@ GTEST_INC ?= -isystem $(PZSTDDIR)/googletest/googletest/include
GTEST_LIB ?= -L $(PZSTDDIR)/googletest/build/googlemock/gtest GTEST_LIB ?= -L $(PZSTDDIR)/googletest/build/googlemock/gtest
CPPFLAGS = -I$(PZSTDDIR) $(GTEST_INC) $(GTEST_LIB) CPPFLAGS = -I$(PZSTDDIR) $(GTEST_INC) $(GTEST_LIB)
CFLAGS ?= -O3 CXXFLAGS ?= -O3
CFLAGS += -std=c++11 CXXFLAGS += -std=c++11
CFLAGS += $(MOREFLAGS) CFLAGS += $(MOREFLAGS)
FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) FLAGS = $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS)
%: %.cpp %: %.cpp
$(CXX) $(FLAGS) -lgtest -lgtest_main $^ -o $@$(EXT) $(CXX) $(FLAGS) -lgtest -lgtest_main $^ -o $@$(EXT)