ifeq ($(CODEFIX_PROJECT),)
CODEFIX_PROJECT=True

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

CODEFIX_BASE_DIR := $(BASE_DIR)

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


CODEFIX_SRC_DIRS = $(CODEFIX_BASE_DIR)/src
SRC_DIRS += $(CODEFIX_SRC_DIRS)
C_SRCS = \
  $(foreach name,$(CODEFIX_SRC_DIRS),$(notdir $(wildcard $(name)/*$(C_EXT))))
CODEFIX_SRCS := \
  $(foreach name,$(CODEFIX_SRC_DIRS),$(notdir $(wildcard $(name)/*$(C_EXT))))
CODEFIX_OBJ_DIR = $(CODEFIX_BASE_DIR)/obj
OBJ_DIR = $(CODEFIX_OBJ_DIR)

CFLAGS = -g -O2

PROJECT_FILE = codefix
ADA_SOURCES=gnatfix.adb codefix_interface.adb regression.adb

ifneq ($(strip $(CODEFIX_SRCS)),)
   LIBS := $(CODEFIX_OBJ_DIR)/libcodefix$(AR_EXT) $(LIBS)
endif

ifeq ($(CODEFIX_ROOT),True)
   include ../builder/src/Makefile.generic
else
   DEPS_PROJECTS += $(CODEFIX_BASE_DIR)/codefix
endif

endif
