Compiling several .h and .cpp files in same folders

I have the following files

[color=#008080]header1.h, header2.h, header3.h [/color]
[color=#800000]source1.cxx, source2.cxx, source2.cxx[/color]
[color=#008000]myCode.C[/color] - using the libraries above.

How can I compile all the files at once either from the root prompt or outside it ?

Because each time I generate shared libraries using .cxx files manually using

root[ ] .L source1.cxx+
root[ ] .L source2.cxx+
root[ ] .L source3.cxx+

which became unmanageable as more files kept coming.

I tried writing the macro following this link :
[url]Compiling multiple files

and changing the file names and putting in the folder
/usr/share/root/macros/, wasn’t successful though.

I apologize, I mistyped the names in my macroLoader.C, worked beautifully based on the link


{ gROOT->ProcessLine(".L source1.cpp+"); gROOT->ProcessLine(".L source2.cpp+"); gROOT->ProcessLine(".L source3.cpp+"); }