const char *WARN = "/***********\n * DO NOT EDIT! THIS FILE WERE AUTOMATICALLY GENERATED FROM %s BY gras_stub_generator\n ***********/\n";
const char *SIM_FILENAME = "_%s_simulator.c";
const char *SIM_BINARYNAME = "%s_simulator";
-const char *SIM_FILENAME_LDADD = "_%s_simulator_LDADD";
-const char *SIM_FILENAME_SOURCES = "_%s_simulator_SOURCES";
+const char *SIM_FILENAME_LDADD = "%s_simulator_LDADD";
+const char *SIM_FILENAME_SOURCES = "%s_simulator_SOURCES";
const char *RL_FILENAME = "_%s_%s.c";
const char *RL_BINARYNAME = "%s_%s";
const char *RL_FILENAME_LDADD = "%s_%s_LDADD";
"int main (int argc,char *argv[]) {\n"
" int i,j;\n"
"\n"
-" /* Save the gras-log argument of real command line to pass it to all processes */\n"
-" for (i=1; i<argc; i++) {\n"
-" if (!strncmp(argv[i],\"--gras-log=\",strlen(\"--gras-log=\"))) {\n"
-" if (gras_log) {\n"
-" char *tmp=malloc(strlen(gras_log)+strlen(argv[i])+2);\n"
-" sprintf(tmp,\"%%s %%s\",gras_log, argv[i]);\n"
-" free(gras_log);\n"
-" gras_log=tmp;\n"
-" } else {\n"
-" gras_log = strdup(argv[i]);\n"
-" }\n"
-" for (j=i+1; j<argc; j++) {\n"
-" argv[j-1] = argv[j];\n"
-" } \n"
-" argv[j-1] = NULL;\n"
-" argc--;\n"
-" i--; /* compensate effect of next loop incrementation */\n"
-" }\n"
-" }\n"
-"\n"
+" /* Simulation setup */\n"
+" MSG_global_init_args(&argc,argv);\n"
" if (argc != 3) {\n"
" fprintf(stderr, \"Usage: %%s platform_file application_description.txt [--gras-log=...]\\n\",argv[0]);\n"
" exit(1);\n"
" }\n"
"\n"
-" /* Simulation setup */\n"
-" MSG_global_init();\n"
-" MSG_set_verbosity(MSG_SILENT);\n"
" MSG_set_channel_number(10); // GRAS_MAX_CHANNEL hardcoded since Alvin killed its definition\n"
" MSG_create_environment(argv[1]);\n"
"\n"
fprintf(OUT, "# AUTOMAKE variable definition\n");
fprintf(OUT, "INCLUDES= @CFLAGS_SimGrid@\n\n");
fprintf(OUT, "PROGRAMS=");
- fprintf(OUT, SIM_FILENAME,project);
+ fprintf(OUT, SIM_BINARYNAME,project);
xbt_dict_foreach(process_function_set,cursor,key,data) {
fprintf(OUT, " ");
fprintf(OUT, "\n\n");
fprintf(OUT, SIM_FILENAME_SOURCES,project);
- fprintf(OUT, "=");
+ fprintf(OUT, "=\t");
fprintf(OUT, SIM_FILENAME,project);
fprintf(OUT, " %s.c\n", project);
+ fprintf(OUT, SIM_FILENAME_LDADD, project);
+ fprintf(OUT, "=\tpath/to/libsimgrid.a\n\n");
xbt_dict_foreach(process_function_set,cursor,key,data) {
fprintf(OUT, RL_FILENAME_SOURCES, project,key);
fprintf(OUT, "=\t");
fprintf(OUT, RL_FILENAME, project,key);
fprintf(OUT, " %s.c\n", project);
- }
-
- fprintf(OUT, "\n\n");
- fprintf(OUT, SIM_FILENAME_LDADD, project);
- fprintf(OUT, "=\tpath/to/libsimgrid.a\n");
-
-
- xbt_dict_foreach(process_function_set,cursor,key,data) {
fprintf(OUT, RL_FILENAME_LDADD, project, key);
- fprintf(OUT, "=\tpath/to/libgras.a\n");
+ fprintf(OUT, "=\tpath/to/libgras.a\n\n");
}
fprintf(OUT, "\n# cleanup temps\n");