From: Martin Quinson Date: Sun, 21 Feb 2016 00:42:34 +0000 (+0100) Subject: banish some surf parsing files to a src/surf/xml jail X-Git-Tag: v3_13~760 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/25f00868d318a0c49b4965ea9dea9a78bc349365 banish some surf parsing files to a src/surf/xml jail The ultimate goal is to make them useless, then deprecated, then gone. --- diff --git a/.gitignore b/.gitignore index ed2757e5d5..be91017496 100644 --- a/.gitignore +++ b/.gitignore @@ -23,7 +23,7 @@ CTestResults.xml ### Maintainer mode src/simdag/dax_dtd.l -src/surf/simgrid_dtd.l +src/surf/xml/simgrid_dtd.l src/xbt/graphxml.l ### Jedule examples/simdag/scheduling/simgrid.jed diff --git a/include/surf/surf_routing.h b/include/surf/surf_routing.h index 67434ae578..c846b7778d 100644 --- a/include/surf/surf_routing.h +++ b/include/surf/surf_routing.h @@ -8,7 +8,6 @@ #define _SURF_SURF_ROUTING_H #include "xbt/lib.h" -#include "simgrid/platf.h" SG_BEGIN_DECL() diff --git a/src/bindings/lua/lua_platf.cpp b/src/bindings/lua/lua_platf.cpp index 18ae0e2394..0cf495a65f 100644 --- a/src/bindings/lua/lua_platf.cpp +++ b/src/bindings/lua/lua_platf.cpp @@ -7,8 +7,7 @@ /* SimGrid Lua bindings */ #include "lua_private.h" -#include "simgrid/platf_interface.h" -#include "surf/surfxml_parse.h" +#include "src/surf/xml/platf.hpp" #include "surf/surf_routing.h" #include #include @@ -361,8 +360,6 @@ int console_add_router(lua_State* L) { return 0; } -#include "surf/surfxml_parse.h" /* to override surf_parse and bypass the parser */ - int console_add_route(lua_State *L) { XBT_DEBUG("Adding route"); s_sg_platf_route_cbarg_t route; diff --git a/src/bindings/lua/simgrid_lua.cpp b/src/bindings/lua/simgrid_lua.cpp index ce5fed9bc4..ea77144ba5 100644 --- a/src/bindings/lua/simgrid_lua.cpp +++ b/src/bindings/lua/simgrid_lua.cpp @@ -8,10 +8,7 @@ #include "lua_private.h" #include "lua_utils.h" -#include "xbt.h" -#include "simgrid/msg.h" -#include "simgrid/simdag.h" -#include "surf/surfxml_parse.h" +#include "src/surf/xml/platf.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(lua, bindings, "Lua Bindings"); diff --git a/src/include/simgrid/platf_interface.h b/src/include/simgrid/platf_interface.h deleted file mode 100644 index 6ed6cef062..0000000000 --- a/src/include/simgrid/platf_interface.h +++ /dev/null @@ -1,33 +0,0 @@ -/* platf_interface.h - Internal interface to the SimGrid platforms */ - -/* Copyright (c) 2004-2007, 2009-2015. The SimGrid Team. - * All rights reserved. */ - -/* This program is free software; you can redistribute it and/or modify it - * under the terms of the license (GNU LGPL) which comes with this package. */ - -#ifndef SG_PLATF_INTERFACE_H -#define SG_PLATF_INTERFACE_H - -#include - -#include "simgrid/platf.h" /* public interface */ -#include "xbt/RngStream.h" - -#include - -SG_BEGIN_DECL() - -/* Module management functions */ -XBT_PUBLIC(void) sg_platf_init(void); -XBT_PUBLIC(void) sg_platf_exit(void); - -/** \brief Pick the right models for CPU, net and host, and call their model_init_preparse - * - * Must be called within parsing/creating the environment (after the s, if any, and before or friends such as ) - */ -XBT_PUBLIC(void) surf_config_models_setup(void); - -SG_END_DECL() - -#endif /* SG_PLATF_INTERFACE_H */ diff --git a/src/include/surf/surf.h b/src/include/surf/surf.h index e2dcd5b4b5..d0c563fcbf 100644 --- a/src/include/surf/surf.h +++ b/src/include/surf/surf.h @@ -18,7 +18,6 @@ #include "surf/datatypes.h" #include "xbt/lib.h" #include "surf/surf_routing.h" -#include "simgrid/platf_interface.h" #include "simgrid/datatypes.h" #include "simgrid/forward.h" @@ -995,11 +994,6 @@ int instr_platform_traced (void); xbt_graph_t instr_routing_platform_graph (void); void instr_routing_platform_graph_export_graphviz (xbt_graph_t g, const char *filename); -/********** Routing **********/ -void routing_AS_begin(sg_platf_AS_cbarg_t AS); -void routing_AS_end(void); -void routing_cluster_add_backbone(Link* bb); -surf_As* routing_get_current(); SG_END_DECL() #endif /* _SURF_SURF_H */ diff --git a/src/instr/instr_private.h b/src/instr/instr_private.h index 0bcb00f618..c9aeb64f89 100644 --- a/src/instr/instr_private.h +++ b/src/instr/instr_private.h @@ -26,7 +26,6 @@ SG_BEGIN_DECL() #include "xbt/graph.h" #include "xbt/dict.h" -#include "simgrid/platf.h" typedef enum { PAJE_DefineContainerType, diff --git a/src/msg/msg_global.cpp b/src/msg/msg_global.cpp index d2f631ba0b..4d5d20d21e 100644 --- a/src/msg/msg_global.cpp +++ b/src/msg/msg_global.cpp @@ -16,7 +16,7 @@ #include "xbt/replay.h" #include "simgrid/sg_config.h" /* Configuration mechanism of SimGrid */ #include "src/surf/callbacks.h" -#include "src/surf/platform.hpp" +#include "src/surf/xml/platf_private.hpp" // FIXME: KILLME by removing MSG_post_create_environment() XBT_LOG_NEW_CATEGORY(msg, "All MSG categories"); XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_kernel, msg, diff --git a/src/msg/msg_vm.cpp b/src/msg/msg_vm.cpp index cbfb739ae8..4b360b76b7 100644 --- a/src/msg/msg_vm.cpp +++ b/src/msg/msg_vm.cpp @@ -15,7 +15,6 @@ #include "msg_private.h" #include "xbt/sysdep.h" #include "xbt/log.h" -#include "simgrid/platf.h" #include "simgrid/host.h" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_vm, msg, diff --git a/src/simgrid/sg_config.c b/src/simgrid/sg_config.c index 4a9c9d7917..74f19c438d 100644 --- a/src/simgrid/sg_config.c +++ b/src/simgrid/sg_config.c @@ -949,75 +949,6 @@ void sg_config_finalize(void) _sg_cfg_init_status = 0; } -/* Pick the right models for CPU, net and host, and call their model_init_preparse */ -void surf_config_models_setup() -{ - const char *host_model_name; - const char *vm_model_name; - int host_id = -1; - int vm_id = -1; - char *network_model_name = NULL; - char *cpu_model_name = NULL; - int storage_id = -1; - char *storage_model_name = NULL; - - host_model_name = xbt_cfg_get_string(_sg_cfg_set, "host/model"); - vm_model_name = xbt_cfg_get_string(_sg_cfg_set, "vm/model"); - network_model_name = xbt_cfg_get_string(_sg_cfg_set, "network/model"); - cpu_model_name = xbt_cfg_get_string(_sg_cfg_set, "cpu/model"); - storage_model_name = xbt_cfg_get_string(_sg_cfg_set, "storage/model"); - - /* Check whether we use a net/cpu model differing from the default ones, in which case - * we should switch to the "compound" host model to correctly dispatch stuff to - * the right net/cpu models. - */ - - if ((!xbt_cfg_is_default_value(_sg_cfg_set, "network/model") || - !xbt_cfg_is_default_value(_sg_cfg_set, "cpu/model")) && - xbt_cfg_is_default_value(_sg_cfg_set, "host/model")) { - host_model_name = "compound"; - xbt_cfg_set_string(_sg_cfg_set, "host/model", host_model_name); - } - - XBT_DEBUG("host model: %s", host_model_name); - host_id = find_model_description(surf_host_model_description, host_model_name); - if (!strcmp(host_model_name, "compound")) { - int network_id = -1; - int cpu_id = -1; - - xbt_assert(cpu_model_name, - "Set a cpu model to use with the 'compound' host model"); - - xbt_assert(network_model_name, - "Set a network model to use with the 'compound' host model"); - - if(surf_cpu_model_init_preparse){ - surf_cpu_model_init_preparse(); - } else { - cpu_id = - find_model_description(surf_cpu_model_description, cpu_model_name); - surf_cpu_model_description[cpu_id].model_init_preparse(); - } - - network_id = - find_model_description(surf_network_model_description, - network_model_name); - surf_network_model_description[network_id].model_init_preparse(); - } - - XBT_DEBUG("Call host_model_init"); - surf_host_model_description[host_id].model_init_preparse(); - - XBT_DEBUG("Call vm_model_init"); - vm_id = find_model_description(surf_vm_model_description, vm_model_name); - surf_vm_model_description[vm_id].model_init_preparse(); - - XBT_DEBUG("Call storage_model_init"); - storage_id = find_model_description(surf_storage_model_description, storage_model_name); - surf_storage_model_description[storage_id].model_init_preparse(); - -} - int sg_cfg_is_default_value(const char *name) { return xbt_cfg_is_default_value(_sg_cfg_set, name); diff --git a/src/simix/smx_deployment.cpp b/src/simix/smx_deployment.cpp index cc101f7a56..08a8727cbf 100644 --- a/src/simix/smx_deployment.cpp +++ b/src/simix/smx_deployment.cpp @@ -8,7 +8,7 @@ #include "xbt/sysdep.h" #include "xbt/log.h" #include "xbt/dict.h" -#include "surf/surfxml_parse.h" +#include "src/surf/xml/platf_private.hpp" // FIXME: KILLME. There must be a better way than mimicking XML here XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_deployment, simix, "Logging specific to SIMIX (deployment)"); diff --git a/src/simix/smx_environment.cpp b/src/simix/smx_environment.cpp index 9b4c6db82b..279e6eae77 100644 --- a/src/simix/smx_environment.cpp +++ b/src/simix/smx_environment.cpp @@ -9,7 +9,6 @@ #include "xbt/log.h" #include "xbt/xbt_os_time.h" #include "xbt/config.h" -#include "surf/surfxml_parse.h" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_environment, simix, "Logging specific to SIMIX (environment)"); diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index c2bc81b01f..54cf74d888 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -37,7 +37,6 @@ #endif #include "src/mc/mc_record.h" -#include "src/surf/platform.hpp" #ifdef HAVE_SMPI #include "src/smpi/private.h" diff --git a/src/surf/cpu_cas01.cpp b/src/surf/cpu_cas01.cpp index a3dec9ae48..3f1ab84f94 100644 --- a/src/surf/cpu_cas01.cpp +++ b/src/surf/cpu_cas01.cpp @@ -8,7 +8,6 @@ #include "cpu_ti.hpp" #include "maxmin_private.hpp" #include "simgrid/sg_config.h" -#include "src/surf/platform.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu_cas, surf_cpu, "Logging specific to the SURF CPU IMPROVED module"); diff --git a/src/surf/cpu_ti.cpp b/src/surf/cpu_ti.cpp index 724a9c5239..2cc517ea42 100644 --- a/src/surf/cpu_ti.cpp +++ b/src/surf/cpu_ti.cpp @@ -7,7 +7,6 @@ #include "cpu_ti.hpp" #include "xbt/heap.h" #include "src/surf/trace_mgr.hpp" -#include "src/surf/platform.hpp" #ifndef SURF_MODEL_CPUTI_H_ #define SURF_MODEL_CPUTI_H_ diff --git a/src/surf/instr_routing.cpp b/src/surf/instr_routing.cpp index ce605c04f5..e79947ac4c 100644 --- a/src/surf/instr_routing.cpp +++ b/src/surf/instr_routing.cpp @@ -8,7 +8,6 @@ #include "src/surf/surf_private.h" #include "xbt/graph.h" -#include "src/surf/platform.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_routing, instr, "Tracing platform hierarchy"); diff --git a/src/surf/network_cm02.cpp b/src/surf/network_cm02.cpp index 6915a08a3e..a178748083 100644 --- a/src/surf/network_cm02.cpp +++ b/src/surf/network_cm02.cpp @@ -9,7 +9,6 @@ #include "network_cm02.hpp" #include "maxmin_private.hpp" #include "simgrid/sg_config.h" -#include "src/surf/platform.hpp" XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network); diff --git a/src/surf/network_constant.cpp b/src/surf/network_constant.cpp index 6114f6f4d1..533be80bd1 100644 --- a/src/surf/network_constant.cpp +++ b/src/surf/network_constant.cpp @@ -6,9 +6,6 @@ #include "network_constant.hpp" -#include "host_interface.hpp" -#include "src/surf/platform.hpp" - XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network); /********* diff --git a/src/surf/network_ib.cpp b/src/surf/network_ib.cpp index 5f52e8c316..5e995d1582 100644 --- a/src/surf/network_ib.cpp +++ b/src/surf/network_ib.cpp @@ -104,7 +104,7 @@ void surf_network_model_init_IB(void) } -#include // FIXME: move that back to the parsing area +#include "src/surf/xml/platf.hpp" // FIXME: move that back to the parsing area namespace simgrid { namespace surf { diff --git a/src/surf/network_ns3.cpp b/src/surf/network_ns3.cpp index 17115295e1..a14c1848fd 100644 --- a/src/surf/network_ns3.cpp +++ b/src/surf/network_ns3.cpp @@ -8,7 +8,6 @@ #include "src/surf/surf_private.h" #include "src/surf/host_interface.hpp" #include "simgrid/sg_config.h" -#include "src/surf/platform.hpp" XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(ns3); @@ -65,7 +64,7 @@ static void parse_ns3_add_AS(simgrid::surf::As* as) xbt_lib_set(as_router_lib, as_id, NS3_ASR_LEVEL, ns3_add_AS(as_id) ); } -#include // FIXME: move that back to the parsing area +#include "src/surf/xml/platf.hpp" // FIXME: move that back to the parsing area static void parse_ns3_add_cluster(sg_platf_cluster_cbarg_t cluster) { const char *groups = NULL; diff --git a/src/surf/network_smpi.cpp b/src/surf/network_smpi.cpp index 004dec9b08..b9d8d15d69 100644 --- a/src/surf/network_smpi.cpp +++ b/src/surf/network_smpi.cpp @@ -32,7 +32,7 @@ static int factor_cmp(const void *pa, const void *pb) (((s_smpi_factor_t*)pa)->factor < ((s_smpi_factor_t*)pb)->factor) ? -1 : 0; } -#include // FIXME: move that back to the parsing area +#include "src/surf/xml/platf.hpp" // FIXME: move that back to the parsing area static xbt_dynar_t parse_factor(const char *smpi_coef_string) { char *value = NULL; diff --git a/src/surf/platform.hpp b/src/surf/platform.hpp deleted file mode 100644 index 9db38ba0d5..0000000000 --- a/src/surf/platform.hpp +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright (c) 2016. The SimGrid Team. - * All rights reserved. */ - -/* This program is free software; you can redistribute it and/or modify it - * under the terms of the license (GNU LGPL) which comes with this package. */ - -#ifndef SIMGRID_PLATFORM_HPP -#define SIMGRID_PLATFORM_HPP - -#include -#include -#include - -namespace simgrid { -namespace surf { - -extern XBT_PRIVATE simgrid::xbt::signal on_link; -extern XBT_PRIVATE simgrid::xbt::signal on_cluster; -extern XBT_PRIVATE simgrid::xbt::signal on_postparse; - -} -} - -#endif diff --git a/src/surf/ptask_L07.cpp b/src/surf/ptask_L07.cpp index 7588146ead..8754117c86 100644 --- a/src/surf/ptask_L07.cpp +++ b/src/surf/ptask_L07.cpp @@ -13,7 +13,6 @@ #include "cpu_interface.hpp" #include "surf_routing.hpp" #include "xbt/lib.h" -#include "src/surf/platform.hpp" XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_host); XBT_LOG_EXTERNAL_CATEGORY(xbt_cfg); diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 2c4dd116ae..a3ae7d8ca5 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -10,15 +10,13 @@ #include "xbt/dict.h" #include "xbt/RngStream.h" #include -#include "simgrid/platf_interface.h" #include "surf/surf.h" #include "src/simix/smx_private.h" -#include "src/surf/platform.hpp" -#include "surf/surfxml_parse.h"// FIXME: brain dead public header +#include "src/include/simgrid/sg_config.h" +#include "src/surf/xml/platf_private.hpp" -#include "src/surf/platform.hpp" #include "src/surf/cpu_interface.hpp" #include "src/surf/host_interface.hpp" #include "src/surf/network_interface.hpp" @@ -619,6 +617,75 @@ void sg_platf_end() { simgrid::surf::on_postparse(); } +/* Pick the right models for CPU, net and host, and call their model_init_preparse */ +static void surf_config_models_setup() +{ + const char *host_model_name; + const char *vm_model_name; + int host_id = -1; + int vm_id = -1; + char *network_model_name = NULL; + char *cpu_model_name = NULL; + int storage_id = -1; + char *storage_model_name = NULL; + + host_model_name = xbt_cfg_get_string(_sg_cfg_set, "host/model"); + vm_model_name = xbt_cfg_get_string(_sg_cfg_set, "vm/model"); + network_model_name = xbt_cfg_get_string(_sg_cfg_set, "network/model"); + cpu_model_name = xbt_cfg_get_string(_sg_cfg_set, "cpu/model"); + storage_model_name = xbt_cfg_get_string(_sg_cfg_set, "storage/model"); + + /* Check whether we use a net/cpu model differing from the default ones, in which case + * we should switch to the "compound" host model to correctly dispatch stuff to + * the right net/cpu models. + */ + + if ((!xbt_cfg_is_default_value(_sg_cfg_set, "network/model") || + !xbt_cfg_is_default_value(_sg_cfg_set, "cpu/model")) && + xbt_cfg_is_default_value(_sg_cfg_set, "host/model")) { + host_model_name = "compound"; + xbt_cfg_set_string(_sg_cfg_set, "host/model", host_model_name); + } + + XBT_DEBUG("host model: %s", host_model_name); + host_id = find_model_description(surf_host_model_description, host_model_name); + if (!strcmp(host_model_name, "compound")) { + int network_id = -1; + int cpu_id = -1; + + xbt_assert(cpu_model_name, + "Set a cpu model to use with the 'compound' host model"); + + xbt_assert(network_model_name, + "Set a network model to use with the 'compound' host model"); + + if(surf_cpu_model_init_preparse){ + surf_cpu_model_init_preparse(); + } else { + cpu_id = + find_model_description(surf_cpu_model_description, cpu_model_name); + surf_cpu_model_description[cpu_id].model_init_preparse(); + } + + network_id = + find_model_description(surf_network_model_description, + network_model_name); + surf_network_model_description[network_id].model_init_preparse(); + } + + XBT_DEBUG("Call host_model_init"); + surf_host_model_description[host_id].model_init_preparse(); + + XBT_DEBUG("Call vm_model_init"); + vm_id = find_model_description(surf_vm_model_description, vm_model_name); + surf_vm_model_description[vm_id].model_init_preparse(); + + XBT_DEBUG("Call storage_model_init"); + storage_id = find_model_description(surf_storage_model_description, storage_model_name); + surf_storage_model_description[storage_id].model_init_preparse(); + +} + void sg_platf_new_AS_begin(sg_platf_AS_cbarg_t AS) { if (!surf_parse_models_setup_already_called) { diff --git a/src/surf/storage_n11.cpp b/src/surf/storage_n11.cpp index 208f5524f8..31002dcb6d 100644 --- a/src/surf/storage_n11.cpp +++ b/src/surf/storage_n11.cpp @@ -80,7 +80,7 @@ StorageN11Model::~StorageN11Model(){ storage_running_action_set_that_does_not_need_being_checked = NULL; } -#include // FIXME: move that back to the parsing area +#include "src/surf/xml/platf.hpp" // FIXME: move that back to the parsing area Storage *StorageN11Model::createStorage(const char* id, const char* type_id, const char* content_name, const char* content_type, xbt_dict_t properties, const char* attach) diff --git a/src/surf/surf_interface.hpp b/src/surf/surf_interface.hpp index de6cfa5669..2719ed63aa 100644 --- a/src/surf/surf_interface.hpp +++ b/src/surf/surf_interface.hpp @@ -19,7 +19,6 @@ #include "xbt/lib.h" #include "surf/surf_routing.h" -#include "simgrid/platf_interface.h" #include "surf/surf.h" #include "src/surf/surf_private.h" #include "src/internal_config.h" diff --git a/src/surf/surf_private.h b/src/surf/surf_private.h index 1370cb1f06..2cf7e4c860 100644 --- a/src/surf/surf_private.h +++ b/src/surf/surf_private.h @@ -15,6 +15,7 @@ #include "src/surf/trace_mgr.hpp" #include "src/instr/instr_private.h" #include "surf/surfxml_parse_values.h" +#include "src/surf/xml/platf_private.hpp" #define NO_MAX_DURATION -1.0 diff --git a/src/surf/surf_routing.cpp b/src/surf/surf_routing.cpp index 44f21cf6a6..ef1c70a51e 100644 --- a/src/surf/surf_routing.cpp +++ b/src/surf/surf_routing.cpp @@ -8,10 +8,8 @@ #include "surf_routing_private.hpp" #include "surf_routing_cluster.hpp" -#include "simgrid/platf_interface.h" // platform creation API internal interface #include "simgrid/sg_config.h" #include "storage_interface.hpp" -#include "src/surf/platform.hpp" #include "surf/surfxml_parse_values.h" #include "src/surf/surf_routing_cluster_torus.hpp" @@ -20,7 +18,7 @@ #include "src/surf/surf_routing_floyd.hpp" #include "src/surf/surf_routing_full.hpp" #include "src/surf/surf_routing_vivaldi.hpp" -#include // FIXME: move that back to the parsing area +#include "src/surf/xml/platf.hpp" // FIXME: move that back to the parsing area #include diff --git a/src/surf/surf_routing_RoutedGraph.cpp b/src/surf/surf_routing_RoutedGraph.cpp index b4bb6526c6..c5e1d634d7 100644 --- a/src/surf/surf_routing_RoutedGraph.cpp +++ b/src/surf/surf_routing_RoutedGraph.cpp @@ -10,13 +10,11 @@ #include -#include -#include -#include -#include -#include - -#include "simgrid/platf_interface.h" // platform creation API internal interface +#include "xbt/dict.h" +#include "xbt/log.h" +#include "xbt/sysdep.h" +#include "xbt/dynar.h" +#include "xbt/graph.h" #include "surf_routing_private.hpp" #include "network_interface.hpp" diff --git a/src/surf/surf_routing_cluster_fat_tree.cpp b/src/surf/surf_routing_cluster_fat_tree.cpp index 9580c264b6..4e40b929a6 100644 --- a/src/surf/surf_routing_cluster_fat_tree.cpp +++ b/src/surf/surf_routing_cluster_fat_tree.cpp @@ -16,7 +16,7 @@ #include #include -#include // FIXME: move that back to the parsing area +#include "src/surf/xml/platf.hpp" // FIXME: move that back to the parsing area XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_fat_tree, surf, "Routing for fat trees"); diff --git a/src/surf/surf_routing_cluster_torus.cpp b/src/surf/surf_routing_cluster_torus.cpp index 60ccb735f8..5653259e24 100644 --- a/src/surf/surf_routing_cluster_torus.cpp +++ b/src/surf/surf_routing_cluster_torus.cpp @@ -6,7 +6,7 @@ #include "src/surf/surf_routing_private.hpp" #include "src/surf/surf_routing_cluster_torus.hpp" -#include // FIXME: move that back to the parsing area +#include "src/surf/xml/platf.hpp" // FIXME: move that back to the parsing area XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_cluster_torus, surf_route_cluster, "Torus Routing part of surf"); diff --git a/src/surf/trace_mgr.hpp b/src/surf/trace_mgr.hpp index a53be9e9bd..eb301828fd 100644 --- a/src/surf/trace_mgr.hpp +++ b/src/surf/trace_mgr.hpp @@ -11,7 +11,6 @@ #include "xbt/dynar.h" #include "surf/maxmin.h" #include "surf/datatypes.h" -#include "simgrid/platf_interface.h" #include "simgrid/forward.h" SG_BEGIN_DECL() @@ -65,8 +64,6 @@ typedef struct tmgr_trace_iterator { int free_me; } s_tmgr_trace_event_t; -XBT_PRIVATE double tmgr_event_generator_next_value(probabilist_event_generator_t generator); - /* Creation functions */ XBT_PUBLIC(tmgr_trace_t) tmgr_empty_trace_new(void); XBT_PUBLIC(void) tmgr_trace_free(tmgr_trace_t trace); diff --git a/include/surf/surfxml_parse.h b/src/surf/xml/platf.hpp similarity index 65% rename from include/surf/surfxml_parse.h rename to src/surf/xml/platf.hpp index eca8e270df..64e16dcb15 100644 --- a/include/surf/surfxml_parse.h +++ b/src/surf/xml/platf.hpp @@ -7,18 +7,15 @@ #ifndef _SURF_SURFXML_PARSE_H #define _SURF_SURFXML_PARSE_H -#include /* to have FILE */ #include "xbt/misc.h" #include "xbt/function_types.h" #include "xbt/dict.h" SG_BEGIN_DECL() -#include "surf/simgrid_dtd.h" -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif +/* Module management functions */ +XBT_PUBLIC(void) sg_platf_init(void); +XBT_PUBLIC(void) sg_platf_exit(void); XBT_PUBLIC(void) surf_parse_open(const char *file); XBT_PUBLIC(void) surf_parse_close(void); @@ -33,20 +30,6 @@ XBT_PUBLIC(double) surf_parse_get_size(const char *string, const char *entity_ki XBT_PUBLIC(double) surf_parse_get_bandwidth(const char *string, const char *entity_kind, const char *name); XBT_PUBLIC(double) surf_parse_get_speed(const char *string, const char *entity_kind, const char *name); -/* Prototypes of the functions offered by flex */ -XBT_PUBLIC(int) surf_parse_lex(void); -XBT_PUBLIC(int) surf_parse_get_lineno(void); -XBT_PUBLIC(FILE *) surf_parse_get_in(void); -XBT_PUBLIC(FILE *) surf_parse_get_out(void); -XBT_PUBLIC(yy_size_t) surf_parse_get_leng(void); -XBT_PUBLIC(char *) surf_parse_get_text(void); -XBT_PUBLIC(void) surf_parse_set_lineno(int line_number); -XBT_PUBLIC(void) surf_parse_set_in(FILE * in_str); -XBT_PUBLIC(void) surf_parse_set_out(FILE * out_str); -XBT_PUBLIC(int) surf_parse_get_debug(void); -XBT_PUBLIC(void) surf_parse_set_debug(int bdebug); -XBT_PUBLIC(int) surf_parse_lex_destroy(void); - /* What is needed to bypass the parser. */ XBT_PUBLIC_DATA(int_f_void_t) surf_parse; /* Entry-point to the parser. Set this to your function. */ diff --git a/include/simgrid/platf.h b/src/surf/xml/platf_private.hpp similarity index 86% rename from include/simgrid/platf.h rename to src/surf/xml/platf_private.hpp index 401864e5a4..b505dc9a73 100644 --- a/include/simgrid/platf.h +++ b/src/surf/xml/platf_private.hpp @@ -1,4 +1,4 @@ -/* platf.h - Public interface to the SimGrid platforms */ +/* platf_private.h - Interface to the SimGrid platforms which visibility should be limited to this directory */ /* Copyright (c) 2004-2015. The SimGrid Team. * All rights reserved. */ @@ -9,11 +9,16 @@ #ifndef SG_PLATF_H #define SG_PLATF_H -#include -#include -#include "forward.h" +#include "simgrid/host.h" +#include "src/surf/xml/platf.hpp" SG_BEGIN_DECL() +#include "src/surf/xml/simgrid_dtd.h" + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif static inline char* sg_storage_name(sg_storage_t storage) { return storage->key; @@ -251,6 +256,11 @@ typedef struct s_sg_platf_AS_cbarg { /** opaque structure defining a event generator for availability based on a probability distribution */ typedef struct probabilist_event_generator *probabilist_event_generator_t; +/********** Routing **********/ +void routing_AS_begin(sg_platf_AS_cbarg_t AS); +void routing_AS_end(void); +void routing_cluster_add_backbone(Link* bb); +surf_As* routing_get_current(); /*** END of the parsing cruft ***/ XBT_PUBLIC(void) sg_platf_begin(void); // Start a new platform @@ -279,6 +289,31 @@ XBT_PUBLIC(void) sg_platf_new_mount(sg_platf_mount_cbarg_t mount); XBT_PUBLIC(void) sg_platf_new_process(sg_platf_process_cbarg_t process); +/* Prototypes of the functions offered by flex */ +XBT_PUBLIC(int) surf_parse_lex(void); +XBT_PUBLIC(int) surf_parse_get_lineno(void); +XBT_PUBLIC(FILE *) surf_parse_get_in(void); +XBT_PUBLIC(FILE *) surf_parse_get_out(void); +XBT_PUBLIC(yy_size_t) surf_parse_get_leng(void); +XBT_PUBLIC(char *) surf_parse_get_text(void); +XBT_PUBLIC(void) surf_parse_set_lineno(int line_number); +XBT_PUBLIC(void) surf_parse_set_in(FILE * in_str); +XBT_PUBLIC(void) surf_parse_set_out(FILE * out_str); +XBT_PUBLIC(int) surf_parse_get_debug(void); +XBT_PUBLIC(void) surf_parse_set_debug(int bdebug); +XBT_PUBLIC(int) surf_parse_lex_destroy(void); + + SG_END_DECL() +namespace simgrid { +namespace surf { + +extern XBT_PRIVATE simgrid::xbt::signal on_link; +extern XBT_PRIVATE simgrid::xbt::signal on_cluster; +extern XBT_PRIVATE simgrid::xbt::signal on_postparse; + +} +} + #endif /* SG_PLATF_H */ diff --git a/src/surf/simgrid.dtd b/src/surf/xml/simgrid.dtd similarity index 100% rename from src/surf/simgrid.dtd rename to src/surf/xml/simgrid.dtd diff --git a/src/surf/simgrid_dtd.c b/src/surf/xml/simgrid_dtd.c similarity index 99% rename from src/surf/simgrid_dtd.c rename to src/surf/xml/simgrid_dtd.c index 512ea0b53d..c8b3eee312 100644 --- a/src/surf/simgrid_dtd.c +++ b/src/surf/xml/simgrid_dtd.c @@ -1,5 +1,5 @@ -#line 3 "src/surf/simgrid_dtd.c" +#line 3 "src/surf/xml/simgrid_dtd.c" #define YY_INT_ALIGNED short int @@ -4547,7 +4547,7 @@ int surf_parse__flex_debug = 0; #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *surf_parse_text; -/* Validating XML processor for src/surf/simgrid.dtd. +/* Validating XML processor for src/surf/xml/simgrid.dtd. * * This program was generated with the FleXML XML processor generator. * FleXML is Copyright (C) 1999-2005 Kristoffer Rose. All rights reserved. @@ -6037,8 +6037,8 @@ YY_RULE_SETUP if (!AX_surfxml_ASroute_src) FAIL("Required attribute `src' not set for `ASroute' element."); LEAVE; STag_surfxml_ASroute(); surfxml_pcdata_ix = 0; ETag_surfxml_ASroute(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_3: case S_surfxml_AS_5: SET(S_surfxml_AS_6); break; - case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break; + case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; + case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_4: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break; } } YY_BREAK @@ -6062,8 +6062,8 @@ YY_RULE_SETUP ETag_surfxml_ASroute(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_3: case S_surfxml_AS_5: SET(S_surfxml_AS_6); break; - case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break; + case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; + case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_4: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break; } } YY_BREAK diff --git a/include/surf/simgrid_dtd.h b/src/surf/xml/simgrid_dtd.h similarity index 99% rename from include/surf/simgrid_dtd.h rename to src/surf/xml/simgrid_dtd.h index cccbbdb660..58a929e1d5 100644 --- a/include/surf/simgrid_dtd.h +++ b/src/surf/xml/simgrid_dtd.h @@ -1,4 +1,4 @@ -/* XML processor/application API for src/surf/simgrid.dtd. +/* XML processor/application API for src/surf/xml/simgrid.dtd. * * This program was generated with the FleXML XML processor generator. * FleXML is Copyright (C) 1999-2005 Kristoffer Rose. All rights reserved. diff --git a/src/surf/surfxml_parseplatf.cpp b/src/surf/xml/surfxml_parseplatf.cpp similarity index 99% rename from src/surf/surfxml_parseplatf.cpp rename to src/surf/xml/surfxml_parseplatf.cpp index f80586543c..0c85993e43 100644 --- a/src/surf/surfxml_parseplatf.cpp +++ b/src/surf/xml/surfxml_parseplatf.cpp @@ -8,11 +8,10 @@ #include "xbt/log.h" #include "xbt/str.h" #include "xbt/dict.h" -#include "simgrid/platf.h" #include "src/surf/cpu_interface.hpp" #include "src/surf/network_interface.hpp" -#include +#include "src/surf/xml/platf.hpp" #ifdef HAVE_LUA extern "C" { diff --git a/src/surf/surfxml_parse.cpp b/src/surf/xml/surfxml_sax_cb.cpp similarity index 99% rename from src/surf/surfxml_parse.cpp rename to src/surf/xml/surfxml_sax_cb.cpp index 5e0aab1c03..b36b0e2dc0 100644 --- a/src/surf/surfxml_parse.cpp +++ b/src/surf/xml/surfxml_sax_cb.cpp @@ -16,7 +16,7 @@ #include "src/surf/surf_private.h" #include "simgrid/sg_config.h" -#include +#include "src/surf/xml/platf_private.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_parse, surf, "Logging specific to the SURF parsing module"); diff --git a/teshsuite/simix/stack_overflow/stack_overflow.c b/teshsuite/simix/stack_overflow/stack_overflow.c index 342c9cd70e..1f247112c5 100644 --- a/teshsuite/simix/stack_overflow/stack_overflow.c +++ b/teshsuite/simix/stack_overflow/stack_overflow.c @@ -6,7 +6,6 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "simgrid/platf.h" #include "simgrid/simix.h" #include "xbt/log.h" @@ -31,11 +30,11 @@ static int master(int argc, char *argv[]) { XBT_INFO("Launching our nice bugged recursive function..."); unsigned i = 1; - do { + while (i <= 0x80000000u) { i *= 2; unsigned res = collatz(i, i); XBT_VERB("collatz(%u, %u) returned %u", i, i, res); - } while (i <= 0x80000000u); + } return 0; } @@ -43,10 +42,7 @@ int main(int argc, char *argv[]) { SIMIX_global_init(&argc, argv); - if (argc != 3) { - printf("Usage: %s platform.xml deployment.xml\n", argv[0]); - exit(EXIT_FAILURE); - } + xbt_assert(argc == 3, "Usage: %s platform.xml deployment.xml\n", argv[0]); SIMIX_function_register("master", master); SIMIX_create_environment(argv[1]); diff --git a/teshsuite/surf/surf_usage/surf_usage.cpp b/teshsuite/surf/surf_usage/surf_usage.cpp index 8aa09ec730..37a90b4609 100644 --- a/teshsuite/surf/surf_usage/surf_usage.cpp +++ b/teshsuite/surf/surf_usage/surf_usage.cpp @@ -9,7 +9,6 @@ #include #include "simgrid/sg_config.h" #include "surf/surf.h" -#include "surf/surfxml_parse.h" // for reset callback #include "src/surf/surf_interface.hpp" #include "src/surf/cpu_interface.hpp" diff --git a/teshsuite/surf/surf_usage/surf_usage2.cpp b/teshsuite/surf/surf_usage/surf_usage2.cpp index 41024bc458..3230aa2cbd 100644 --- a/teshsuite/surf/surf_usage/surf_usage2.cpp +++ b/teshsuite/surf/surf_usage/surf_usage2.cpp @@ -9,7 +9,6 @@ #include #include "simgrid/sg_config.h" #include "surf/surf.h" -#include "surf/surfxml_parse.h" // for reset callback #include "src/surf/surf_interface.hpp" #include "src/surf/cpu_interface.hpp" diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index cc3b711ab1..04fabdef5d 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -8,7 +8,6 @@ set(EXTRA_DIST src/mc/mc_mmu.h src/mc/PageStore.hpp src/mc/mc_record.h - src/include/simgrid/platf_interface.h src/include/simgrid/sg_config.h src/include/smpi/smpi_interface.h src/include/surf/datatypes.h @@ -60,10 +59,11 @@ set(EXTRA_DIST src/surf/ns3/ns3_interface.h src/surf/ns3/ns3_simulator.h src/surf/ns3/red-queue.h - src/surf/platform.hpp src/surf/plugins/energy.hpp - src/surf/simgrid.dtd - src/surf/simgrid_dtd.c + src/surf/xml/simgrid.dtd + src/surf/xml/simgrid_dtd.h + src/surf/xml/simgrid_dtd.c + src/surf/xml/surfxml_sax_cb.cpp src/surf/storage_interface.hpp src/surf/storage_n11.hpp src/surf/surf_interface.hpp @@ -79,7 +79,6 @@ set(EXTRA_DIST src/surf/surf_routing_none.hpp src/surf/surf_routing_private.hpp src/surf/surf_routing_vivaldi.hpp - src/surf/surfxml_parse.cpp src/surf/vm_hl13.hpp src/surf/PropertyHolder.hpp src/surf/virtual_machine.hpp @@ -336,8 +335,10 @@ set(SURF_SRC src/surf/surf_routing_RoutedGraph.cpp src/surf/surf_routing_none.cpp src/surf/surf_routing_vivaldi.cpp - src/surf/surfxml_parse.cpp - src/surf/surfxml_parseplatf.cpp + src/surf/xml/platf.hpp + src/surf/xml/platf_private.hpp + src/surf/xml/surfxml_sax_cb.cpp + src/surf/xml/surfxml_parseplatf.cpp src/surf/trace_mgr.hpp src/surf/trace_mgr.cpp src/surf/vm_hl13.cpp @@ -653,7 +654,6 @@ set(headers_to_install include/simgrid/datatypes.h include/simgrid/modelchecker.h include/simgrid/forward.h - include/simgrid/platf.h include/simgrid/simix.h include/simgrid/simix.hpp include/simgrid/host.h @@ -672,9 +672,7 @@ set(headers_to_install include/smpi/mpi.h include/smpi/smpi.h include/smpi/smpi_main.h - include/surf/simgrid_dtd.h include/surf/surf_routing.h - include/surf/surfxml_parse.h include/xbt.h include/xbt/RngStream.h include/xbt/asserts.h diff --git a/tools/cmake/Documentation.cmake b/tools/cmake/Documentation.cmake index a9b915b1b0..175d693435 100644 --- a/tools/cmake/Documentation.cmake +++ b/tools/cmake/Documentation.cmake @@ -108,7 +108,7 @@ add_custom_target(sync-gforge-doc COMMAND ${RSYNC_CMD} doc/html/simgrid_modules2.png doc/html/simgrid_modules.png doc/webcruft/simgrid_logo_2011.png doc/webcruft/simgrid_logo_2011_small.png scm.gforge.inria.fr:/home/groups/simgrid/htdocs/simgrid/${release_version}/ - COMMAND ${RSYNC_CMD} src/surf/simgrid.dtd scm.gforge.inria.fr:/home/groups/simgrid/htdocs/simgrid/ + COMMAND ${RSYNC_CMD} src/surf/xml/simgrid.dtd scm.gforge.inria.fr:/home/groups/simgrid/htdocs/simgrid/ WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}" ) diff --git a/tools/cmake/MaintainerMode.cmake b/tools/cmake/MaintainerMode.cmake index 712696cb71..9ba28245d2 100644 --- a/tools/cmake/MaintainerMode.cmake +++ b/tools/cmake/MaintainerMode.cmake @@ -144,40 +144,41 @@ if(enable_maintainer_mode AND NOT WIN32) set(string15 "'s/FAIL(\"Premature EOF/if(!ETag_surfxml_include_state()) FAIL(\"Premature EOF/'") ADD_CUSTOM_COMMAND( - OUTPUT ${CMAKE_HOME_DIRECTORY}/include/surf/simgrid_dtd.h + OUTPUT ${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid_dtd.h ${CMAKE_HOME_DIRECTORY}/include/xbt/graphxml.h ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.h - ${CMAKE_HOME_DIRECTORY}/src/surf/simgrid_dtd.c + ${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid_dtd.c ${CMAKE_HOME_DIRECTORY}/src/xbt/graphxml.c ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.c - DEPENDS ${CMAKE_HOME_DIRECTORY}/src/surf/simgrid.dtd + DEPENDS ${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid.dtd ${CMAKE_HOME_DIRECTORY}/src/xbt/graphxml.dtd ${CMAKE_HOME_DIRECTORY}/src/simdag/dax.dtd - #${CMAKE_HOME_DIRECTORY}/src/surf/simgrid_dtd.l: ${CMAKE_HOME_DIRECTORY}/src/surf/simgrid.dtd - COMMAND ${FLEXML_EXE} --root-tags platform -b 1000000 -P surfxml --sysid=http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd -S src/surf/simgrid_dtd.l -L src/surf/simgrid.dtd - COMMAND ${SED_EXE} -i ${string14} src/surf/simgrid_dtd.l - COMMAND ${CMAKE_COMMAND} -E echo "src/surf/simgrid_dtd.l" + #${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid_dtd.l: ${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid.dtd + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_HOME_DIRECTORY}/src/surf/xml + COMMAND ${FLEXML_EXE} --root-tags platform -b 1000000 -P surfxml --sysid=http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd -S src/surf/xml/simgrid_dtd.l -L src/surf/xml/simgrid.dtd + COMMAND ${SED_EXE} -i ${string14} src/surf/xml/simgrid_dtd.l + COMMAND ${CMAKE_COMMAND} -E echo " Generated src/surf/xml/simgrid_dtd.l" #${CMAKE_HOME_DIRECTORY}/src/xbt/graphxml.l: ${CMAKE_HOME_DIRECTORY}/src/xbt/graphxml.dtd COMMAND ${FLEXML_EXE} -b 1000000 -P graphxml --sysid=graphxml.dtd -S src/xbt/graphxml.l -L src/xbt/graphxml.dtd COMMAND ${SED_EXE} -i ${string14} src/xbt/graphxml.l - COMMAND ${CMAKE_COMMAND} -E echo "src/xbt/graphxml.l" + COMMAND ${CMAKE_COMMAND} -E echo " Generated src/xbt/graphxml.l" #${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.l: ${CMAKE_HOME_DIRECTORY}/src/simdag/dax.dtd COMMAND ${FLEXML_EXE} -b 1000000 --root-tags adag -P dax_ --sysid=dax.dtd -S src/simdag/dax_dtd.l -L src/simdag/dax.dtd COMMAND ${SED_EXE} -i ${string5} src/simdag/dax_dtd.l COMMAND ${SED_EXE} -i ${string14} src/simdag/dax_dtd.l - COMMAND ${CMAKE_COMMAND} -E echo "src/simdag/dax_dtd.l" + COMMAND ${CMAKE_COMMAND} -E echo " Generated src/simdag/dax_dtd.l" - #${CMAKE_HOME_DIRECTORY}/include/surf/simgrid_dtd.h: ${CMAKE_HOME_DIRECTORY}/src/surf/simgrid.dtd + #${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid_dtd.h: ${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid.dtd COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/include/surf/simgrid.h - COMMAND ${FLEXML_EXE} --root-tags platform -P surfxml --sysid=http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd -H include/surf/simgrid_dtd.h -L src/surf/simgrid.dtd - COMMAND ${SED_EXE} -i ${string1} include/surf/simgrid_dtd.h - COMMAND ${SED_EXE} -i ${string2} include/surf/simgrid_dtd.h - COMMAND ${SED_EXE} -i ${string14} include/surf/simgrid_dtd.h - COMMAND ${CMAKE_COMMAND} -E echo "include/surf/simgrid_dtd.h" + COMMAND ${FLEXML_EXE} --root-tags platform -P surfxml --sysid=http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd -H src/surf/xml/simgrid_dtd.h -L src/surf/xml/simgrid.dtd + COMMAND ${SED_EXE} -i ${string1} src/surf/xml/simgrid_dtd.h + COMMAND ${SED_EXE} -i ${string2} src/surf/xml/simgrid_dtd.h + COMMAND ${SED_EXE} -i ${string14} src/surf/xml/simgrid_dtd.h + COMMAND ${CMAKE_COMMAND} -E echo " Generated src/surf/xml/simgrid_dtd.h" #${CMAKE_HOME_DIRECTORY}/include/xbt/graphxml.h: ${CMAKE_HOME_DIRECTORY}/src/xbt/graphxml.dtd COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/include/xbt/graphxml.h @@ -185,7 +186,7 @@ if(enable_maintainer_mode AND NOT WIN32) COMMAND ${SED_EXE} -i ${string1} include/xbt/graphxml.h COMMAND ${SED_EXE} -i ${string2} include/xbt/graphxml.h COMMAND ${SED_EXE} -i ${string14} include/xbt/graphxml.h - COMMAND ${CMAKE_COMMAND} -E echo "include/xbt/graphxml.h" + COMMAND ${CMAKE_COMMAND} -E echo " Generated include/xbt/graphxml.h" #${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.h: ${CMAKE_HOME_DIRECTORY}/src/simdag/dax.dtd COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.h @@ -193,18 +194,17 @@ if(enable_maintainer_mode AND NOT WIN32) COMMAND ${SED_EXE} -i ${string1} src/simdag/dax_dtd.h COMMAND ${SED_EXE} -i ${string2} src/simdag/dax_dtd.h COMMAND ${SED_EXE} -i ${string14} src/simdag/dax_dtd.h - COMMAND ${CMAKE_COMMAND} -E echo "src/simdag/dax_dtd.h" - - #surf/simgrid_dtd.c: surf/simgrid_dtd.l - COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/src/surf/simgrid_dtd.c - COMMAND ${SED_EXE} -i ${string8} src/surf/simgrid_dtd.l - COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_HOME_DIRECTORY}/src/surf - COMMAND ${FLEX_EXE} -o src/surf/simgrid_dtd.c -Psurf_parse_ --noline src/surf/simgrid_dtd.l - COMMAND ${SED_EXE} -i ${string9} src/surf/simgrid_dtd.c - COMMAND ${SED_EXE} -i ${string15} src/surf/simgrid_dtd.c - COMMAND ${SED_EXE} -i 's/int yyl\;/unsigned int yyl\;/' src/surf/simgrid_dtd.c - COMMAND ${SED_EXE} -i "s/register //" src/surf/simgrid_dtd.c - COMMAND ${CMAKE_COMMAND} -E echo "surf/simgrid_dtd.c" + COMMAND ${CMAKE_COMMAND} -E echo " Generated src/simdag/dax_dtd.h" + + #surf/xml/simgrid_dtd.c: surf/xml/simgrid_dtd.l + COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid_dtd.c + COMMAND ${SED_EXE} -i ${string8} src/surf/xml/simgrid_dtd.l + COMMAND ${FLEX_EXE} -o src/surf/xml/simgrid_dtd.c -Psurf_parse_ --noline src/surf/xml/simgrid_dtd.l + COMMAND ${SED_EXE} -i ${string9} src/surf/xml/simgrid_dtd.c + COMMAND ${SED_EXE} -i ${string15} src/surf/xml/simgrid_dtd.c + COMMAND ${SED_EXE} -i 's/int yyl\;/unsigned int yyl\;/' src/surf/xml/simgrid_dtd.c + COMMAND ${SED_EXE} -i "s/register //" src/surf/xml/simgrid_dtd.c + COMMAND ${CMAKE_COMMAND} -E echo " Generated surf/xml/simgrid_dtd.c" #xbt/graphxml.c: xbt/graphxml.l COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/src/xbt/graphxml.c @@ -214,7 +214,7 @@ if(enable_maintainer_mode AND NOT WIN32) COMMAND ${SED_EXE} -i ${string9} src/xbt/graphxml.c COMMAND ${SED_EXE} -i 's/int yyl\;/unsigned int yyl\;/' src/xbt/graphxml.c COMMAND ${SED_EXE} -i "s/register //" src/xbt/graphxml.c - COMMAND ${CMAKE_COMMAND} -E echo "xbt/graphxml.c" + COMMAND ${CMAKE_COMMAND} -E echo " Generated xbt/graphxml.c" #simdag/dax_dtd.c: simdag/dax_dtd.l COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.c @@ -223,7 +223,7 @@ if(enable_maintainer_mode AND NOT WIN32) COMMAND ${FLEX_EXE} -o src/simdag/dax_dtd.c -Pdax_ --noline src/simdag/dax_dtd.l COMMAND ${SED_EXE} -i ${string9} src/simdag/dax_dtd.c COMMAND ${SED_EXE} -i 's/int yyl\;/unsigned int yyl\;/' src/simdag/dax_dtd.c - COMMAND ${CMAKE_COMMAND} -E echo "src/simdag/dax_dtd.c" + COMMAND ${CMAKE_COMMAND} -E echo " Generated src/simdag/dax_dtd.c" WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY} COMMENT "Generating files in maintainer mode..." @@ -246,10 +246,10 @@ if(enable_maintainer_mode AND NOT WIN32) endif() add_custom_target(maintainer_files - DEPENDS ${CMAKE_HOME_DIRECTORY}/include/surf/simgrid_dtd.h - ${CMAKE_HOME_DIRECTORY}/include/xbt/graphxml.h - ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.h - ${CMAKE_HOME_DIRECTORY}/src/surf/simgrid_dtd.c - ${CMAKE_HOME_DIRECTORY}/src/xbt/graphxml.c - ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.c + DEPENDS ${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid_dtd.h + ${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid_dtd.c + ${CMAKE_HOME_DIRECTORY}/include/xbt/graphxml.h + ${CMAKE_HOME_DIRECTORY}/src/xbt/graphxml.c + ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.h + ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.c )