ifeq ($(DOCGEN_PROJECT),)
DOCGEN_PROJECT=True

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

DOCGEN_BASE_DIR := $(BASE_DIR)

BASE_DIR=$(DOCGEN_BASE_DIR)/../kernel
include $(BASE_DIR)/Makefile.kernel

DOCGEN_SRC_DIRS = $(DOCGEN_BASE_DIR)/src
SRC_DIRS += $(DOCGEN_SRC_DIRS)
C_SRCS = \
  $(foreach name,$(DOCGEN_SRC_DIRS),$(notdir $(wildcard $(name)/*$(C_EXT))))
DOCGEN_SRCS := \
  $(foreach name,$(DOCGEN_SRC_DIRS),$(notdir $(wildcard $(name)/*$(C_EXT))))
DOCGEN_OBJ_DIR = $(DOCGEN_BASE_DIR)/obj
OBJ_DIR = $(DOCGEN_OBJ_DIR)

CFLAGS = -g -O2

PROJECT_FILE = docgen

ifneq ($(strip $(DOCGEN_SRCS)),)
   LIBS := $(DOCGEN_OBJ_DIR)/libdocgen$(AR_EXT) $(LIBS)
endif

ifeq ($(DOCGEN_ROOT),True)
   include ../builder/src/Makefile.generic
else
   DEPS_PROJECTS += $(DOCGEN_BASE_DIR)/docgen
endif

endif
