Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Now it shoulds correctely work.
[simgrid.git] / buildtools / Cmake / MaintainerMode.cmake
index a939d07..e96c63b 100644 (file)
@@ -2,7 +2,6 @@ if(enable_maintainer_mode AND NOT WIN32)
 find_program(FLEX_EXE NAMES flex)
 find_program(FLEXML_EXE NAMES flexml)
 find_program(SED_EXE NAMES sed)
-find_program(PERL_EXE NAMES perl)
 
 IF(FLEX_EXE)
        set(HAVE_FLEX 1)
@@ -57,49 +56,49 @@ ADD_CUSTOM_COMMAND(
        COMMAND ${CMAKE_COMMAND} -E echo "src/xbt/graphxml.l"
        #${PROJECT_DIRECTORY}/src/simdag/dax_dtd.l: ${PROJECT_DIRECTORY}/src/simdag/dax.dtd
        COMMAND ${FLEXML_EXE} -b 1000000 --root-tags adag -P dax_ --sysid=dax.dtd -S ${PROJECT_DIRECTORY}/src/simdag/dax_dtd.l -L ${PROJECT_DIRECTORY}/src/simdag/dax.dtd
-       COMMAND ${SED_EXE} -i'' ${string5} src/simdag/dax_dtd.l
+       COMMAND ${SED_EXE} -i ${string5} src/simdag/dax_dtd.l
        COMMAND ${CMAKE_COMMAND} -E echo "src/simdag/dax_dtd.l"
        
        #${PROJECT_DIRECTORY}/include/surf/simgrid_dtd.h: ${PROJECT_DIRECTORY}/src/surf/simgrid.dtd
        COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/include/surf/simgrid.h
        COMMAND ${FLEXML_EXE} --root-tags platform -P surfxml --sysid=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 ${string1} include/surf/simgrid_dtd.h
+       COMMAND ${SED_EXE} -i ${string2} include/surf/simgrid_dtd.h     
        COMMAND ${CMAKE_COMMAND} -E echo "include/surf/simgrid_dtd.h"
        #${PROJECT_DIRECTORY}/include/xbt/graphxml.h: ${PROJECT_DIRECTORY}/src/xbt/graphxml.dtd
        COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/include/xbt/graphxml.h
        COMMAND ${FLEXML_EXE} -P graphxml --sysid=graphxml.dtd -H include/xbt/graphxml.h -L src/xbt/graphxml.dtd
-       COMMAND ${SED_EXE} -i'' ${string3} include/xbt/graphxml.h       
-       COMMAND ${SED_EXE} -i'' ${string4} include/xbt/graphxml.h
+       COMMAND ${SED_EXE} -i ${string3} include/xbt/graphxml.h 
+       COMMAND ${SED_EXE} -i ${string4} include/xbt/graphxml.h
        COMMAND ${CMAKE_COMMAND} -E echo "include/xbt/graphxml.h"
        #${PROJECT_DIRECTORY}/src/simdag/dax_dtd.h: ${PROJECT_DIRECTORY}/src/simdag/dax.dtd
        COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/src/simdag/dax_dtd.h
        COMMAND ${FLEXML_EXE} --root-tags adag -P dax_ --sysid=dax.dtd -H src/simdag/dax_dtd.h -L src/simdag/dax.dtd
-       COMMAND ${SED_EXE} -i'' ${string6} src/simdag/dax_dtd.h 
-       COMMAND ${SED_EXE} -i'' ${string7} src/simdag/dax_dtd.h
+       COMMAND ${SED_EXE} -i ${string6} src/simdag/dax_dtd.h   
+       COMMAND ${SED_EXE} -i ${string7} src/simdag/dax_dtd.h
        COMMAND ${FLEX_EXE} -o src/gras/DataDesc/ddt_parse.yy.c -Pgras_ddt_parse_ --noline src/gras/DataDesc/ddt_parse.yy.l
        COMMAND ${CMAKE_COMMAND} -E echo "src/simdag/dax_dtd.h"
        
        #surf/simgrid_dtd.c: surf/simgrid_dtd.l
        COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/src/surf/simgrid_dtd.c
-       COMMAND ${SED_EXE} -i'' ${string8} src/surf/simgrid_dtd.l
+       COMMAND ${SED_EXE} -i ${string8} src/surf/simgrid_dtd.l
        COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_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 ${string9} src/surf/simgrid_dtd.c
        COMMAND ${CMAKE_COMMAND} -E echo "surf/simgrid_dtd.c"
        #xbt/graphxml.c: xbt/graphxml.l
        COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/src/xbt/graphxml.c
-       COMMAND ${SED_EXE} -i'' ${string10} src/xbt/graphxml.l  
+       COMMAND ${SED_EXE} -i ${string10} src/xbt/graphxml.l    
        COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_DIRECTORY}/src/xbt
        COMMAND ${FLEX_EXE} -o src/xbt/graphxml.c -Pxbt_graph_parse_ --noline src/xbt/graphxml.l
-       COMMAND ${SED_EXE} -i'' ${string11} src/xbt/graphxml.c
+       COMMAND ${SED_EXE} -i ${string11} src/xbt/graphxml.c
        COMMAND ${CMAKE_COMMAND} -E echo "xbt/graphxml.c"
        #simdag/dax_dtd.c: simdag/dax_dtd.l
        COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/src/simdag/dax_dtd.c
