Compile and run from command prompt

You can pass command-line arguments from your shell to your named macro as well. The macro sees it as a char *. Here is an old post of mine doing that: [url]TString, stdarg, variable argument list?

So you could have your runme.C look like:

#include "TString.h"
#include "TROOT.h"

void runme(char * arg){
gROOT->ProcessLine(TString::Format(".L %s.C",arg);
gROOT->ProcessLine(TString::Format("%s t",arg);
gROOT->ProcessLine("t.Loop()");
}

then as long as your macro/macro_2 defines a class with a Loop() method, you can call any of your macros with something like: