diff --git a/Makefile.generating b/Makefile.generating
index ee1ff790afe14c60c9dd4d384f284152e22d25d4..e7e5f880b5e18975c7ca1080ec68237f56a91dcb 100644
--- a/Makefile.generating
+++ b/Makefile.generating
@@ -45,16 +45,6 @@ share/Makefile.kernel: Makefile.generating share/Makefile.config share/Makefile.
 	$(RM) $@
 	$(ECHO) "# This makefile was automatically generated." > $@
 	$(ECHO) "# Do not modify." >> $@
-	$(ECHO) "ifeq (\$$(FRAMAC_INTERNAL),yes)" >> $@
-	$(ECHO) "DYN_BLINKFLAGS=$(filter-out $(INCLUDES),$(BLINKFLAGS)) $(foreach d,$(INCLUDES:-I%=%),-I $(FRAMAC_ROOT_SRCDIR)/$(d))" >> $@
-	$(ECHO) "DYN_GEN_BYTE_LIBS=$(addprefix $(FRAMAC_ROOT_SRCDIR)/,$(GEN_BYTE_LIBS))" >> $@
-	$(ECHO) "DYN_BYTE_LIBS=$(filter-out $(GEN_BYTE_LIBS),$(BYTE_LIBS))" >> $@
-	$(ECHO) "DYN_ALL_BATCH_CMO=$(addprefix $(FRAMAC_ROOT_SRCDIR)/,$(notdir $(ALL_BATCH_CMO)))" >> $@
-	$(ECHO) "DYN_OLINKFLAGS=$(filter-out $(INCLUDES),$(OLINKFLAGS)) $(foreach d,$(INCLUDES:-I%=%),-I $(FRAMAC_ROOT_SRCDIR)/$(d))" >> $@
-	$(ECHO) "DYN_GEN_OPT_LIBS=$(addprefix $(FRAMAC_ROOT_SRCDIR)/,$(GEN_OPT_LIBS))" >> $@
-	$(ECHO) "DYN_OPT_LIBS=$(filter-out $(GEN_OPT_LIBS),$(OPT_LIBS))" >> $@
-	$(ECHO) "DYN_ALL_BATCH_CMX=$(addprefix $(FRAMAC_ROOT_SRCDIR)/,$(ALL_BATCH_CMX))" >> $@
-	$(ECHO) "else" >> $@
 	$(ECHO) "DYN_BLINKFLAGS=$(filter-out $(INCLUDES),$(BLINKFLAGS)) $(addprefix -I ,$(filter +%,$(INCLUDES)))" >> $@
 	$(ECHO) "DYN_GEN_BYTE_LIBS=$(addprefix $(FRAMAC_LIBDIR)/,$(notdir $(GEN_BYTE_LIBS)))" >> $@
 	$(ECHO) "DYN_BYTE_LIBS=$(filter-out $(GEN_BYTE_LIBS),$(BYTE_LIBS))" >> $@
@@ -63,7 +53,6 @@ share/Makefile.kernel: Makefile.generating share/Makefile.config share/Makefile.
 	$(ECHO) "DYN_GEN_OPT_LIBS=$(addprefix $(FRAMAC_LIBDIR)/,$(notdir $(GEN_OPT_LIBS)))" >> $@
 	$(ECHO) "DYN_OPT_LIBS=$(filter-out $(GEN_OPT_LIBS),$(OPT_LIBS))" >> $@
 	$(ECHO) "DYN_ALL_BATCH_CMX=$(addprefix $(FRAMAC_LIBDIR)/,$(notdir $(ALL_BATCH_CMX)))" >> $@
-	$(ECHO) "endif" >> $@
 	$(CHMOD_RO) $@
 
 ALL_LIBRARY_NAMES=$(shell ocamlfind query -r -p-format $(LIBRARY_NAMES) $(LIBRARY_NAMES_GUI))
diff --git a/share/Makefile.dynamic b/share/Makefile.dynamic
index 5467a7e18ae53a552b670ae427aa7ad315182900..fbdd26a5cf855d1d08dc78544a5f998b59ae1103 100644
--- a/share/Makefile.dynamic
+++ b/share/Makefile.dynamic
@@ -193,8 +193,6 @@ TARGETS_GUI := $(TARGET_GUI_CMI) $(TARGET_GUI_CMO) \
 TARGETS_BYTE:= $(TARGET_META) $(TARGET_CMI) $(TARGET_TOP_CMO) $(TARGET_TOP_CMA)
 TARGETS_OPT:=  $(TARGET_META) $(TARGET_CMI) $(TARGET_TOP_CMX) $(TARGET_TOP_CMXS)
 
-include $(MAKECONFIG_DIR)/Makefile.kernel
-
 byte:: $(TARGETS_BYTE)
 opt:: $(TARGETS_OPT)
 gui:: $(TARGETS_GUI)
@@ -206,6 +204,8 @@ ifneq ($(FRAMAC_INTERNAL),yes)
 # Static Linking #
 ##################
 
+include $(MAKECONFIG_DIR)/Makefile.kernel
+
 $(PLUGIN_DIR)/frama-c-$(PLUGIN_NAME).byte$(EXE): $(TARGET_TOP_CMO)
 	$(PRINT_LINKING) $@
 	$(OCAMLC) $(PLUGIN_LINK_BFLAGS) $(DYN_BLINKFLAGS) \