ifeq ($(VSEARCH_TESTS_PROJECT),)
VSEARCH_TESTS_PROJECT=True

ifeq ($(BASE_DIR),)
   include ../../Makefile.common
   BASE_DIR=$(shell pwd)
   VSEARCH_TESTS_ROOT=True
endif

VSEARCH_TESTS_BASE_DIR := $(BASE_DIR)

BASE_DIR=$(VSEARCH_TESTS_BASE_DIR)/../../vsearch
include $(BASE_DIR)/Makefile.vsearch
BASE_DIR=$(VSEARCH_TESTS_BASE_DIR)/../../src_editor
include $(BASE_DIR)/Makefile.src_editor
BASE_DIR=$(VSEARCH_TESTS_BASE_DIR)/../../gtkada
include $(BASE_DIR)/Makefile.gtkada

VSEARCH_TESTS_SRC_DIRS = $(VSEARCH_TESTS_BASE_DIR)/src
SRC_DIRS += $(VSEARCH_TESTS_SRC_DIRS)
C_SRCS = \
  $(foreach name,$(VSEARCH_TESTS_SRC_DIRS),$(notdir $(wildcard $(name)/*$(C_EXT))))
VSEARCH_TESTS_SRCS := \
  $(foreach name,$(VSEARCH_TESTS_SRC_DIRS),$(notdir $(wildcard $(name)/*$(C_EXT))))
VSEARCH_TESTS_OBJ_DIR = $(VSEARCH_TESTS_BASE_DIR)/obj
OBJ_DIR = $(VSEARCH_TESTS_OBJ_DIR)

CFLAGS = -g -O2
ADA_SOURCES = run.adb

PROJECT_FILE = vsearch_tests

ifneq ($(strip $(VSEARCH_TESTS_SRCS)),)
   LIBS := $(VSEARCH_TESTS_OBJ_DIR)/libdocgen$(AR_EXT) $(LIBS)
endif

ifeq ($(VSEARCH_TESTS_ROOT),True)
   include ../../builder/src/Makefile.generic
else
   DEPS_PROJECTS += $(VSEARCH_TESTS_BASE_DIR)/vsearch_tests
endif

endif
