2015-12-23 16:01:08 +01:00
|
|
|
#
|
|
|
|
# make source (build the source code into build/)
|
|
|
|
#
|
|
|
|
# make library
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
2014-12-15 18:32:46 +01:00
|
|
|
|
2015-12-23 16:01:08 +01:00
|
|
|
# directories
|
|
|
|
BIN = bin
|
|
|
|
SRC = src
|
|
|
|
SRCSQL = src/lib/sql
|
|
|
|
SRCPARSER = src/parser
|
2014-12-15 18:32:46 +01:00
|
|
|
|
2015-12-23 16:01:08 +01:00
|
|
|
# files
|
|
|
|
PARSERFILES = $(SRCPARSER)/bison_parser.cpp $(SRCPARSER)/flex_lexer.cpp
|
|
|
|
LIBCPP = $(shell find $(SRC)/ -name '*.cpp' -not -path "$(SRCPARSER)/*") $(SRCPARSER)/bison_parser.cpp $(SRCPARSER)/flex_lexer.cpp
|
|
|
|
LIBOBJ = $(LIBCPP:%.cpp=%.o)
|
|
|
|
LIBHEADERS = $(shell find $(SRCSQL)/ -name '*.h') $(SRC)/SQLParser.h
|
2015-08-28 13:46:07 +02:00
|
|
|
|
2015-12-23 16:01:08 +01:00
|
|
|
# compile & link flages
|
|
|
|
CC = g++
|
|
|
|
CFLAGS = -std=c++11 -Wall -fPIC
|
|
|
|
LIBFLAGS = -shared
|
|
|
|
TARGET = libsqlparser.so
|
2014-12-15 18:32:46 +01:00
|
|
|
|
|
|
|
|
2015-12-23 16:01:08 +01:00
|
|
|
all: library
|
2015-08-28 13:46:07 +02:00
|
|
|
|
|
|
|
|
2015-12-23 16:01:08 +01:00
|
|
|
library: $(LIBOBJ)
|
|
|
|
$(CC) $(LIBFLAGS) -o $(TARGET) $(LIBOBJ)
|
2014-12-15 18:32:46 +01:00
|
|
|
|
|
|
|
|
2015-12-23 16:01:08 +01:00
|
|
|
%.o: %.cpp $(PARSERFILES)
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
$(SRCPARSER)/bison_parser.cpp: parser
|
|
|
|
$(SRCPARSER)/flex_lexer.cpp: parser
|
|
|
|
|
|
|
|
parser:
|
|
|
|
make -C $(SRCPARSER)/
|
|
|
|
|
|
|
|
clean:
|
|
|
|
find $(SRC) -type f -name '*.o' -delete
|
|
|
|
|
|
|
|
cleanparser:
|
|
|
|
make -C $(SRCPARSER)/ clean
|
|
|
|
|
2014-12-18 12:11:26 +01:00
|
|
|
FORCE:
|