ifeq ($(CUSTOM_PROJECT),)
CUSTOM_PROJECT=True

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

CUSTOM_BASE_DIR := $(BASE_DIR)

BASE_DIR=$(CUSTOM_BASE_DIR)/../gtkada
include $(BASE_DIR)/Makefile.gtkada
BASE_DIR=$(CUSTOM_BASE_DIR)/../kernel
include $(BASE_DIR)/Makefile.kernel
BASE_DIR=$(CUSTOM_BASE_DIR)/../gvd
include $(BASE_DIR)/Makefile.gvd_common
BASE_DIR=$(CUSTOM_BASE_DIR)/../widgets
include $(BASE_DIR)/Makefile.widgets

CUSTOM_SRC_DIRS = $(CUSTOM_BASE_DIR)/src
SRC_DIRS += $(CUSTOM_SRC_DIRS)
C_SRCS = \
  $(foreach name,$(CUSTOM_SRC_DIRS),$(notdir $(wildcard $(name)/*$(C_EXT))))
CUSTOM_SRCS := \
  $(foreach name,$(CUSTOM_SRC_DIRS),$(notdir $(wildcard $(name)/*$(C_EXT))))
CUSTOM_OBJ_DIR = $(CUSTOM_BASE_DIR)/obj
OBJ_DIR = $(CUSTOM_OBJ_DIR)

CFLAGS = -g -O2

PROJECT_FILE = custom

ifneq ($(strip $(CUSTOM_SRCS)),)
   LIBS := $(CUSTOM_OBJ_DIR)/libcustom$(AR_EXT) $(LIBS)
endif

ifeq ($(CUSTOM_ROOT),True)
   include ../builder/src/Makefile.generic
else
   DEPS_PROJECTS += $(CUSTOM_BASE_DIR)/custom
endif

endif
