I cannot check (the tools are not installed on this computer), but I suggest:
1. Create a new project.
2. When you create the application, you have a dialog box where you can select the type of the application. Select a library.
3 Add your source files as children of the library, and build it.
I know this solution works with the Raisonance compilers / library manager, but I never tested it with the GNU tools. If it does not work as expected, you would have to run the command line library manager.