ifeq ($(WIDGETS_PROJECT),)
WIDGETS_PROJECT=True

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

WIDGETS_BASE_DIR := $(BASE_DIR)

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

WIDGETS_SRC_DIRS = $(WIDGETS_BASE_DIR)/src $(WIDGETS_BASE_DIR)/cschtml
SRC_DIRS += $(WIDGETS_SRC_DIRS)
C_SRCS = \
  $(foreach name,$(WIDGETS_SRC_DIRS),$(notdir $(wildcard $(name)/*$(C_EXT))))
WIDGETS_OBJ_DIR = $(WIDGETS_BASE_DIR)/obj
OBJ_DIR = $(WIDGETS_OBJ_DIR)

CFLAGS = -g -O2 @DEFS@

PROJECT_FILE = widgets
LIBS := $(WIDGETS_OBJ_DIR)/libwidgets$(AR_EXT) $(LIBS)

ifeq ($(WIDGETS_ROOT),True)
   include ../builder/src/Makefile.generic
else
   DEPS_PROJECTS += $(WIDGETS_BASE_DIR)/widgets
endif

endif
