ifeq ($(KERNEL_PROJECT),)
KERNEL_PROJECT=True

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

KERNEL_BASE_DIR := $(BASE_DIR)

BASE_DIR=$(KERNEL_BASE_DIR)/../gtkada
include $(BASE_DIR)/Makefile.gtkada
BASE_DIR=$(KERNEL_BASE_DIR)/../common
include $(BASE_DIR)/Makefile.common
BASE_DIR=$(KERNEL_BASE_DIR)/../widgets
include $(BASE_DIR)/Makefile.widgets
BASE_DIR=$(KERNEL_BASE_DIR)/../gvd
include $(BASE_DIR)/Makefile.gvd
BASE_DIR=$(KERNEL_BASE_DIR)/src_info/sn
include $(BASE_DIR)/Makefile.sn

KERNEL_SRC_DIRS = $(KERNEL_BASE_DIR)/src $(KERNEL_BASE_DIR)/src_info
SRC_DIRS += $(KERNEL_SRC_DIRS)
C_SRCS = \
  $(foreach name,$(KERNEL_SRC_DIRS),$(notdir $(wildcard $(name)/*$(C_EXT))))
KERNEL_SRCS := \
  $(foreach name,$(KERNEL_SRC_DIRS),$(notdir $(wildcard $(name)/*$(C_EXT))))
KERNEL_OBJ_DIR = $(KERNEL_BASE_DIR)/obj
OBJ_DIR = $(KERNEL_OBJ_DIR)

CFLAGS = -g -O2

PROJECT_FILE = kernel

ifneq ($(strip $(KERNEL_SRCS)),)
   LIBS := $(KERNEL_OBJ_DIR)/libkernel$(AR_EXT) $(LIBS)
endif

ifeq ($(KERNEL_ROOT),True)
   include ../builder/src/Makefile.generic
else
   DEPS_PROJECTS += $(KERNEL_BASE_DIR)/kernel
endif

endif
