From 76aea6ac69297f148b8d39e4af6f263722dc429b Mon Sep 17 00:00:00 2001 From: Pedro Date: Sat, 27 Feb 2016 17:44:42 +0100 Subject: [PATCH] implement clang compatibility --- .travis.yml | 1 + Makefile | 11 +++++------ example/Makefile | 5 ++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index d69e00d..d9e0929 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,7 @@ install: compiler: - gcc + - clang script: - make diff --git a/Makefile b/Makefile index 7b55b72..0aad8f8 100644 --- a/Makefile +++ b/Makefile @@ -13,24 +13,23 @@ ALLLIB = $(shell find $(SRC) -name '*.cpp' -not -path "$(SRCPARSER)/*") $(s ALLTEST = $(shell find test/lib/ -name '*.cpp') $(shell find test/lib/ -name '*.h') # compile & link flages -CC = g++ CFLAGS = -std=c++11 -Wall -fPIC LIBFLAGS = -shared TARGET = libsqlparser.so INSTALL = /usr/local -CTESTFLAGS = -Wall -Isrc/ -Itest/ -L./ -std=c++11 +CTESTFLAGS = -Wall -Isrc/ -Itest/ -L./ -std=c++11 -lstdc++ all: library library: $(TARGET) $(TARGET): $(LIBOBJ) - $(CC) $(LIBFLAGS) -o $(TARGET) $(LIBOBJ) + $(CXX) $(LIBFLAGS) -o $(TARGET) $(LIBOBJ) %.o: %.cpp $(PARSERFILES) - $(CC) $(CFLAGS) -c -o $@ $< + $(CXX) $(CFLAGS) -c -o $@ $< $(SRCPARSER)/bison_parser.cpp: parser $(SRCPARSER)/flex_lexer.cpp: parser @@ -69,8 +68,8 @@ test_install: $(BIN)/sql_tests: library @mkdir -p $(BIN)/ - $(CC) $(CTESTFLAGS) $(TESTCPP) test/sql_tests.cpp -o $(BIN)/sql_tests -lsqlparser + $(CXX) $(CTESTFLAGS) $(TESTCPP) test/sql_tests.cpp -o $(BIN)/sql_tests -lsqlparser $(BIN)/sql_grammar_test: library @mkdir -p $(BIN)/ - $(CC) $(CTESTFLAGS) test/sql_grammar_test.cpp -o $(BIN)/sql_grammar_test -lsqlparser + $(CXX) $(CTESTFLAGS) test/sql_grammar_test.cpp -o $(BIN)/sql_grammar_test -lsqlparser diff --git a/example/Makefile b/example/Makefile index 6957afc..18a3f54 100644 --- a/example/Makefile +++ b/example/Makefile @@ -1,7 +1,6 @@ -CC = g++ -CFLAGS = -std=c++11 -Wall -I../src/ -L../ +CFLAGS = -std=c++11 -lstdc++ -Wall -I../src/ -L../ all: - $(CC) $(CFLAGS) example.cpp -o example -lsqlparser + $(CXX) $(CFLAGS) example.cpp -o example -lsqlparser