##########################################################################
#                                                                        #
#  This file is part of Frama-C.                                         #
#                                                                        #
#  Copyright (C) 2007-2015                                               #
#    CEA (Commissariat à l'énergie atomique et aux énergies              #
#         alternatives)                                                  #
#                                                                        #
#  you can redistribute it and/or modify it under the terms of the GNU   #
#  Lesser General Public License as published by the Free Software       #
#  Foundation, version 2.1.                                              #
#                                                                        #
#  It is distributed in the hope that it will be useful,                 #
#  but WITHOUT ANY WARRANTY; without even the implied warranty of        #
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         #
#  GNU Lesser General Public License for more details.                   #
#                                                                        #
#  See the GNU Lesser General Public License version 2.1                 #
#  for more details (enclosed in the file licenses/LGPLv2.1).            #
#                                                                        #
##########################################################################

ifndef FRAMAC_SHARE
FRAMAC_SHARE  :=$(shell frama-c -journal-disable -print-path)
endif
ifndef FRAMAC_LIBDIR
FRAMAC_LIBDIR :=$(shell frama-c -journal-disable -print-libpath)
endif
PLUGIN_DIR ?=.

PLUGIN_ENABLE:=@ENABLE_OBFUSCATOR@
PLUGIN_DYNAMIC:=@DYNAMIC_OBFUSCATOR@
PLUGIN_NAME:=Obfuscator

PLUGIN_CMO:= options \
	obfuscator_kind \
	dictionary \
	obfuscate \
	obfuscator_register

PLUGIN_DISTRIB_EXTERNAL:= Makefile.in configure.ac configure
PLUGIN_NO_TEST:=yes

include $(FRAMAC_SHARE)/Makefile.dynamic

# Regenerating the Makefile on need

ifeq ("$(FRAMAC_INTERNAL)","yes")
CONFIG_STATUS_DIR=$(FRAMAC_SRC)
else
CONFIG_STATUS_DIR=.
endif

$(Obfuscator_DIR)/Makefile: $(Obfuscator_DIR)/Makefile.in \
			$(CONFIG_STATUS_DIR)/config.status
	cd $(CONFIG_STATUS_DIR) && ./config.status --file $@