-       COMMAND ${SED_EXE} -i'' ${string12} src/simdag/dax_dtd.l
+       COMMAND ${SED_EXE} -i ${string12} src/simdag/dax_dtd.l
        COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_DIRECTORY}/src/simdag
        COMMAND ${FLEX_EXE} -o src/simdag/dax_dtd.c -Pdax_ --noline src/simdag/dax_dtd.l
-       COMMAND ${SED_EXE} -i'' ${string13} src/simdag/dax_dtd.c
+       COMMAND ${SED_EXE} -i ${string13} src/simdag/dax_dtd.c
        COMMAND ${CMAKE_COMMAND} -E echo "simdag/dax_dtd.c"
        
        WORKING_DIRECTORY ${PROJECT_DIRECTORY}
@@ -133,87 +132,6 @@ else(HAVE_FLEXML AND HAVE_FLEX  AND SED_EXE)
        message(FATAL_ERROR "Need to install all tools for maintainer mode !!!")
 endif(HAVE_FLEXML AND HAVE_FLEX  AND SED_EXE)
 
-if(PERL_EXE)
-       
-       ADD_CUSTOM_COMMAND(
-       OUTPUT  ${PROJECT_DIRECTORY}/src/cunit_unit.c
-                       ${PROJECT_DIRECTORY}/src/ex_unit.c
-                       ${PROJECT_DIRECTORY}/src/dynar_unit.c
-                       ${PROJECT_DIRECTORY}/src/dict_unit.c
-                       ${PROJECT_DIRECTORY}/src/set_unit.c
-                       ${PROJECT_DIRECTORY}/src/swag_unit.c
-                       ${PROJECT_DIRECTORY}/src/xbt_str_unit.c
-                       ${PROJECT_DIRECTORY}/src/xbt_strbuff_unit.c
-                       ${PROJECT_DIRECTORY}/src/xbt_sha_unit.c
-                       ${PROJECT_DIRECTORY}/src/config_unit.c
-                       ${PROJECT_DIRECTORY}/src/xbt_synchro_unit.c
-                       
-       DEPENDS ${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl
-                       ${PROJECT_DIRECTORY}/src/xbt/cunit.c
-                       ${PROJECT_DIRECTORY}/src/xbt/ex.c
-                       ${PROJECT_DIRECTORY}/src/xbt/dynar.c
-                       ${PROJECT_DIRECTORY}/src/xbt/dict.c
-                       ${PROJECT_DIRECTORY}/src/xbt/set.c
-                       ${PROJECT_DIRECTORY}/src/xbt/swag.c
-                       ${PROJECT_DIRECTORY}/src/xbt/xbt_str.c
-                       ${PROJECT_DIRECTORY}/src/xbt/xbt_strbuff.c
-                       ${PROJECT_DIRECTORY}/src/xbt/xbt_sha.c
-                       ${PROJECT_DIRECTORY}/src/xbt/config.c
-                       ${PROJECT_DIRECTORY}/src/xbt/xbt_synchro.c
-       
-       COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/src/simgrid_units_main.c
-       COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/src/cunit_unit.c
-       COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/src/ex_unit.c
-       COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/src/dynar_unit.c
-       COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/src/dict_unit.c
-       COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/src/set_unit.c
-       COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/src/swag_unit.c
-       COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/src/xbt_str_unit.c
-       COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/src/xbt_strbuff_unit.c
-       COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/src/xbt_sha_unit.c
-       COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/src/config_unit.c
-       COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/src/xbt_synchro_unit.c
-       
-       COMMAND chmod a=rwx ${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl
-       
-       #$(TEST_UNITS): $(TEST_CFILES)
-       COMMAND ${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl xbt/cunit.c
-       COMMAND ${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl xbt/ex.c
-       COMMAND ${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl xbt/dynar.c
-       COMMAND ${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl xbt/dict.c
-       COMMAND ${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl xbt/set.c
-       COMMAND ${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl xbt/swag.c
-       COMMAND ${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl xbt/xbt_str.c
-       COMMAND ${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl xbt/xbt_strbuff.c
-       COMMAND ${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl xbt/xbt_sha.c
-       COMMAND ${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl xbt/config.c
-       COMMAND ${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl xbt/xbt_synchro.c
-       
-       #@builddir@/simgrid_units_main.c: $(TEST_UNITS)
-       COMMAND ${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl xbt/cunit.c
-       
-       WORKING_DIRECTORY ${PROJECT_DIRECTORY}/src
-       
-       COMMENT "Generating *_units files for testall..."
-       )
-       
-       add_custom_target(units_files
-                                               DEPENDS ${PROJECT_DIRECTORY}/src/cunit_unit.c
-                                                               ${PROJECT_DIRECTORY}/src/ex_unit.c
-                                                               ${PROJECT_DIRECTORY}/src/dynar_unit.c
-                                                               ${PROJECT_DIRECTORY}/src/dict_unit.c
-                                                               ${PROJECT_DIRECTORY}/src/set_unit.c
-                                                               ${PROJECT_DIRECTORY}/src/swag_unit.c
-                                                               ${PROJECT_DIRECTORY}/src/xbt_str_unit.c
-                                                               ${PROJECT_DIRECTORY}/src/xbt_strbuff_unit.c
-                                                               ${PROJECT_DIRECTORY}/src/xbt_sha_unit.c
-                                                               ${PROJECT_DIRECTORY}/src/config_unit.c
-                                                               ${PROJECT_DIRECTORY}/src/xbt_synchro_unit.c
-                                               )
-       
-else(PERL_EXE)
-       message(FATAL_ERROR "Install perl before use maintainer mode")
-endif(PERL_EXE)
 
 endif(enable_maintainer_mode AND NOT WIN32)