X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a10a29a02bad2ef8c72b9e2ae32c336fc20d7c4e..b8892821525cf5204c842476d26f530ddcca4908:/tools/gras/unix_stub_generator.c diff --git a/tools/gras/unix_stub_generator.c b/tools/gras/unix_stub_generator.c index dc236d7abc..22db9860b1 100644 --- a/tools/gras/unix_stub_generator.c +++ b/tools/gras/unix_stub_generator.c @@ -25,7 +25,13 @@ #include - +#ifdef _WIN32 +/* stupid stubs so that it compiles on windows */ +void generate_sim(char *project) {} +void generate_rl(char *project) {} +void generate_makefile_local(char *project, char *deployment) {} +#else +/* real implementation */ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(stubgen); @@ -145,7 +151,7 @@ void generate_sim(char *project) { " /* Simulation setup */\n" " gras_global_init(&argc,argv);\n" " if (argc != 3) {\n" - " fprintf(stderr, \"Usage: %s platform.xml deployment.xml [--gras-log=...]\\n\",argv[0]);\n" + " fprintf(stderr, \"Usage: %s platform.xml deployment.xml [--log=...]\\n\",argv[0]);\n" " exit(1);\n" " }\n" "\n"); @@ -252,8 +258,9 @@ void generate_makefile_am(char *project, char *deployment) { fprintf(OUT, "=\tpath/to/libgras.a\n\n"); } - fprintf(OUT, "\n# cleanup temps\n"); - fprintf(OUT, "CLEANFILES= "); + fprintf(OUT, "\n# cleanup temps (allowing the user to add extra clean files)\n"); + fprintf(OUT, "CLEANFILES?= \n"); + fprintf(OUT, "CLEANFILES+= "); fprintf(OUT, SIM_SOURCENAME, project); xbt_dict_foreach(process_function_set,cursor,key,data) { @@ -303,7 +310,7 @@ void generate_makefile_local(char *project, char *deployment) { fprintf(OUT, "# Set the GRAS_ROOT environment variable to the path under which you installed SimGrid\n" "# Compilation will fail if you don't do so\n" - "GRAS_ROOT?= $(shell echo \"\\\"<<<< GRAS_ROOT undefined !!! >>>>\\\"\")\n\n" + "GRAS_ROOT?= $(shell if [ -e /usr/local/lib/libgras.so ] ; then echo /usr/local ; else echo \"\\\"<<<< GRAS_ROOT undefined !!! >>>>\\\"\"; fi)\n\n" "# You can fiddle the following to make it fit your taste\n" "INCLUDES = -I$(GRAS_ROOT)/include\n" "CFLAGS ?= -O3 -w -g\n" @@ -376,7 +383,7 @@ void generate_makefile_local(char *project, char *deployment) { fprintf(OUT, "clean:\n" - "\trm -f $(BIN_FILES) $(OBJ_FILES) *~ %s.o " SIM_OBJNAME, project, project); + "\trm -f $(CLEANFILES) $(BIN_FILES) $(OBJ_FILES) *~ %s.o " SIM_OBJNAME, project, project); xbt_dict_foreach(process_function_set,cursor,key,data) { fprintf(OUT, " " RL_OBJNAME, project, key); } @@ -449,3 +456,4 @@ static void print(void *p) { printf("%p",p); } +#endif