ifeq ($(COMMON_PROJECT),)
COMMON_PROJECT=True

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

COMMON_BASE_DIR := $(BASE_DIR)

BASE_DIR=$(COMMON_BASE_DIR)/../gvd
include $(BASE_DIR)/Makefile.gvd_common
BASE_DIR=$(COMMON_BASE_DIR)/../gtkada
include $(BASE_DIR)/Makefile.gtkada

COMMON_SRC_DIRS = $(COMMON_BASE_DIR)/src
SRC_DIRS += $(COMMON_SRC_DIRS)
C_SRCS = \
  $(foreach name,$(COMMON_SRC_DIRS),$(notdir $(wildcard $(name)/*$(C_EXT))))
COMMON_SRCS := \
  $(foreach name,$(COMMON_SRC_DIRS),$(notdir $(wildcard $(name)/*$(C_EXT))))
COMMON_OBJ_DIR = $(COMMON_BASE_DIR)/obj
OBJ_DIR = $(COMMON_OBJ_DIR)

CFLAGS = -g -O2

PROJECT_FILE = common

ifneq ($(strip $(COMMON_SRCS)),)
   LIBS := $(COMMON_OBJ_DIR)/libcommon$(AR_EXT) $(LIBS)
endif

ifeq ($(COMMON_ROOT),True)
   include ../builder/src/Makefile.generic
else
   DEPS_PROJECTS += $(COMMON_BASE_DIR)/common
endif

endif
