
Every test/makefile have the following targets: cleantests - clean local and subdirectories' tests buildtests - build all local and subdirectories' tests runtests - run all local tests testall - clean, build and run local and subdirectories' tests Tests for directory random_dir are always in its subdirectory, in this case in random_dir/test . If random_dir has subdirectories with tests, random_dir/child_dir, for example, tests of child_dir can be started from random_dir/test/makefile where make -C child_dir/test <test target> is called. See MAXSCALE_HOME/test/README for further information.
73 lines
1.4 KiB
Makefile
73 lines
1.4 KiB
Makefile
include ../build_gateway.inc
|
|
include ../makefile.inc
|
|
|
|
CC = gcc
|
|
CPP = g++
|
|
|
|
SRCS := query_classifier.cc
|
|
UTILS_PATH := $(ROOT_PATH)/utils
|
|
QUERY_CLASSIFIER_PATH := $(ROOT_PATH)/query_classifier
|
|
LOG_MANAGER_PATH := $(ROOT_PATH)/log_manager
|
|
|
|
makeall: clean all
|
|
|
|
clean:
|
|
$(MAKE) -C $(UTILS_PATH) clean
|
|
- $(DEL) query_classifier.o
|
|
- $(DEL) libquery_classifier.so
|
|
- $(DEL) libquery_classifier.so.1.0.1
|
|
- $(DEL) *~
|
|
- $(DEL) depend
|
|
|
|
all: utils lib
|
|
|
|
cleantests:
|
|
$(MAKE) -C test cleantests
|
|
|
|
buildtests:
|
|
$(MAKE) -C test DEBUG=Y DYNLIB=Y buildtests
|
|
|
|
runtests:
|
|
$(MAKE) -C test runtests
|
|
|
|
testall:
|
|
$(MAKE) -C test testall
|
|
|
|
|
|
utils:
|
|
$(MAKE) -C $(UTILS_PATH) clean all
|
|
|
|
lib: libcomp liblink
|
|
|
|
libcomp:
|
|
$(CPP) -c $(CFLAGS) \
|
|
$(MYSQL_HEADERS) \
|
|
-I$(LOG_MANAGER_PATH) \
|
|
-I./ \
|
|
-fPIC ./query_classifier.cc -o query_classifier.o
|
|
|
|
liblink:
|
|
$(CPP) -shared \
|
|
-L$(EMBEDDED_LIB) \
|
|
-Wl,-soname,libquery_classifier.so \
|
|
-Wl,-rpath,$(DEST)/lib \
|
|
-Wl,-rpath,$(EMBEDDED_LIB) \
|
|
-o libquery_classifier.so.1.0.1 ./query_classifier.o \
|
|
$(LDLIBS) $(LDMYSQL) $(CPP_LDLIBS)
|
|
$(DEL) ./libquery_classifier.so
|
|
$(LINK) ./libquery_classifier.so.1.0.1 ./libquery_classifier.so
|
|
|
|
|
|
install: liblink
|
|
install ./libquery_classifier.so.1.0.1 ./libquery_classifier.so $(DEST)/lib
|
|
|
|
depend:
|
|
@rm -f depend
|
|
$(CPP) -M $(CFLAGS) \
|
|
$(MYSQL_HEADERS) \
|
|
-I$(LOG_MANAGER_PATH) \
|
|
-I./ \
|
|
$(SRCS) > depend
|
|
|
|
include depend
|